diff options
4 files changed, 11 insertions, 10 deletions
diff --git a/ansible/nsb_setup.yml b/ansible/nsb_setup.yml index 3d28932d9..90fba0b1e 100644 --- a/ansible/nsb_setup.yml +++ b/ansible/nsb_setup.yml @@ -56,4 +56,5 @@ volumes: - "{{ openrc_file|default('/dev/null') }}:/etc/yardstick/openstack.creds:ro" - /var/run/docker.sock:/var/run/docker.sock - - /opt/:/opt + - /opt:/opt + - /etc/localtime:/etc/localtime:ro 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 4d53f0989..1e6bc1a13 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 @@ -1516,8 +1516,9 @@ class TestSampleVNFDeployHelper(unittest.TestCase): sample_vnf_deploy_helper = SampleVNFDeployHelper(vnfd_helper, ssh_helper) self.assertIsNone(sample_vnf_deploy_helper.deploy_vnfs('name1')) - self.assertEqual(ssh_helper.execute.call_count, 0) - self.assertEqual(ssh_helper.put.call_count, 0) + sample_vnf_deploy_helper.DISABLE_DEPLOY = True + self.assertEqual(ssh_helper.execute.call_count, 5) + self.assertEqual(ssh_helper.put.call_count, 1) @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') @mock.patch('subprocess.check_output') diff --git a/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py b/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py index 39b37c606..d4d3439f3 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py @@ -444,6 +444,8 @@ class TestUdpReplayApproxVnf(unittest.TestCase): udp_replay_approx_vnf.WAIT_TIME = 0 udp_replay_approx_vnf.setup_helper.setup_vnf_environment = mock.Mock() + udp_replay_approx_vnf.deploy_helper = mock.MagicMock() + udp_replay_approx_vnf.deploy_vnfs = mock.MagicMock() self.assertIsNone(udp_replay_approx_vnf.instantiate(self.SCENARIO_CFG, self.CONTEXT_CFG)) udp_replay_approx_vnf._vnf_process.is_alive = mock.Mock(return_value=1) @@ -460,6 +462,7 @@ class TestUdpReplayApproxVnf(unittest.TestCase): udp_replay_approx_vnf.q_out.put("some text PANIC some text") udp_replay_approx_vnf.setup_helper.setup_vnf_environment = mock.Mock() + udp_replay_approx_vnf.deploy_helper = mock.MagicMock() self.assertIsNone(udp_replay_approx_vnf.instantiate(self.SCENARIO_CFG, self.CONTEXT_CFG)) with self.assertRaises(RuntimeError): udp_replay_approx_vnf.wait_for_instantiate() diff --git a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py index 114153dab..92f78c2bc 100644 --- a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py @@ -615,13 +615,7 @@ class SampleVNFDeployHelper(object): self.ssh_helper = ssh_helper self.vnfd_helper = vnfd_helper - DISABLE_DEPLOY = True - def deploy_vnfs(self, app_name): - # temp disable for now - if self.DISABLE_DEPLOY: - return - vnf_bin = self.ssh_helper.join_bin_path(app_name) exit_status = self.ssh_helper.execute("which %s" % vnf_bin)[0] if not exit_status: @@ -788,7 +782,9 @@ class SampleVNF(GenericVNF): self.nfvi_context = Context.get_context_from_server(self.scenario_helper.nodes[self.name]) # self.nfvi_context = None - self.deploy_helper.deploy_vnfs(self.APP_NAME) + # vnf deploy is unsupported, use ansible playbooks + if self.scenario_helper.options.get("vnf_deploy", False): + self.deploy_helper.deploy_vnfs(self.APP_NAME) self.resource_helper.setup() self._start_vnf() |