diff --git a/src/tests/ecoc24/.gitlab-ci.yml b/src/tests/ecoc24/.gitlab-ci.yml index 34e27b1e7e58bead563e4a18b9f2ed3c6552ff53..c33dce1fd46f4e50228196a79e54b28b838ecba6 100644 --- a/src/tests/ecoc24/.gitlab-ci.yml +++ b/src/tests/ecoc24/.gitlab-ci.yml @@ -125,7 +125,7 @@ end2end_test ecoc24: - docker ps -a # Clean old docker images - - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi -f #coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' rules: diff --git a/src/tests/ecoc24/Dockerfile b/src/tests/ecoc24/Dockerfile index ca6437f3870788210a5ac91a07e1fb9dc5af9435..806bc1df84493628983885b3dae9c550eb5783d7 100644 --- a/src/tests/ecoc24/Dockerfile +++ b/src/tests/ecoc24/Dockerfile @@ -79,17 +79,17 @@ COPY src/service/client/. service/client/ COPY src/slice/__init__.py slice/__init__.py COPY src/slice/client/. slice/client/ COPY src/tests/*.py ./tests/ -#COPY src/tests/ofc24/__init__.py ./tests/ofc24/__init__.py -#COPY src/tests/ofc24/descriptors/topology.json ./tests/ofc24/descriptors/topology.json -#COPY src/tests/ofc24/descriptors/service-unidir.json ./tests/ofc24/descriptors/service-unidir.json -#COPY src/tests/ofc24/descriptors/service-bidir.json ./tests/ofc24/descriptors/service-bidir.json -#COPY src/tests/ofc24/tests/. ./tests/ofc24/tests/ +COPY src/tests/ofc24/__init__.py ./tests/ofc24/__init__.py +COPY src/tests/ofc24/descriptors/descriptor_ip.json ./tests/ofc24/descriptors/descriptor_ip.json +COPY src/tests/ofc24/descriptors/descriptor_ip.json ./tests/ofc24/descriptors/descriptor_opt.json +COPY src/tests/ofc24/descriptors/descriptor_ip.json ./tests/ofc24/descriptors/link_mapping.json +COPY src/tests/ofc24/tests/. ./tests/ofc24/tests/ RUN tee ./run_tests.sh <<EOF #!/bin/bash source /var/teraflow/tfs_runtime_env_vars.sh export PYTHONPATH=/var/teraflow -#pytest --verbose --log-level=INFO /var/teraflow/tests/ofc24/tests/test_functional_bootstrap.py --junitxml=/opt/results/report_bootstrap.xml +pytest --verbose --log-level=INFO /var/teraflow/tests/ofc24/tests/test_functional_bootstrap.py --junitxml=/opt/results/report_bootstrap.xml #pytest --verbose --log-level=INFO /var/teraflow/tests/ofc24/tests/test_functional_create_service_unidir.py --junitxml=/opt/results/report_create_service_unidir.xml #pytest --verbose --log-level=INFO /var/teraflow/tests/ofc24/tests/test_functional_delete_service_unidir.py --junitxml=/opt/results/report_delete_service_unidir.xml #pytest --verbose --log-level=INFO /var/teraflow/tests/ofc24/tests/test_functional_create_service_bidir.py --junitxml=/opt/results/report_create_service_bidir.xml @@ -98,13 +98,6 @@ export PYTHONPATH=/var/teraflow EOF RUN chmod ug+x ./run_tests.sh -RUN tee /opt/results/report_dummy.xml <<EOF -<?xml version='1.0' standalone='yes'?> -<hola> - Ejemplo -</hola> -EOF -RUN chmod ug+x ./run_tests.sh diff --git a/src/tests/ecoc24/descriptors/emulated/descriptor_opt.json b/src/tests/ecoc24/descriptors/emulated/descriptor_opt.json index 44c80ad46f727cbe9af7fd78f73184e756d32a92..320da86924d814aa79b0f145736c08105a731238 100644 --- a/src/tests/ecoc24/descriptors/emulated/descriptor_opt.json +++ b/src/tests/ecoc24/descriptors/emulated/descriptor_opt.json @@ -1,48 +1,802 @@ { - "services": [ - { - "service_id": { - "context_id": { - "context_uuid": { - "uuid": "admin" - } - }, - "service_uuid": { - "uuid": "dc-2-dc-svc" - } - }, - "service_type": 2, - "service_status": {"service_status": 1}, - "service_endpoint_ids": [ - {"device_id":{"device_uuid":{"uuid":"DC1"}},"endpoint_uuid":{"uuid":"int"}}, - {"device_id":{"device_uuid":{"uuid":"DC2"}},"endpoint_uuid":{"uuid":"int"}} - ], - "service_constraints": [ - {"sla_capacity": {"capacity_gbps": 10.0}}, - {"sla_latency": {"e2e_latency_ms": 15.2}} - ], - "service_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "/settings", "resource_value": { - "address_families": ["IPV4"], "bgp_as": 65000, "bgp_route_target": "65000:123", - "mtu": 1512, "vlan_id": 300 - }}}, - {"action": 1, "custom": {"resource_key": "/device[PE1]/endpoint[1/1]/settings", "resource_value": { - "route_distinguisher": "65000:123", "router_id": "10.0.0.1", - "address_ip": "3.3.1.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 - }}}, - {"action": 1, "custom": {"resource_key": "/device[PE2]/endpoint[1/1]/settings", "resource_value": { - "route_distinguisher": "65000:123", "router_id": "10.0.0.2", - "address_ip": "3.3.2.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 - }}}, - {"action": 1, "custom": {"resource_key": "/device[PE3]/endpoint[1/1]/settings", "resource_value": { - "route_distinguisher": "65000:123", "router_id": "10.0.0.3", - "address_ip": "3.3.3.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 - }}}, - {"action": 1, "custom": {"resource_key": "/device[PE4]/endpoint[1/1]/settings", "resource_value": { - "route_distinguisher": "65000:123", "router_id": "10.0.0.4", - "address_ip": "3.3.4.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 - }}} - ]} - } + "contexts":[ + { + "context_id":{ + "context_uuid":{ + "uuid":"admin" + } + } + } + ], + "topologies":[ + { + "topology_id":{ + "context_id":{ + "context_uuid":{ + "uuid":"admin" + } + }, + "topology_uuid":{ + "uuid":"admin" + } + } + } + ], + "devices":[ + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP1.1" + } + }, + "device_type":"emu-optical-transponder", + "device_drivers":[ + 0 + ], + "device_endpoints":[ + + ], + "device_operational_status":0, + "device_config":{ + "config_rules":[ + { + "action":1, + "custom":{ + "resource_key":"_connect/address", + "resource_value":"127.0.0.1" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/port", + "resource_value":"0" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/settings", + "resource_value":{ + "endpoints":[ + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P1" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P2" + } + ] + } + } + } + ] + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP1.2" + } + }, + "device_type":"emu-optical-transponder", + "device_drivers":[ + 0 + ], + "device_endpoints":[ + + ], + "device_operational_status":0, + "device_config":{ + "config_rules":[ + { + "action":1, + "custom":{ + "resource_key":"_connect/address", + "resource_value":"127.0.0.1" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/port", + "resource_value":"0" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/settings", + "resource_value":{ + "endpoints":[ + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P1" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P2" + } + ] + } + } + } + ] + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP1.3" + } + }, + "device_type":"emu-optical-transponder", + "device_drivers":[ + 0 + ], + "device_endpoints":[ + + ], + "device_operational_status":0, + "device_config":{ + "config_rules":[ + { + "action":1, + "custom":{ + "resource_key":"_connect/address", + "resource_value":"127.0.0.1" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/port", + "resource_value":"0" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/settings", + "resource_value":{ + "endpoints":[ + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P1" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P2" + } + ] + } + } + } + ] + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON1" + } + }, + "device_type":"emu-optical-roadm", + "device_drivers":[ + 0 + ], + "device_endpoints":[ + + ], + "device_operational_status":0, + "device_config":{ + "config_rules":[ + { + "action":1, + "custom":{ + "resource_key":"_connect/address", + "resource_value":"127.0.0.1" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/port", + "resource_value":"0" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/settings", + "resource_value":{ + "endpoints":[ + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"OTP1" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"OTP2" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"OTP3" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"2" + } + ] + } + } + } + ] + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON2" + } + }, + "device_type":"emu-optical-roadm", + "device_drivers":[ + 0 + ], + "device_endpoints":[ + + ], + "device_operational_status":0, + "device_config":{ + "config_rules":[ + { + "action":1, + "custom":{ + "resource_key":"_connect/address", + "resource_value":"127.0.0.1" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/port", + "resource_value":"0" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/settings", + "resource_value":{ + "endpoints":[ + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"1" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"3" + } + ] + } + } + } + ] + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON3" + } + }, + "device_type":"emu-optical-roadm", + "device_drivers":[ + 0 + ], + "device_endpoints":[ + + ], + "device_operational_status":0, + "device_config":{ + "config_rules":[ + { + "action":1, + "custom":{ + "resource_key":"_connect/address", + "resource_value":"127.0.0.1" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/port", + "resource_value":"0" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/settings", + "resource_value":{ + "endpoints":[ + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"OTP1" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"OTP2" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"OTP3" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"2" + } + ] + } + } + } + ] + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP2.1" + } + }, + "device_type":"emu-optical-transponder", + "device_drivers":[ + 0 + ], + "device_endpoints":[ + + ], + "device_operational_status":0, + "device_config":{ + "config_rules":[ + { + "action":1, + "custom":{ + "resource_key":"_connect/address", + "resource_value":"127.0.0.1" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/port", + "resource_value":"0" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/settings", + "resource_value":{ + "endpoints":[ + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P1" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P2" + } + ] + } + } + } + ] + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP2.2" + } + }, + "device_type":"emu-optical-transponder", + "device_drivers":[ + 0 + ], + "device_endpoints":[ + + ], + "device_operational_status":0, + "device_config":{ + "config_rules":[ + { + "action":1, + "custom":{ + "resource_key":"_connect/address", + "resource_value":"127.0.0.1" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/port", + "resource_value":"0" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/settings", + "resource_value":{ + "endpoints":[ + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P1" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P2" + } + ] + } + } + } + ] + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP2.3" + } + }, + "device_type":"emu-optical-transponder", + "device_drivers":[ + 0 + ], + "device_endpoints":[ + + ], + "device_operational_status":0, + "device_config":{ + "config_rules":[ + { + "action":1, + "custom":{ + "resource_key":"_connect/address", + "resource_value":"127.0.0.1" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/port", + "resource_value":"0" + } + }, + { + "action":1, + "custom":{ + "resource_key":"_connect/settings", + "resource_value":{ + "endpoints":[ + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P1" + }, + { + "sample_types":[ + + ], + "type":"copper/internal", + "uuid":"P2" + } + ] + } + } + } + ] + } + } + ], + "links":[ + { + "link_id":{ + "link_uuid":{ + "uuid":"MG-ON1->MG-ON2" + } + }, + "link_endpoint_ids":[ + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON1" + } + }, + "endpoint_uuid":{ + "uuid":"2" + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON2" + } + }, + "endpoint_uuid":{ + "uuid":"1" + } + } + ] + }, + { + "link_id":{ + "link_uuid":{ + "uuid":"MG-ON2->MG-ON3" + } + }, + "link_endpoint_ids":[ + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON2" + } + }, + "endpoint_uuid":{ + "uuid":"3" + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON3" + } + }, + "endpoint_uuid":{ + "uuid":"2" + } + } + ] + }, + { + "link_id":{ + "link_uuid":{ + "uuid":"OTP1.1->MG-ON1" + } + }, + "link_endpoint_ids":[ + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP1.1" + } + }, + "endpoint_uuid":{ + "uuid":"P1" + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON1" + } + }, + "endpoint_uuid":{ + "uuid":"OTP1" + } + } + ] + }, + { + "link_id":{ + "link_uuid":{ + "uuid":"OTP1.2->MG-ON1" + } + }, + "link_endpoint_ids":[ + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP1.2" + } + }, + "endpoint_uuid":{ + "uuid":"P1" + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON1" + } + }, + "endpoint_uuid":{ + "uuid":"OTP2" + } + } + ] + }, + { + "link_id":{ + "link_uuid":{ + "uuid":"OTP1.3->MG-ON1" + } + }, + "link_endpoint_ids":[ + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP1.3" + } + }, + "endpoint_uuid":{ + "uuid":"P1" + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON1" + } + }, + "endpoint_uuid":{ + "uuid":"OTP3" + } + } + ] + }, + { + "link_id":{ + "link_uuid":{ + "uuid":"OTP2.1->MG-ON3" + } + }, + "link_endpoint_ids":[ + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP2.1" + } + }, + "endpoint_uuid":{ + "uuid":"P1" + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON3" + } + }, + "endpoint_uuid":{ + "uuid":"OTP1" + } + } + ] + }, + { + "link_id":{ + "link_uuid":{ + "uuid":"OTP2.2->MG-ON3" + } + }, + "link_endpoint_ids":[ + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP2.2" + } + }, + "endpoint_uuid":{ + "uuid":"P1" + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON3" + } + }, + "endpoint_uuid":{ + "uuid":"OTP2" + } + } + ] + }, + { + "link_id":{ + "link_uuid":{ + "uuid":"OTP2.3->MG-ON3" + } + }, + "link_endpoint_ids":[ + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP2.3" + } + }, + "endpoint_uuid":{ + "uuid":"P1" + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"MG-ON3" + } + }, + "endpoint_uuid":{ + "uuid":"OTP3" + } + } + ] + } ] -} + } \ No newline at end of file diff --git a/src/tests/ecoc24/descriptors/emulated/link_mapping.json b/src/tests/ecoc24/descriptors/emulated/link_mapping.json index 9ac5a25994c867bb5387e00363e7b3e0908e030d..d2e9f11d7487f0d703b05bb8d86d835e9fbf31ae 100644 --- a/src/tests/ecoc24/descriptors/emulated/link_mapping.json +++ b/src/tests/ecoc24/descriptors/emulated/link_mapping.json @@ -1,34 +1,85 @@ { - "contexts": [ - {"context_id": {"context_uuid": {"uuid": "admin"}}} + "contexts":[ + { + "context_id":{ + "context_uuid":{ + "uuid":"admin" + } + } + } ], - "topologies": [ - {"topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}}} + "topologies":[ + { + "topology_id":{ + "context_id":{ + "context_uuid":{ + "uuid":"admin" + } + }, + "topology_uuid":{ + "uuid":"admin" + } + } + } ], - "links": [ - {"link_id": {"link_uuid": {"uuid": "IP1_CTP1-MGON1_OTP1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "IP1"}}, "endpoint_uuid": {"uuid": "CTP1"}}, - {"device_id": {"device_uuid": {"uuid": "MG-ON1"}}, "endpoint_uuid": {"uuid": "OTP1"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "IP1_CTP2-MGON1_OTP2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "IP1"}}, "endpoint_uuid": {"uuid": "CTP2"}}, - {"device_id": {"device_uuid": {"uuid": "MG-ON1"}}, "endpoint_uuid": {"uuid": "OTP2"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "IP1CTP3-MGON1_OTP3"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "IP1"}}, "endpoint_uuid": {"uuid": "CTP3"}}, - {"device_id": {"device_uuid": {"uuid": "MG-ON1"}}, "endpoint_uuid": {"uuid": "OTP3"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "IP2_CTP1-MGON3_OTP1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "IP2"}}, "endpoint_uuid": {"uuid": "CTP1"}}, - {"device_id": {"device_uuid": {"uuid": "MG-ON3"}}, "endpoint_uuid": {"uuid": "OTP1"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "IP2_CTP2-MGON3_OTP2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "IP2"}}, "endpoint_uuid": {"uuid": "CTP2"}}, - {"device_id": {"device_uuid": {"uuid": "MG-ON3"}}, "endpoint_uuid": {"uuid": "OTP2"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "IP2_CTP3-MGON3_OTP3"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "IP2"}}, "endpoint_uuid": {"uuid": "CTP3"}}, - {"device_id": {"device_uuid": {"uuid": "MG-ON3"}}, "endpoint_uuid": {"uuid": "OTP3"}} - ]} + "links":[ + { + "link_id":{ + "link_uuid":{ + "uuid":"CSGW1_CTP1-OTP1" + } + }, + "link_endpoint_ids":[ + { + "device_id":{ + "device_uuid":{ + "uuid":"CSGW1" + } + }, + "endpoint_uuid":{ + "uuid":"PORT-xe5" + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP1.1" + } + }, + "endpoint_uuid":{ + "uuid":"P2" + } + } + ] + }, + { + "link_id":{ + "link_uuid":{ + "uuid":"CSGW2_CTP1-OTP1" + } + }, + "link_endpoint_ids":[ + { + "device_id":{ + "device_uuid":{ + "uuid":"CSGW2" + } + }, + "endpoint_uuid":{ + "uuid":"PORT-xe5" + } + }, + { + "device_id":{ + "device_uuid":{ + "uuid":"OTP2.1" + } + }, + "endpoint_uuid":{ + "uuid":"P2" + } + } + ] + } ] -} + } \ No newline at end of file