From 4336c75c74333cdd9740aedd5e5db3a5e68824be Mon Sep 17 00:00:00 2001 From: Dimitrios Markou Date: Thu, 7 Sep 2017 15:54:29 +0300 Subject: Allign the SFC testcases to the new Tacker API In this patch [0] we adapt the Tacker library which is located to the SFC repo to the new Tacker API With the current patch we allign the testcases to the aforementioned API [0] https://gerrit.opnfv.org/gerrit/#/c/40839/ Change-Id: I07f8bcefbda7d058e9322465df38077ac0346d83 Signed-off-by: Dimitrios Markou --- .../sfc_one_chain_two_service_functions.py | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'sfc/tests/functest/sfc_one_chain_two_service_functions.py') diff --git a/sfc/tests/functest/sfc_one_chain_two_service_functions.py b/sfc/tests/functest/sfc_one_chain_two_service_functions.py index 7d421efc..ba9d86ca 100644 --- a/sfc/tests/functest/sfc_one_chain_two_service_functions.py +++ b/sfc/tests/functest/sfc_one_chain_two_service_functions.py @@ -128,20 +128,22 @@ def main(): server_ip = server_instance.networks.get(TESTCASE_CONFIG.net_name)[0] logger.info("Server instance received private ip [{}]".format(server_ip)) + test_utils.register_vim(tacker_client, vim_file=COMMON_CONFIG.vim_file) + tosca_file = os.path.join(COMMON_CONFIG.sfc_test_dir, COMMON_CONFIG.vnfd_dir, TESTCASE_CONFIG.test_vnfd_red) os_tacker.create_vnfd( tacker_client, - tosca_file=tosca_file) + tosca_file=tosca_file, vnfd_name='test-vnfd1') tosca_file = os.path.join(COMMON_CONFIG.sfc_test_dir, COMMON_CONFIG.vnfd_dir, TESTCASE_CONFIG.test_vnfd_blue) os_tacker.create_vnfd( tacker_client, - tosca_file=tosca_file) + tosca_file=tosca_file, vnfd_name='test-vnfd2') default_param_file = os.path.join( COMMON_CONFIG.sfc_test_dir, @@ -149,10 +151,10 @@ def main(): COMMON_CONFIG.vnfd_default_params_file) test_utils.create_vnf_in_av_zone( - tacker_client, vnfs[0], 'test-vnfd1', + tacker_client, vnfs[0], 'test-vnfd1', 'test-vim', default_param_file, testTopology[vnfs[0]]) test_utils.create_vnf_in_av_zone( - tacker_client, vnfs[1], 'test-vnfd2', + tacker_client, vnfs[1], 'test-vnfd2', 'test-vim', default_param_file, testTopology[vnfs[1]]) vnf1_id = os_tacker.wait_for_vnf(tacker_client, vnf_name=vnfs[0]) @@ -161,25 +163,23 @@ def main(): logger.error('ERROR while booting vnfs') sys.exit(1) - vnf1_instance_id = test_utils.get_nova_id(tacker_client, 'vdu1', vnf1_id) + vnf1_instance_id = test_utils.get_nova_id(tacker_client, 'VDU1', vnf1_id) os_utils.add_secgroup_to_instance(nova_client, vnf1_instance_id, sg_id) - vnf2_instance_id = test_utils.get_nova_id(tacker_client, 'vdu1', vnf2_id) + vnf2_instance_id = test_utils.get_nova_id(tacker_client, 'VDU1', vnf2_id) os_utils.add_secgroup_to_instance(nova_client, vnf2_instance_id, sg_id) - os_tacker.create_sfc(tacker_client, 'red', - chain_vnf_names=[vnfs[0], vnfs[1]]) + tosca_file = os.path.join(COMMON_CONFIG.sfc_test_dir, + COMMON_CONFIG.vnffgd_dir, + TESTCASE_CONFIG.test_vnffgd_red) - os_tacker.create_sfc_classifier( - tacker_client, 'red_http', sfc_name='red', - match={ - 'source_port': 0, - 'dest_port': 80, - 'protocol': 6 - }) + os_tacker.create_vnffgd(tacker_client, + tosca_file=tosca_file, + vnffgd_name='red') - logger.info(test_utils.run_cmd('tacker sfc-list')[1]) - logger.info(test_utils.run_cmd('tacker sfc-classifier-list')[1]) + os_tacker.create_vnffg(tacker_client, + vnffgd_name='red', + vnffg_name='red_http') # Start measuring the time it takes to implement the classification rules t1 = threading.Thread(target=test_utils.wait_for_classification_rules, -- cgit 1.2.3-korg