diff options
-rw-r--r-- | tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py | 6 | ||||
-rw-r--r-- | yardstick/benchmark/contexts/heat.py | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py index 76f2d5b5d..0a4c12446 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py @@ -311,8 +311,9 @@ class TestCgnaptApproxVnf(unittest.TestCase): cgnapt_approx_vnf = CgnaptApproxVnf(name, vnfd) self.assertIsNone(cgnapt_approx_vnf._vnf_process) + @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') @mock.patch(SSH_HELPER) - def test_collect_kpi(self, ssh, mock_process): + def test_collect_kpi(self, ssh, mock_time, mock_process): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -324,8 +325,9 @@ class TestCgnaptApproxVnf(unittest.TestCase): result = {'packets_dropped': 0, 'packets_fwd': 0, 'packets_in': 0} self.assertEqual(result, cgnapt_approx_vnf.collect_kpi()) + @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') @mock.patch(SSH_HELPER) - def test_vnf_execute_command(self, ssh, mock_process): + def test_vnf_execute_command(self, ssh, mock_time, mock_process): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py index f93dfac28..9a7b3817f 100644 --- a/yardstick/benchmark/contexts/heat.py +++ b/yardstick/benchmark/contexts/heat.py @@ -413,10 +413,6 @@ class HeatContext(Context): attr_name: either a name for a server created by yardstick or a dict with attribute name mapping when using external heat templates """ - pkey = pkg_resources.resource_string( - 'yardstick.resources', - h_join('files/yardstick_key', get_short_key_uuid(self.key_uuid))).decode('utf-8') - if isinstance(attr_name, collections.Mapping): node_name, cname = self.split_name(attr_name['name']) if cname is None or cname != self.name: @@ -434,6 +430,10 @@ class HeatContext(Context): if server is None: return None + pkey = pkg_resources.resource_string( + 'yardstick.resources', + h_join('files/yardstick_key', get_short_key_uuid(self.key_uuid))).decode('utf-8') + result = { "user": server.context.user, "pkey": pkey, |