From f07dc0ecbad33522627df9cd9bc5b12f8cde0159 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Tue, 28 Nov 2017 16:39:15 +0000 Subject: Remove tool provisioning in PROX helper Tool provisioning in PROX setup environment helper is not needed [1]. The tool (PROX traffic injector) is already provided during the VNF building: ./ansible/nsb_setup.yml --> ./ansible/build_yardstick_image.yml --> ./ansible/ubuntu_server_cloudimg_modify_samplevnfs.yml --> ./ansible/roles/install_samplevnf [1]https://github.com/opnfv/yardstick/blob/master/yardstick/network_services/vnf_generic/vnf/prox_helpers.py#L641 JIRA: YARDSTICK-872 Change-Id: I0f925a7967a35a97901fbe5053793a791a7b1b01 Signed-off-by: Rodolfo Alonso Hernandez --- .../network_services/vnf_generic/vnf/test_sample_vnf.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py') diff --git a/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py index b4306ce61..beb4f8f9f 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py @@ -1879,6 +1879,23 @@ class TestSampleVnf(unittest.TestCase): self.assertRaises(y_exceptions.FunctionNotImplemented, sample_vnf.scale) + def test__run(self): + test_cmd = 'test cmd' + run_kwargs = {'arg1': 'val1', 'arg2': 'val2'} + vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] + sample_vnf = SampleVNF('vnf1', vnfd) + sample_vnf.ssh_helper = mock.Mock() + sample_vnf.setup_helper = mock.Mock() + with mock.patch.object(sample_vnf, '_build_config', + return_value=test_cmd), \ + mock.patch.object(sample_vnf, '_build_run_kwargs'): + sample_vnf.run_kwargs = run_kwargs + sample_vnf._run() + sample_vnf.ssh_helper.drop_connection.assert_called_once() + sample_vnf.ssh_helper.run.assert_called_once_with(test_cmd, + **run_kwargs) + sample_vnf.setup_helper.kill_vnf.assert_called_once() + class TestSampleVNFTrafficGen(unittest.TestCase): -- cgit 1.2.3-korg