Merge "Teach Tempest how to count vcpus"
This commit is contained in:
commit
66f9783f86
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue