diff --git a/scripts/run_tests_locally-compute.sh b/scripts/run_tests_locally-compute.sh new file mode 100755 index 0000000000000000000000000000000000000000..48ce6e232a8005ee37fce8a0dbd9f7aed4cf83dc --- /dev/null +++ b/scripts/run_tests_locally-compute.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time + +# Useful flags for pytest: +#-o log_cli=true -o log_file=service.log -o log_file_level=DEBUG + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + compute/tests/test_unitary.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py index 83bf52d0c51de7f0efb6e8de6910853eba649418..9420517e1b253e6f9169ccabafe5f441662c9b04 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py @@ -22,5 +22,7 @@ DEFAULT_BGP_ROUTE_TARGET = '{:d}:{:d}'.format(DEFAULT_BGP_AS, 333) # device_uuid, endpoint_uuid, router_id, route_distinguisher, sub_if_index, address_ip, address_prefix) BEARER_MAPPINGS = { 'R1-INF:13/2/1': ('R1-INF', '13/2/1', '10.10.10.1', '65000:100', 400, '3.3.2.1', 24), + 'R2-EMU:13/2/1': ('R2-EMU', '13/2/1', '12.12.12.1', '65000:120', 450, '3.4.2.1', 24), 'R3-INF:13/2/1': ('R3-INF', '13/2/1', '20.20.20.1', '65000:200', 500, '3.3.1.1', 24), + 'R4-EMU:13/2/1': ('R4-EMU', '13/2/1', '22.22.22.1', '65000:220', 550, '3.4.1.1', 24), } diff --git a/src/compute/tests/Constants.py b/src/compute/tests/Constants.py index ebe36eabc79b87b55000d130cad900ab22445e77..8d4e2ba8fe6144e6fc11c61bbe2c8296d74fc910 100644 --- a/src/compute/tests/Constants.py +++ b/src/compute/tests/Constants.py @@ -22,7 +22,7 @@ WIM_MAPPING = [ #'device_interface_id' : ??, # pop_switch_port 'service_endpoint_id' : 'ep-1', # wan_service_endpoint_id 'service_mapping_info': { # wan_service_mapping_info, other extra info - 'bearer': {'bearer-reference': 'dev-1:ep-1:10.0.0.1'}, + 'bearer': {'bearer-reference': 'R1-INF:13/2/1'}, 'site-id': '1', }, #'switch_dpid' : ??, # wan_switch_dpid @@ -34,7 +34,7 @@ WIM_MAPPING = [ #'device_interface_id' : ??, # pop_switch_port 'service_endpoint_id' : 'ep-2', # wan_service_endpoint_id 'service_mapping_info': { # wan_service_mapping_info, other extra info - 'bearer': {'bearer-reference': 'dev-2:ep-2:10.0.0.2'}, + 'bearer': {'bearer-reference': 'R2-EMU:13/2/1'}, 'site-id': '2', }, #'switch_dpid' : ??, # wan_switch_dpid @@ -46,13 +46,25 @@ WIM_MAPPING = [ #'device_interface_id' : ??, # pop_switch_port 'service_endpoint_id' : 'ep-3', # wan_service_endpoint_id 'service_mapping_info': { # wan_service_mapping_info, other extra info - 'bearer': {'bearer-reference': 'dev-3:ep-3:10.0.0.3'}, + 'bearer': {'bearer-reference': 'R3-INF:13/2/1'}, 'site-id': '3', }, #'switch_dpid' : ??, # wan_switch_dpid #'switch_port' : ??, # wan_switch_port #'datacenter_id' : ??, # vim_account }, + { + 'device-id' : 'dev-4', # pop_switch_dpid + #'device_interface_id' : ??, # pop_switch_port + 'service_endpoint_id' : 'ep-4', # wan_service_endpoint_id + 'service_mapping_info': { # wan_service_mapping_info, other extra info + 'bearer': {'bearer-reference': 'R4-EMU:13/2/1'}, + 'site-id': '4', + }, + #'switch_dpid' : ??, # wan_switch_dpid + #'switch_port' : ??, # wan_switch_port + #'datacenter_id' : ??, # vim_account + }, ] SERVICE_TYPE = 'ELINE'