diff options
6 files changed, 21 insertions, 17 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/samples/vnf_samples/traffic_profiles/prox_binsearch.yaml b/samples/vnf_samples/traffic_profiles/prox_binsearch.yaml index 80f4dd335..805250ee3 100644 --- a/samples/vnf_samples/traffic_profiles/prox_binsearch.yaml +++ b/samples/vnf_samples/traffic_profiles/prox_binsearch.yaml @@ -22,7 +22,7 @@ traffic_profile: tolerated_loss: 0.001 test_precision: 0.1 # packet_sizes: [64, 128, 256, 512, 1024, 1280, 1518] - packet_sizes: [64, 65] + packet_sizes: [64] duration: 10 lower_bound: 0.0 upper_bound: 100.0 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/prox_helpers.py b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py index d9fe9a948..63c6467f4 100644 --- a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py +++ b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py @@ -1267,23 +1267,26 @@ class ProxBngProfileHelper(ProxProfileHelper): continue for item_key, item_value in section: - if item_key == "name" and item_value.startswith("cpe"): + if item_key != 'name': + continue + + if item_value.startswith("cpe"): core_tuple = CoreSocketTuple(section_name) - core_tag = core_tuple.find_in_topology(self.cpu_topology) - cpe_cores.append(core_tag) + cpe_core = core_tuple.find_in_topology(self.cpu_topology) + cpe_cores.append(cpe_core) - elif item_key == "name" and item_value.startswith("inet"): + elif item_value.startswith("inet"): core_tuple = CoreSocketTuple(section_name) inet_core = core_tuple.find_in_topology(self.cpu_topology) inet_cores.append(inet_core) - elif item_key == "name" and item_value.startswith("arp"): + elif item_value.startswith("arp"): core_tuple = CoreSocketTuple(section_name) arp_core = core_tuple.find_in_topology(self.cpu_topology) arp_cores.append(arp_core) # We check the tasks/core separately - if item_key == "name" and item_value.startswith("arp_task"): + if item_value.startswith("arp_task"): core_tuple = CoreSocketTuple(section_name) arp_task_core = core_tuple.find_in_topology(self.cpu_topology) arp_tasks_core.append(arp_task_core) 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() |