diff options
Diffstat (limited to 'sfc/tests')
18 files changed, 416 insertions, 102 deletions
diff --git a/sfc/tests/functest/config-pike.yaml b/sfc/tests/functest/config-pike.yaml new file mode 100644 index 00000000..6b7b5a80 --- /dev/null +++ b/sfc/tests/functest/config-pike.yaml @@ -0,0 +1,84 @@ +--- +defaults: + # odl-sfc uses custom flavors as per below params + flavor: custom + ram_size_in_mb: 500 + disk_size_in_gb: 1 + vcpu_count: 1 + image_name: sfc_nsh_fraser + installer: + fuel: + user: root + password: r00tme + cluster: 1 # Change this to the id of the desired fuel env (1, 2, 3...) + apex: + user: stack + pkey_file: "/root/.ssh/id_rsa" + osa: + user: root + pkey_file: "/root/.ssh/id_rsa" + compass: + user: root + pkey_file: "/root/.ssh/id_rsa" + image_format: qcow2 + image_url: "http://artifacts.opnfv.org/sfc/images/sfc_nsh_fraser.qcow2" + vnfd-dir: "vnfd-templates" + vnfd-default-params-file: "test-vnfd-default-params.yaml" + + +testcases: + sfc_one_chain_two_service_functions: + enabled: true + order: 0 + description: "ODL-SFC Testing SFs when they are located on the same chain" + net_name: example-net + subnet_name: example-subnet + router_name: example-router + subnet_cidr: "11.0.0.0/24" + secgroup_name: "example-sg" + secgroup_descr: "Example Security group" + test_vnfd_red: "test-one-chain-vnfd1.yaml" + test_vnfd_blue: "test-one-chain-vnfd2.yaml" + test_vnffgd_red: "test-one-chain-vnffgd-pike.yaml" + + sfc_two_chains_SSH_and_HTTP: + enabled: false + order: 1 + description: "ODL-SFC tests with two chains and one SF per chain" + net_name: example-net + subnet_name: example-subnet + router_name: example-router + subnet_cidr: "11.0.0.0/24" + secgroup_name: "example-sg" + secgroup_descr: "Example Security group" + test_vnfd_red: "test-two-chains-vnfd1.yaml" + test_vnfd_blue: "test-two-chains-vnfd2.yaml" + test_vnffgd_red: "test-two-chains-vnffgd1-pike.yaml" + test_vnffgd_blue: "test-two-chains-vnffgd2-pike.yaml" + + sfc_symmetric_chain: + enabled: false + order: 2 + description: "Verify the behavior of a symmetric service chain" + net_name: example-net + subnet_name: example-subnet + router_name: example-router + subnet_cidr: "11.0.0.0/24" + secgroup_name: "example-sg" + secgroup_descr: "Example Security group" + test_vnfd: "test-symmetric-vnfd.yaml" + allowed_source_port: 22222 + blocked_source_port: 33333 + + sfc_chain_deletion: + enabled: false + order: 3 + description: "Verify if chains work correctly after deleting one" + net_name: example-net + subnet_name: example-subnet + router_name: example-router + subnet_cidr: "11.0.0.0/24" + secgroup_name: "example-sg" + secgroup_descr: "Example Security group" + test_vnfd_red: "test-one-chain-vnfd1.yaml" + test_vnffgd_red: "test-deletion-vnffgd-pike.yaml" diff --git a/sfc/tests/functest/config.yaml b/sfc/tests/functest/config.yaml index 5bbba65f..3cd1883a 100644 --- a/sfc/tests/functest/config.yaml +++ b/sfc/tests/functest/config.yaml @@ -17,6 +17,9 @@ defaults: osa: user: root pkey_file: "/root/.ssh/id_rsa" + compass: + user: root + pkey_file: "/root/.ssh/id_rsa" image_format: qcow2 image_url: "http://artifacts.opnfv.org/sfc/images/sfc_nsh_fraser.qcow2" vnfd-dir: "vnfd-templates" diff --git a/sfc/tests/functest/run_sfc_tests.py b/sfc/tests/functest/run_sfc_tests.py index a1e73040..64c5b385 100644 --- a/sfc/tests/functest/run_sfc_tests.py +++ b/sfc/tests/functest/run_sfc_tests.py @@ -1,4 +1,4 @@ -#!/bin/python +#!/usr/bin/env python # # Copyright (c) 2015 All rights reserved # This program and the accompanying materials @@ -11,10 +11,10 @@ import importlib import os import time -import sys import yaml +import sys -from functest.core import testcase +from xtesting.core import testcase from opnfv.utils import ovs_logger as ovs_log from opnfv.deployment.factory import Factory as DeploymentFactory from sfc.lib import cleanup as sfc_cleanup @@ -104,7 +104,7 @@ class SfcFunctest(testcase.TestCase): self.__disable_heat_resource_finder_cache_apex(controllers) elif installer_type == "fuel": self.__disable_heat_resource_finder_cache_fuel(controllers) - elif installer_type == "osa": + elif installer_type == "osa" or "compass": pass else: raise Exception('Unsupported installer') @@ -187,8 +187,7 @@ class SfcFunctest(testcase.TestCase): return testcase.TestCase.EX_RUN_ERROR -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s' - '- %(levelname)s - %(message)s') +def main(): + logging.basicConfig(level=logging.INFO) SFC = SfcFunctest() sys.exit(SFC.run()) diff --git a/sfc/tests/functest/sfc_chain_deletion.py b/sfc/tests/functest/sfc_chain_deletion.py index 22d634e0..9fde460f 100644 --- a/sfc/tests/functest/sfc_chain_deletion.py +++ b/sfc/tests/functest/sfc_chain_deletion.py @@ -1,4 +1,4 @@ -#!/bin/python +#!/usr/bin/env python # # Copyright (c) 2015 All rights reserved # This program and the accompanying materials @@ -42,7 +42,7 @@ def main(): installer_type = os.environ.get("INSTALLER_TYPE") - supported_installers = ['fuel', 'apex', 'osa'] + supported_installers = ['fuel', 'apex', 'osa', 'compass'] if installer_type not in supported_installers: logger.error( @@ -155,14 +155,16 @@ def main(): logger.error('ERROR while booting vnfs') sys.exit(1) - neutron_port = openstack_sfc.get_client_port_id(client_instance) + neutron_port = openstack_sfc.get_client_port(client_instance, + client_creator) odl_utils.create_chain(tacker_client, default_param_file, neutron_port, COMMON_CONFIG, TESTCASE_CONFIG) # Start measuring the time it takes to implement the classification rules t1 = threading.Thread(target=odl_utils.wait_for_classification_rules, args=(ovs_logger, compute_nodes, odl_ip, - odl_port, openstack_sfc.get_compute_client(),)) + odl_port, openstack_sfc.get_compute_client(), + [neutron_port],)) try: t1.start() @@ -208,8 +210,9 @@ def main(): os_sfc_utils.delete_vnffgd(tacker_client, vnffgd_name='red') if not odl_utils.check_vnffg_deletion(odl_ip, odl_port, ovs_logger, - openstack_sfc.get_compute_client(), - compute_nodes): + [neutron_port], + openstack_sfc.get_compute_client(), + compute_nodes): logger.debug("The chains were not correctly removed") raise Exception("Chains not correctly removed, test failed") @@ -219,7 +222,8 @@ def main(): # Start measuring the time it takes to implement the classification rules t2 = threading.Thread(target=odl_utils.wait_for_classification_rules, args=(ovs_logger, compute_nodes, odl_ip, - odl_port, openstack_sfc.get_compute_client(),)) + odl_port, openstack_sfc.get_compute_client(), + [neutron_port],)) try: t2.start() except Exception as e: 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 411262d1..07f7814c 100644 --- a/sfc/tests/functest/sfc_one_chain_two_service_functions.py +++ b/sfc/tests/functest/sfc_one_chain_two_service_functions.py @@ -43,7 +43,7 @@ def main(): installer_type = os.environ.get("INSTALLER_TYPE") - supported_installers = ['fuel', 'apex', 'osa'] + supported_installers = ['fuel', 'apex', 'osa', 'compass'] if installer_type not in supported_installers: logger.error( @@ -177,7 +177,8 @@ def main(): tosca_file=tosca_file, vnffgd_name='red') - neutron_port = openstack_sfc.get_client_port_id(client_instance) + neutron_port = openstack_sfc.get_client_port(client_instance, + client_creator) os_sfc_utils.create_vnffg_with_param_file(tacker_client, 'red', 'red_http', default_param_file, @@ -186,7 +187,8 @@ def main(): # Start measuring the time it takes to implement the classification rules t1 = threading.Thread(target=odl_utils.wait_for_classification_rules, args=(ovs_logger, compute_nodes, odl_ip, - odl_port, openstack_sfc.get_compute_client(),)) + odl_port, openstack_sfc.get_compute_client(), + [neutron_port],)) try: t1.start() except Exception as e: diff --git a/sfc/tests/functest/sfc_symmetric_chain.py b/sfc/tests/functest/sfc_symmetric_chain.py index b8d35514..43599d62 100644 --- a/sfc/tests/functest/sfc_symmetric_chain.py +++ b/sfc/tests/functest/sfc_symmetric_chain.py @@ -1,4 +1,4 @@ -#!/bin/python +#!/usr/bin/env python # # Copyright (c) 2017 Ericsson AB and others. All rights reserved # @@ -20,7 +20,7 @@ import opnfv.utils.ovs_logger as ovs_log from opnfv.deployment.factory import Factory as DeploymentFactory import sfc.lib.config as sfc_config -import sfc.lib.utils as test_utils +import sfc.lib.test_utils as test_utils from sfc.lib.results import Results import sfc.lib.topology_shuffler as topo_shuffler @@ -60,7 +60,7 @@ def main(): tacker_client = os_sfc_utils.get_tacker_client() - _, custom_flavor = openstack_sfc.get_or_create_flavor( + custom_flavor = openstack_sfc.create_flavor( COMMON_CONFIG.flavor, COMMON_CONFIG.ram_size_in_mb, COMMON_CONFIG.disk_size_in_gb, @@ -91,8 +91,9 @@ def main(): sg = openstack_sfc.create_security_group(TESTCASE_CONFIG.secgroup_name) vnf_name = 'testVNF1' - # Using seed=0 uses the baseline topology: everything in the same host - testTopology = topo_shuffler.topology([vnf_name], openstack_sfc, seed=0) + topo_seed = topo_shuffler.get_seed() + testTopology = topo_shuffler.topology([vnf_name], openstack_sfc, + seed=topo_seed) logger.info('This test is run with the topology {0}' .format(testTopology['id'])) logger.info('Topology description: {0}' @@ -100,15 +101,17 @@ def main(): client_instance, client_creator = openstack_sfc.create_instance( CLIENT, COMMON_CONFIG.flavor, image_creator, network, sg, - av_zone=testTopology['client']) + av_zone=testTopology[CLIENT]) server_instance, server_creator = openstack_sfc.create_instance( SERVER, COMMON_CONFIG.flavor, image_creator, network, sg, - av_zone=testTopology['server']) + av_zone=testTopology[SERVER]) server_ip = server_instance.ports[0].ips[0]['ip_address'] logger.info("Server instance received private ip [{}]".format(server_ip)) + os_sfc_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, @@ -119,11 +122,15 @@ def main(): COMMON_CONFIG.vnfd_dir, COMMON_CONFIG.vnfd_default_params_file) - os_sfc_utils.create_vnfd(tacker_client, tosca_file=tosca_file) - test_utils.create_vnf_in_av_zone( + os_sfc_utils.create_vnfd( + tacker_client, + tosca_file=tosca_file, + vnfd_name='test-vnfd1') + os_sfc_utils.create_vnf_in_av_zone( tacker_client, vnf_name, 'test-vnfd1', + 'test-vim', default_param_file, testTopology[vnf_name]) @@ -132,37 +139,40 @@ def main(): logger.error('ERROR while booting VNF') sys.exit(1) - os_sfc_utils.create_sfc( + tosca_file = os.path.join( + COMMON_CONFIG.sfc_test_dir, + COMMON_CONFIG.vnffgd_dir, + TESTCASE_CONFIG.test_vnffgd) + os_sfc_utils.create_vnffgd( + tacker_client, + tosca_file=tosca_file, + vnffgd_name='test-vnffgd') + + client_port = openstack_sfc.get_client_port( + client_instance, + client_creator) + server_port = openstack_sfc.get_client_port( + server_instance, + server_creator) + + server_ip_prefix = server_ip + '/32' + + os_sfc_utils.create_vnffg_with_param_file( tacker_client, - sfc_name='red', - chain_vnf_names=[vnf_name], - symmetrical=True) - - os_sfc_utils.create_sfc_classifier( - tacker_client, 'red_http', sfc_name='red', - match={ - 'source_port': 0, - 'dest_port': 80, - 'protocol': 6 - }) - - # FIXME: JIRA SFC-86 - # Tacker does not allow to specify the direction of the chain to be used, - # only references the SFP (which for symmetric chains results in two RSPs) - os_sfc_utils.create_sfc_classifier( - tacker_client, 'red_http_reverse', sfc_name='red', - match={ - 'source_port': 80, - 'dest_port': 0, - 'protocol': 6 - }) - - logger.info(test_utils.run_cmd('tacker sfc-list')) - logger.info(test_utils.run_cmd('tacker sfc-classifier-list')) + 'test-vnffgd', + 'test-vnffg', + default_param_file, + client_port.id, + server_port.id, + server_ip_prefix) # Start measuring the time it takes to implement the classification rules - t1 = threading.Thread(target=odl_utils.wait_for_classification_rules, - args=(ovs_logger, compute_nodes, odl_ip, odl_port,)) + t1 = threading.Thread( + target=wait_for_classification_rules, + args=(ovs_logger, compute_nodes, + openstack_sfc.get_compute_server(), server_port, + openstack_sfc.get_compute_client(), client_port, + odl_ip, odl_port,)) try: t1.start() @@ -176,15 +186,19 @@ def main(): server_floating_ip = openstack_sfc.assign_floating_ip(router, server_instance, server_creator) - fips_sfs = openstack_sfc.assign_floating_ip_vnfs(router) + + vnf_ip = os_sfc_utils.get_vnf_ip(tacker_client, vnf_id=vnf_id) + fips_sfs = openstack_sfc.assign_floating_ip_vnfs(router, [vnf_ip]) sf_floating_ip = fips_sfs[0] - fips = [client_floating_ip, server_floating_ip, fips_sfs[0]] + fips = [client_floating_ip, server_floating_ip, sf_floating_ip] for ip in fips: logger.info("Checking connectivity towards floating IP [%s]" % ip) if not test_utils.ping(ip, retries=50, retry_timeout=3): logger.error("Cannot ping floating IP [%s]" % ip) + os_sfc_utils.get_tacker_items() + odl_utils.get_odl_items(odl_ip, odl_port) sys.exit(1) logger.info("Successful ping to floating IP [%s]" % ip) @@ -197,39 +211,124 @@ def main(): logger.error('\033[91mFailed to start the HTTP server\033[0m') sys.exit(1) - blocked_port = TESTCASE_CONFIG.blocked_source_port - logger.info("Firewall started, blocking traffic port %d" % blocked_port) - test_utils.start_vxlan_tool(sf_floating_ip, block=blocked_port) + logger.info("Starting vxlan_tool on %s" % sf_floating_ip) + test_utils.start_vxlan_tool(sf_floating_ip, interface='eth0', + output='eth1') + test_utils.start_vxlan_tool(sf_floating_ip, interface='eth1', + output='eth0') logger.info("Wait for ODL to update the classification rules in OVS") t1.join() - allowed_port = TESTCASE_CONFIG.allowed_source_port - logger.info("Test if HTTP from port %s works" % allowed_port) - if not test_utils.is_http_blocked( - client_floating_ip, server_ip, allowed_port): + logger.info("Test HTTP") + if not test_utils.is_http_blocked(client_floating_ip, + server_ip, + TESTCASE_CONFIG.source_port): results.add_to_summary(2, "PASS", "HTTP works") else: error = ('\033[91mTEST 1 [FAILED] ==> HTTP BLOCKED\033[0m') logger.error(error) test_utils.capture_ovs_logs( ovs_logger, controller_clients, compute_clients, error) + results.add_to_summary(2, "FAIL", "HTTP blocked") + + logger.info("Changing the vxlan_tool to block HTTP request traffic") + + # Make SF1 block http request traffic + test_utils.stop_vxlan_tool(sf_floating_ip) + logger.info("Starting HTTP firewall on %s" % sf_floating_ip) + test_utils.start_vxlan_tool(sf_floating_ip, interface='eth0', + output='eth1', block="80") + test_utils.start_vxlan_tool(sf_floating_ip, interface='eth1', + output='eth0') + + logger.info("Test HTTP again blocking request on SF1") + if test_utils.is_http_blocked(client_floating_ip, + server_ip, + TESTCASE_CONFIG.source_port): + results.add_to_summary(2, "PASS", "HTTP uplink blocked") + else: + error = ('\033[91mTEST 2 [FAILED] ==> HTTP WORKS\033[0m') + logger.error(error) + test_utils.capture_ovs_logs( + ovs_logger, controller_clients, compute_clients, error) results.add_to_summary(2, "FAIL", "HTTP works") - logger.info("Test if HTTP from port %s is blocked" % blocked_port) - if test_utils.is_http_blocked( - client_floating_ip, server_ip, blocked_port): - results.add_to_summary(2, "PASS", "HTTP Blocked") + logger.info("Changing the vxlan_tool to block HTTP response traffic") + + # Make SF1 block response http traffic + test_utils.stop_vxlan_tool(sf_floating_ip) + logger.info("Starting HTTP firewall on %s" % sf_floating_ip) + test_utils.start_vxlan_tool(sf_floating_ip, interface='eth0', + output='eth1') + test_utils.start_vxlan_tool(sf_floating_ip, interface='eth1', + output='eth0', + block=TESTCASE_CONFIG.source_port) + + logger.info("Test HTTP again blocking response on SF1") + if test_utils.is_http_blocked(client_floating_ip, + server_ip, + TESTCASE_CONFIG.source_port): + results.add_to_summary(2, "PASS", "HTTP downlink blocked") else: - error = ('\033[91mTEST 2 [FAILED] ==> HTTP WORKS\033[0m') + error = ('\033[91mTEST 3 [FAILED] ==> HTTP WORKS\033[0m') logger.error(error) test_utils.capture_ovs_logs( ovs_logger, controller_clients, compute_clients, error) - results.add_to_summary(2, "FAIL", "HTTP Blocked") + results.add_to_summary(2, "FAIL", "HTTP works") + + logger.info("Changing the vxlan_tool to allow HTTP traffic") + + # Make SF1 allow http traffic + test_utils.stop_vxlan_tool(sf_floating_ip) + logger.info("Starting HTTP firewall on %s" % sf_floating_ip) + test_utils.start_vxlan_tool(sf_floating_ip, interface='eth0', + output='eth1') + test_utils.start_vxlan_tool(sf_floating_ip, interface='eth1', + output='eth0') + + logger.info("Test HTTP") + if not test_utils.is_http_blocked(client_floating_ip, server_ip): + results.add_to_summary(2, "PASS", "HTTP restored") + else: + error = ('\033[91mTEST 4 [FAILED] ==> HTTP BLOCKED\033[0m') + logger.error(error) + test_utils.capture_ovs_logs( + ovs_logger, controller_clients, compute_clients, error) + results.add_to_summary(2, "FAIL", "HTTP blocked") return results.compile_summary(), openstack_sfc.creators +def wait_for_classification_rules(ovs_logger, compute_nodes, + server_compute, server_port, + client_compute, client_port, + odl_ip, odl_port): + if client_compute == server_compute: + odl_utils.wait_for_classification_rules( + ovs_logger, + compute_nodes, + odl_ip, + odl_port, + client_compute, + [server_port, client_port]) + else: + odl_utils.wait_for_classification_rules( + ovs_logger, + compute_nodes, + odl_ip, + odl_port, + server_compute, + server_port) + odl_utils.wait_for_classification_rules( + ovs_logger, + compute_nodes, + odl_ip, + odl_port, + client_compute, + client_port) + + if __name__ == '__main__': logging.config.fileConfig(COMMON_CONFIG.functest_logging_api) main() 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 9d4c68c8..a5133f00 100644 --- a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py +++ b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py @@ -1,4 +1,4 @@ -#!/bin/python +#!/usr/bin/env python # # Copyright (c) 2015 All rights reserved # This program and the accompanying materials @@ -42,7 +42,7 @@ def main(): installer_type = os.environ.get("INSTALLER_TYPE") - supported_installers = ['fuel', 'apex', 'osa'] + supported_installers = ['fuel', 'apex', 'osa', 'compass'] if installer_type not in supported_installers: logger.error( @@ -175,7 +175,8 @@ def main(): tosca_file=tosca_file, vnffgd_name='red') - neutron_port = openstack_sfc.get_client_port_id(client_instance) + neutron_port = openstack_sfc.get_client_port(client_instance, + client_creator) os_sfc_utils.create_vnffg_with_param_file(tacker_client, 'red', 'red_http', default_param_file, @@ -184,7 +185,8 @@ def main(): # Start measuring the time it takes to implement the classification rules t1 = threading.Thread(target=odl_utils.wait_for_classification_rules, args=(ovs_logger, compute_nodes, odl_ip, - odl_port, openstack_sfc.get_compute_client(),)) + odl_port, openstack_sfc.get_compute_client(), + [neutron_port],)) try: t1.start() @@ -274,7 +276,8 @@ def main(): # Start measuring the time it takes to implement the classification rules t2 = threading.Thread(target=odl_utils.wait_for_classification_rules, args=(ovs_logger, compute_nodes, odl_ip, - odl_port, openstack_sfc.get_compute_client(),)) + odl_port, openstack_sfc.get_compute_client(), + [neutron_port],)) try: t2.start() except Exception as e: diff --git a/sfc/tests/functest/vnfd-templates/test-symmetric-vnfd.yaml b/sfc/tests/functest/vnfd-templates/test-symmetric-vnfd.yaml index 1f4c11f6..bf175ef7 100644 --- a/sfc/tests/functest/vnfd-templates/test-symmetric-vnfd.yaml +++ b/sfc/tests/functest/vnfd-templates/test-symmetric-vnfd.yaml @@ -15,12 +15,15 @@ topology_template: nfv_compute: properties: num_cpus: 1 - mem_size: 2 GB - disk_size: 10 GB + mem_size: 500 MB + disk_size: 1 GB properties: - image: sfc_nsh_euphrates + image: sfc_nsh_fraser availability_zone: {get_input: zone} mgmt_driver: noop + config: | + param0: key1 + param1: key2 service_type: firewall monitoring_policy: name: ping @@ -46,6 +49,18 @@ topology_template: - virtualBinding: node: VDU1 + CP2: + type: tosca.nodes.nfv.CP.Tacker + properties: + management: false + order: 1 + anti_spoofing_protection: false + requirements: + - virtualLink: + node: VL1 + - virtualBinding: + node: VDU1 + VL1: type: tosca.nodes.nfv.VL properties: diff --git a/sfc/tests/functest/vnffgd-templates/test-deletion-vnffgd.yaml-queens b/sfc/tests/functest/vnffgd-templates/test-deletion-vnffgd-pike.yaml index 28b78ead..3f10e6b8 100644 --- a/sfc/tests/functest/vnffgd-templates/test-deletion-vnffgd.yaml-queens +++ b/sfc/tests/functest/vnffgd-templates/test-deletion-vnffgd-pike.yaml @@ -18,8 +18,8 @@ topology_template: type: ACL criteria: - network_src_port_id: {get_input: net_src_port_id} - destination_port_range: 80-80 - ip_proto: 6 + - destination_port_range: 80-80 + - ip_proto: 6 path: - forwarder: test-vnfd1 capability: CP1 diff --git a/sfc/tests/functest/vnffgd-templates/test-deletion-vnffgd.yaml b/sfc/tests/functest/vnffgd-templates/test-deletion-vnffgd.yaml index 3f10e6b8..28b78ead 100644 --- a/sfc/tests/functest/vnffgd-templates/test-deletion-vnffgd.yaml +++ b/sfc/tests/functest/vnffgd-templates/test-deletion-vnffgd.yaml @@ -18,8 +18,8 @@ topology_template: type: ACL criteria: - network_src_port_id: {get_input: net_src_port_id} - - destination_port_range: 80-80 - - ip_proto: 6 + destination_port_range: 80-80 + ip_proto: 6 path: - forwarder: test-vnfd1 capability: CP1 diff --git a/sfc/tests/functest/vnffgd-templates/test-one-chain-vnffgd.yaml-queens b/sfc/tests/functest/vnffgd-templates/test-one-chain-vnffgd-pike.yaml index 544d6e8e..27c7d545 100644 --- a/sfc/tests/functest/vnffgd-templates/test-one-chain-vnffgd.yaml-queens +++ b/sfc/tests/functest/vnffgd-templates/test-one-chain-vnffgd-pike.yaml @@ -18,8 +18,8 @@ topology_template: type: ACL criteria: - network_src_port_id: {get_input: net_src_port_id} - destination_port_range: 80-80 - ip_proto: 6 + - destination_port_range: 80-80 + - ip_proto: 6 path: - forwarder: test-vnfd1 capability: CP1 diff --git a/sfc/tests/functest/vnffgd-templates/test-one-chain-vnffgd.yaml b/sfc/tests/functest/vnffgd-templates/test-one-chain-vnffgd.yaml index 27c7d545..544d6e8e 100644 --- a/sfc/tests/functest/vnffgd-templates/test-one-chain-vnffgd.yaml +++ b/sfc/tests/functest/vnffgd-templates/test-one-chain-vnffgd.yaml @@ -18,8 +18,8 @@ topology_template: type: ACL criteria: - network_src_port_id: {get_input: net_src_port_id} - - destination_port_range: 80-80 - - ip_proto: 6 + destination_port_range: 80-80 + ip_proto: 6 path: - forwarder: test-vnfd1 capability: CP1 diff --git a/sfc/tests/functest/vnffgd-templates/test-symmetric-vnffgd.yaml b/sfc/tests/functest/vnffgd-templates/test-symmetric-vnffgd.yaml new file mode 100644 index 00000000..6b14df1b --- /dev/null +++ b/sfc/tests/functest/vnffgd-templates/test-symmetric-vnffgd.yaml @@ -0,0 +1,46 @@ +--- +tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0 +description: test-case-symmetric + +topology_template: + description: topology-template-test1 + inputs: + net_src_port_id: + type: string + net_dst_port_id: + type: string + ip_dst_prefix: + type: string + + node_templates: + Forwarding_path1: + type: tosca.nodes.nfv.FP.Tacker + description: creates path + properties: + id: 1 + policy: + type: ACL + criteria: + - network_src_port_id: {get_input: net_src_port_id} + - network_dst_port_id: {get_input: net_dst_port_id} + - ip_dst_prefix: {get_input: ip_dst_prefix} + - destination_port_range: 80-80 + - ip_proto: 6 + path: + - forwarder: test-vnfd1 + capability: CP1 + - forwarder: test-vnfd1 + capability: CP2 + + groups: + VNFFG1: + type: tosca.groups.nfv.VNFFG + description: creates chain + properties: + vendor: tacker + version: 1.0 + number_of_endpoints: 2 + dependent_virtual_link: [VL1, VL1] + connection_point: [CP1, CP2] + constituent_vnfs: [test-vnfd1, test-vnfd1] + members: [Forwarding_path1] diff --git a/sfc/tests/functest/vnffgd-templates/test-symmetric-vnffgd.yaml-queens b/sfc/tests/functest/vnffgd-templates/test-symmetric-vnffgd.yaml-queens new file mode 100644 index 00000000..c40c447c --- /dev/null +++ b/sfc/tests/functest/vnffgd-templates/test-symmetric-vnffgd.yaml-queens @@ -0,0 +1,46 @@ +--- +tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0 +description: test-case-symmetric + +topology_template: + description: topology-template-test1 + inputs: + net_src_port_id: + type: string + net_dst_port_id: + type: string + ip_dst_prefix: + type: string + + node_templates: + Forwarding_path1: + type: tosca.nodes.nfv.FP.Tacker + description: creates path + properties: + id: 1 + policy: + type: ACL + criteria: + - network_src_port_id: {get_input: net_src_port_id} + network_dst_port_id: {get_input: net_dst_port_id} + ip_dst_prefix: {get_input: ip_dst_prefix} + destination_port_range: 80-80 + ip_proto: 6 + path: + - forwarder: test-vnfd1 + capability: CP1 + - forwarder: test-vnfd1 + capability: CP2 + + groups: + VNFFG1: + type: tosca.groups.nfv.VNFFG + description: creates chain + properties: + vendor: tacker + version: 1.0 + number_of_endpoints: 2 + dependent_virtual_link: [VL1, VL1] + connection_point: [CP1, CP2] + constituent_vnfs: [test-vnfd1, test-vnfd1] + members: [Forwarding_path1] diff --git a/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd1.yaml-queens b/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd1-pike.yaml index 9df28b50..f0615e4e 100644 --- a/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd1.yaml-queens +++ b/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd1-pike.yaml @@ -18,8 +18,8 @@ topology_template: type: ACL criteria: - network_src_port_id: {get_input: net_src_port_id} - destination_port_range: 22-80 - ip_proto: 6 + - destination_port_range: 22-80 + - ip_proto: 6 path: - forwarder: test-vnfd1 capability: CP1 diff --git a/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd1.yaml b/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd1.yaml index f0615e4e..ceee363b 100644 --- a/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd1.yaml +++ b/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd1.yaml @@ -1,25 +1,32 @@ --- tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0 -description: test-case2_HTTP Test +description: test-two-chains_HTTP Test topology_template: - description: topology-template-test2 + description: topology-template-test-two-chains inputs: net_src_port_id: type: string node_templates: Forwarding_path1: - type: tosca.nodes.nfv.FP.Tacker + type: tosca.nodes.nfv.FP.TackerV2 description: creates path properties: id: 1 policy: type: ACL criteria: - - network_src_port_id: {get_input: net_src_port_id} - - destination_port_range: 22-80 - - ip_proto: 6 + - name: get_ssh + classifier: + network_src_port_id: {get_input: net_src_port_id} + destination_port_range: 22-22 + ip_proto: 6 + - name: get_http + classifier: + network_src_port_id: {get_input: net_src_port_id} + destination_port_range: 80-80 + ip_proto: 6 path: - forwarder: test-vnfd1 capability: CP1 diff --git a/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd2.yaml-queens b/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd2-pike.yaml index ef24ffa0..ec18c9d6 100644 --- a/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd2.yaml-queens +++ b/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd2-pike.yaml @@ -19,8 +19,8 @@ topology_template: type: ACL criteria: - network_src_port_id: {get_input: net_src_port_id} - destination_port_range: 22-80 - ip_proto: 6 + - destination_port_range: 22-80 + - ip_proto: 6 path: - forwarder: test-vnfd2 capability: CP1 diff --git a/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd2.yaml b/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd2.yaml index ec18c9d6..15739cc7 100644 --- a/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd2.yaml +++ b/sfc/tests/functest/vnffgd-templates/test-two-chains-vnffgd2.yaml @@ -1,26 +1,32 @@ --- tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0 -description: test-case2_SSH Test +description: test-two-chains_SSH Test topology_template: - description: topology-template-test2 + description: topology-template-test-two-chains inputs: net_src_port_id: type: string - node_templates: Forwarding_path1: - type: tosca.nodes.nfv.FP.Tacker + type: tosca.nodes.nfv.FP.TackerV2 description: creates path properties: id: 2 policy: type: ACL criteria: - - network_src_port_id: {get_input: net_src_port_id} - - destination_port_range: 22-80 - - ip_proto: 6 + - name: get_ssh + classifier: + network_src_port_id: {get_input: net_src_port_id} + destination_port_range: 22-22 + ip_proto: 6 + - name: get_http + classifier: + network_src_port_id: {get_input: net_src_port_id} + destination_port_range: 80-80 + ip_proto: 6 path: - forwarder: test-vnfd2 capability: CP1 |