aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit
diff options
context:
space:
mode:
authorStepan Andrushko <stepanx.andrushko@intel.com>2018-10-31 15:58:51 +0200
committerStepan Andrushko <stepanx.andrushko@intel.com>2019-04-19 10:41:24 +0000
commita84cbaaf620fff614a68e0cc95775c45738f14b1 (patch)
tree00dc4a51d90b437d91c2d9eaf73f6e2638f0cf15 /yardstick/tests/unit
parent37b6e13c72a5079fd0b99478a23774d05c21a04f (diff)
Log VM OS version, Sample VNF branch/commit ID
Added debug logs to track VM, Sample VNF details during testing: - Virtual machine OS, kernel version; - Sample VNF branch, commit ID. JIRA: YARDSTICK-1499 Change-Id: I243c435809d4541dfdb8c7c3466f50c5d524ac00 Signed-off-by: Stepan Andrushko <stepanx.andrushko@intel.com>
Diffstat (limited to 'yardstick/tests/unit')
-rw-r--r--yardstick/tests/unit/common/test_utils.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/yardstick/tests/unit/common/test_utils.py b/yardstick/tests/unit/common/test_utils.py
index 6b8d81907..8fed5ecf1 100644
--- a/yardstick/tests/unit/common/test_utils.py
+++ b/yardstick/tests/unit/common/test_utils.py
@@ -1433,3 +1433,31 @@ class SetupHugepagesTestCase(unittest.TestCase):
self.assertEqual(hp_size_kb, 1024)
self.assertEqual(hp_number, 10)
self.assertEqual(hp_number_set, 5)
+
+
+class GetOSSampleInfoTestCase(unittest.TestCase):
+
+ def test_get_os_version(self, *args):
+ ssh = mock.Mock()
+ ssh.execute.return_value = (0, "18.04", "")
+ utils.get_os_version(ssh)
+ ssh.execute.assert_called_once_with("cat /etc/lsb-release")
+
+ def test_get_kernel_version(self, *args):
+ ssh = mock.Mock()
+ ssh.execute.return_value = (0, "Linux", "")
+ utils.get_kernel_version(ssh)
+ ssh.execute.assert_called_once_with("uname -a")
+
+ def test_get_sample_vnf_info(self, *args):
+ json_out = """
+ {"UDP_Replay": {
+ "branch_commit": "47123bfc1b3c0d0b01884aebbce1a3e09ad7ddb0",
+ "md5": "4577702f6d6848380bd912232a1b9ca5",
+ "path_vnf": "/opt/nsb_bin/UDP_Replay"
+ }
+ }"""
+ json_file = '/opt/nsb_bin/yardstick_sample_vnf.json'
+ ssh = mock.Mock()
+ ssh.execute.return_value = (0, json_out, "")
+ utils.get_sample_vnf_info(ssh, json_file)