Merge "Teach Tempest how to count vcpus"
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index 6150b4d..b76c356 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -73,7 +73,7 @@
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):
diff --git a/tempest/tests/common/utils/linux/test_remote_client.py b/tempest/tests/common/utils/linux/test_remote_client.py
index 6b02d02..9c2b99e 100644
--- a/tempest/tests/common/utils/linux/test_remote_client.py
+++ b/tempest/tests/common/utils/linux/test_remote_client.py
@@ -79,7 +79,7 @@
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