summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitrios Markou <mardim@intracom-telecom.com>2017-09-07 15:54:29 +0300
committerDimitrios Markou <mardim@intracom-telecom.com>2017-09-07 16:05:51 +0300
commit4336c75c74333cdd9740aedd5e5db3a5e68824be (patch)
treebc35699d468f3ba4b3f2ccbcc07eecfa1c7325b2
parent56fb19b663557ce07be6d4e5c07fd4a5b9276ed2 (diff)
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 <mardim@intracom-telecom.com>
-rw-r--r--sfc/tests/functest/sfc_one_chain_two_service_functions.py34
-rw-r--r--sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py86
2 files changed, 55 insertions, 65 deletions
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,
diff --git a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
index 068c842d..07b0a2ff 100644
--- a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
+++ b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
@@ -136,15 +136,22 @@ def main():
server_ip = server_instance.networks.get(TESTCASE_CONFIG.net_name)[0]
+ test_utils.register_vim(tacker_client, vim_file=COMMON_CONFIG.vim_file)
+
tosca_red = 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_red)
+ os_tacker.create_vnfd(tacker_client,
+ tosca_file=tosca_red,
+ vnfd_name='test-vnfd1')
tosca_blue = 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_blue)
+
+ os_tacker.create_vnfd(tacker_client,
+ tosca_file=tosca_blue,
+ vnfd_name='test-vnfd2')
default_param_file = os.path.join(
COMMON_CONFIG.sfc_test_dir,
@@ -152,10 +159,10 @@ def main():
COMMON_CONFIG.vnfd_default_params_file)
test_utils.create_vnf_in_av_zone(
- tacker_client, vnf_names[0], 'test-vnfd1',
+ tacker_client, vnf_names[0], 'test-vnfd1', 'test-vim',
default_param_file, testTopology[vnf_names[0]])
test_utils.create_vnf_in_av_zone(
- tacker_client, vnf_names[1], 'test-vnfd2',
+ tacker_client, vnf_names[1], 'test-vnfd2', 'test-vim',
default_param_file, testTopology[vnf_names[1]])
vnf1_id = os_tacker.wait_for_vnf(tacker_client, vnf_name=vnf_names[0])
@@ -164,33 +171,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=['testVNF1'])
- os_tacker.create_sfc(tacker_client, 'blue', chain_vnf_names=['testVNF2'])
+ 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')
- os_tacker.create_sfc_classifier(
- tacker_client, 'red_ssh', sfc_name='red',
- match={
- 'source_port': 0,
- 'dest_port': 22,
- 'protocol': 6
- })
-
- 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_works')
# Start measuring the time it takes to implement the classification rules
t1 = threading.Thread(target=test_utils.wait_for_classification_rules,
@@ -261,29 +258,22 @@ def main():
results.add_to_summary(2, "FAIL", "HTTP works")
logger.info("Changing the classification")
- test_utils.delete_classifier_and_acl(
- tacker_client, 'red_http', odl_ip, odl_port)
-
- test_utils.delete_classifier_and_acl(
- tacker_client, 'red_ssh', odl_ip, odl_port)
-
- os_tacker.create_sfc_classifier(
- tacker_client, 'blue_http', sfc_name='blue',
- match={
- 'source_port': 0,
- 'dest_port': 80,
- 'protocol': 6
- })
-
- os_tacker.create_sfc_classifier(
- tacker_client, 'blue_ssh', sfc_name='blue',
- match={
- 'source_port': 0,
- 'dest_port': 22,
- 'protocol': 6
- })
-
- logger.info(test_utils.run_cmd('tacker sfc-classifier-list')[1])
+
+ os_tacker.delete_vnffg(tacker_client, vnffg_name='red_http_works')
+
+ os_tacker.delete_vnffgd(tacker_client, vnffgd_name='red')
+
+ tosca_file = os.path.join(COMMON_CONFIG.sfc_test_dir,
+ COMMON_CONFIG.vnffgd_dir,
+ TESTCASE_CONFIG.test_vnffgd_blue)
+
+ os_tacker.create_vnffgd(tacker_client,
+ tosca_file=tosca_file,
+ vnffgd_name='blue')
+
+ os_tacker.create_vnffg(tacker_client,
+ vnffgd_name='blue',
+ vnffg_name='blue_ssh_works')
# Start measuring the time it takes to implement the classification rules
t2 = threading.Thread(target=test_utils.wait_for_classification_rules,