X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Funit%2Fnetwork_services%2Fnfvi%2Ftest_resource.py;h=2eef784fcf974838b64892f2f45031692d6c7418;hb=8291c3d11227de42599be920605f3f884dfa755b;hp=799cc202b70e27ffb036252b4fbfd790c3e5d211;hpb=add9dfa6f8739ec3328388c2658750e185e6a3ed;p=yardstick.git diff --git a/tests/unit/network_services/nfvi/test_resource.py b/tests/unit/network_services/nfvi/test_resource.py index 799cc202b..2eef784fc 100644 --- a/tests/unit/network_services/nfvi/test_resource.py +++ b/tests/unit/network_services/nfvi/test_resource.py @@ -99,7 +99,7 @@ class TestResourceProfile(unittest.TestCase): port_names = \ self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]['vdu'][0]['external-interface'] self.resource_profile = \ - ResourceProfile(mgmt, port_names, [1, 2, 3]) + ResourceProfile(mgmt, port_names) self.resource_profile.connection = self.ssh_mock def test___init__(self): @@ -134,6 +134,14 @@ class TestResourceProfile(unittest.TestCase): self.assertIsNone( self.resource_profile._prepare_collectd_conf("/opt/nsb_bin")) + def test__setup_intel_pmu(self): + self.assertIsNone( + self.resource_profile._setup_intel_pmu(self.ssh_mock, "/opt/nsb_bin")) + + def test__setup_ovs_stats(self): + self.assertIsNone( + self.resource_profile._setup_ovs_stats(self.ssh_mock)) + @mock.patch("yardstick.network_services.nfvi.resource.open") @mock.patch("yardstick.network_services.nfvi.resource.os") def test__provide_config_file(self, mock_open, mock_os): @@ -187,7 +195,6 @@ class TestResourceProfile(unittest.TestCase): res = self.resource_profile.parse_collectd_result({}) expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {}, 'memory': {}, 'ovs_stats': {}, 'timestamp': '', - 'intel_pmu': {}, 'virt': {}} self.assertDictEqual(res, expected_result) @@ -200,7 +207,6 @@ class TestResourceProfile(unittest.TestCase): res = self.resource_profile.parse_collectd_result(metric) expected_result = {'cpu': {1: {'ipc': '1234'}}, 'dpdkstat': {}, 'hugepages': {}, 'memory': {}, 'ovs_stats': {}, 'timestamp': '', - 'intel_pmu': {}, 'virt': {}} self.assertDictEqual(res, expected_result) @@ -209,7 +215,6 @@ class TestResourceProfile(unittest.TestCase): res = self.resource_profile.parse_collectd_result(metric) expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {}, 'memory': {'bw': '101'}, 'ovs_stats': {}, 'timestamp': '', - 'intel_pmu': {}, 'virt': {}} self.assertDictEqual(res, expected_result) @@ -220,7 +225,6 @@ class TestResourceProfile(unittest.TestCase): res = self.resource_profile.parse_collectd_result(metric) expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {'free': '101'}, 'memory': {}, 'ovs_stats': {}, 'timestamp': '', - 'intel_pmu': {}, 'virt': {}} self.assertDictEqual(res, expected_result) @@ -237,7 +241,6 @@ class TestResourceProfile(unittest.TestCase): res = self.resource_profile.parse_collectd_result(metric) expected_result = {'cpu': {}, 'dpdkstat': {'tx': '101'}, 'hugepages': {}, 'memory': {}, 'ovs_stats': {'tx': '101'}, 'timestamp': '', - 'intel_pmu': {}, 'virt': {'memory': '101'}} self.assertDictEqual(res, expected_result)