Merge "Teach Tempest how to count vcpus"

This commit is contained in:
Jenkins 2015-12-18 02:28:04 +00:00 committed by Gerrit Code Review
commit 66f9783f86
2 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ class RemoteClient(object):
return output.split()[1]
def get_number_of_vcpus(self):
output = self.exec_command('grep -c processor /proc/cpuinfo')
output = self.exec_command('grep -c ^processor /proc/cpuinfo')
return int(output)
def get_partitions(self):

View File

@ -79,7 +79,7 @@ class TestRemoteClient(base.TestCase):
def test_get_number_of_vcpus(self):
self.ssh_mock.mock.exec_command.return_value = '16'
self.assertEqual(self.conn.get_number_of_vcpus(), 16)
self._assert_exec_called_with('grep -c processor /proc/cpuinfo')
self._assert_exec_called_with('grep -c ^processor /proc/cpuinfo')
def test_get_partitions(self):
proc_partitions = """major minor #blocks name