Loading src/tests/ofc25/deploy.sh +8 −3 Original line number Diff line number Diff line Loading @@ -52,12 +52,14 @@ kubectl apply -f src/tests/ofc25/nginx-ingress-controller-ip.yaml kubectl apply -f src/tests/ofc25/nginx-ingress-controller-e2e.yaml cp manifests/contextservice.yaml manifests/contextservice.yaml.bak cp src/webui/service/templates/main/home.html src/webui/service/templates/main/home.html.bak # ===== Deploy Optical TeraFlowSDN ============================== source src/tests/ofc25/deploy_specs_opt.sh cp manifests/contextservice.yaml.bak manifests/contextservice.yaml sed -i '/name: CRDB_DATABASE/{n;s/value: .*/value: "tfs_opt_context"/}' manifests/contextservice.yaml sed -i 's|\(<h2>ETSI TeraFlowSDN Controller\)</h2>|\1 (Optical)</h2>|' src/webui/service/templates/main/home.html cp src/webui/service/templates/main/home.html.bak src/webui/service/templates/main/home.html sed -i 's|\(<h2>ETSI TeraFlowSDN Controller[^<]*\)</h2>|\1 (Optical)</h2>|' src/webui/service/templates/main/home.html ./deploy/crdb.sh ./deploy/nats.sh Loading @@ -74,7 +76,8 @@ mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_opt.sh source src/tests/ofc25/deploy_specs_ip.sh cp manifests/contextservice.yaml.bak manifests/contextservice.yaml sed -i '/name: CRDB_DATABASE/{n;s/value: .*/value: "tfs_ip_context"/}' manifests/contextservice.yaml sed -i 's|\(<h2>ETSI TeraFlowSDN Controller\)</h2>|\1 (Packet)</h2>|' src/webui/service/templates/main/home.html cp src/webui/service/templates/main/home.html.bak src/webui/service/templates/main/home.html sed -i 's|\(<h2>ETSI TeraFlowSDN Controller[^<]*\)</h2>|\1 (Packet)</h2>|' src/webui/service/templates/main/home.html ./deploy/crdb.sh ./deploy/nats.sh Loading @@ -91,7 +94,8 @@ mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_ip.sh source src/tests/ofc25/deploy_specs_e2e.sh cp manifests/contextservice.yaml.bak manifests/contextservice.yaml sed -i '/name: CRDB_DATABASE/{n;s/value: .*/value: "tfs_e2e_context"/}' manifests/contextservice.yaml sed -i 's|\(<h2>ETSI TeraFlowSDN Controller\)</h2>|\1 (End-to-End)</h2>|' src/webui/service/templates/main/home.html cp src/webui/service/templates/main/home.html.bak src/webui/service/templates/main/home.html sed -i 's|\(<h2>ETSI TeraFlowSDN Controller[^<]*\)</h2>|\1 (End-to-End)</h2>|' src/webui/service/templates/main/home.html ./deploy/crdb.sh ./deploy/nats.sh Loading @@ -106,6 +110,7 @@ mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_e2e.sh # ===== Recovering files ========================= mv manifests/contextservice.yaml.bak manifests/contextservice.yaml mv src/webui/service/templates/main/home.html.bak src/webui/service/templates/main/home.html # ===== Wait Content for NATS Subscription ========================= Loading src/tests/ofc25/dump-logs.sh +5 −5 Original line number Diff line number Diff line Loading @@ -14,11 +14,11 @@ # limitations under the License. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" path="$SCRIPT_DIR/tmp" rm -rf $path/exec mkdir -p $path/exec echo "dumping logs to $path/exec" cd $path TMP_PATH="$SCRIPT_DIR/tmp" rm -rf $TMP_PATH/exec mkdir -p $TMP_PATH/exec echo "dumping logs to $TMP_PATH/exec" cd $TMP_PATH echo "Collecting logs for E2E..." kubectl logs --namespace tfs-e2e deployment/contextservice -c server > exec/e2e-context.log Loading src/tests/ofc25/tests/Fixtures.py 0 → 100644 +180 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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. import os import pytest from typing import Optional, Tuple from context.client.ContextClient import ContextClient from device.client.DeviceClient import DeviceClient from monitoring.client.MonitoringClient import MonitoringClient from e2e_orchestrator.client.E2EOrchestratorClient import E2EOrchestratorClient from service.client.ServiceClient import ServiceClient from vnt_manager.client.VNTManagerClient import VNTManagerClient # Service endpoints from kubectl get services -A # These are ClusterIP addresses - update if services are redeployed SERVICE_ENDPOINTS = { 'opt': { 'context': ('10.152.183.189', 1010), 'device': ('10.152.183.92', 2020), 'service': ('10.152.183.198', 3030), }, 'ip': { 'context': ('10.152.183.79', 1010), 'device': ('10.152.183.112', 2020), 'service': ('10.152.183.174', 3030), 'vnt_manager': ('10.152.183.23', 10080), }, 'e2e': { 'context': ('10.152.183.81', 1010), 'device': ('10.152.183.169', 2020), 'service': ('10.152.183.177', 3030), 'e2e_orchestrator': ('10.152.183.201', 10050), } } def _get_endpoint(layer: str, service_name: str) -> Tuple[str, int]: """Get service endpoint from environment variable or default mapping.""" env_host = os.getenv(f'TFS_{layer.upper()}_{service_name.upper()}_HOST') env_port = os.getenv(f'TFS_{layer.upper()}_{service_name.upper()}_PORT') if env_host and env_port: return (env_host, int(env_port)) endpoint = SERVICE_ENDPOINTS.get(layer, {}).get(service_name) if endpoint is None: raise ValueError(f"No endpoint found for layer='{layer}', service='{service_name}'") return endpoint # ========== Optical Layer Fixtures ========== @pytest.fixture(scope='session') def context_client_opt(): host, port = _get_endpoint('opt', 'context') _client = ContextClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def device_client_opt(): host, port = _get_endpoint('opt', 'device') _client = DeviceClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def service_client_opt(): host, port = _get_endpoint('opt', 'service') _client = ServiceClient(host=host, port=port) yield _client _client.close() # ========== IP Layer Fixtures ========== @pytest.fixture(scope='session') def context_client_ip(): host, port = _get_endpoint('ip', 'context') _client = ContextClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def device_client_ip(): host, port = _get_endpoint('ip', 'device') _client = DeviceClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def service_client_ip(): host, port = _get_endpoint('ip', 'service') _client = ServiceClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def vnt_manager_client_ip(): host, port = _get_endpoint('ip', 'vnt_manager') _client = VNTManagerClient(host=host, port=port) yield _client _client.close() # ========== E2E Layer Fixtures ========== @pytest.fixture(scope='session') def context_client_e2e(): host, port = _get_endpoint('e2e', 'context') _client = ContextClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def device_client_e2e(): host, port = _get_endpoint('e2e', 'device') _client = DeviceClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def service_client_e2e(): host, port = _get_endpoint('e2e', 'service') _client = ServiceClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def e2eorchestrator_client_e2e(): host, port = _get_endpoint('e2e', 'e2e_orchestrator') _client = E2EOrchestratorClient(host=host, port=port) yield _client _client.close() # ========== Legacy Fixtures (for backward compatibility) ========== # These use environment variables from tfs_runtime_env_vars.sh @pytest.fixture(scope='session') def service_client(): _client = ServiceClient() yield _client _client.close() @pytest.fixture(scope='session') def context_client(): _client = ContextClient() yield _client _client.close() @pytest.fixture(scope='session') def device_client(): _client = DeviceClient() yield _client _client.close() @pytest.fixture(scope='session') def monitoring_client(): _client = MonitoringClient() yield _client _client.close() @pytest.fixture(scope='session') def e2eorchestrator_client(): _client = E2EOrchestratorClient() yield _client _client.close() Loading
src/tests/ofc25/deploy.sh +8 −3 Original line number Diff line number Diff line Loading @@ -52,12 +52,14 @@ kubectl apply -f src/tests/ofc25/nginx-ingress-controller-ip.yaml kubectl apply -f src/tests/ofc25/nginx-ingress-controller-e2e.yaml cp manifests/contextservice.yaml manifests/contextservice.yaml.bak cp src/webui/service/templates/main/home.html src/webui/service/templates/main/home.html.bak # ===== Deploy Optical TeraFlowSDN ============================== source src/tests/ofc25/deploy_specs_opt.sh cp manifests/contextservice.yaml.bak manifests/contextservice.yaml sed -i '/name: CRDB_DATABASE/{n;s/value: .*/value: "tfs_opt_context"/}' manifests/contextservice.yaml sed -i 's|\(<h2>ETSI TeraFlowSDN Controller\)</h2>|\1 (Optical)</h2>|' src/webui/service/templates/main/home.html cp src/webui/service/templates/main/home.html.bak src/webui/service/templates/main/home.html sed -i 's|\(<h2>ETSI TeraFlowSDN Controller[^<]*\)</h2>|\1 (Optical)</h2>|' src/webui/service/templates/main/home.html ./deploy/crdb.sh ./deploy/nats.sh Loading @@ -74,7 +76,8 @@ mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_opt.sh source src/tests/ofc25/deploy_specs_ip.sh cp manifests/contextservice.yaml.bak manifests/contextservice.yaml sed -i '/name: CRDB_DATABASE/{n;s/value: .*/value: "tfs_ip_context"/}' manifests/contextservice.yaml sed -i 's|\(<h2>ETSI TeraFlowSDN Controller\)</h2>|\1 (Packet)</h2>|' src/webui/service/templates/main/home.html cp src/webui/service/templates/main/home.html.bak src/webui/service/templates/main/home.html sed -i 's|\(<h2>ETSI TeraFlowSDN Controller[^<]*\)</h2>|\1 (Packet)</h2>|' src/webui/service/templates/main/home.html ./deploy/crdb.sh ./deploy/nats.sh Loading @@ -91,7 +94,8 @@ mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_ip.sh source src/tests/ofc25/deploy_specs_e2e.sh cp manifests/contextservice.yaml.bak manifests/contextservice.yaml sed -i '/name: CRDB_DATABASE/{n;s/value: .*/value: "tfs_e2e_context"/}' manifests/contextservice.yaml sed -i 's|\(<h2>ETSI TeraFlowSDN Controller\)</h2>|\1 (End-to-End)</h2>|' src/webui/service/templates/main/home.html cp src/webui/service/templates/main/home.html.bak src/webui/service/templates/main/home.html sed -i 's|\(<h2>ETSI TeraFlowSDN Controller[^<]*\)</h2>|\1 (End-to-End)</h2>|' src/webui/service/templates/main/home.html ./deploy/crdb.sh ./deploy/nats.sh Loading @@ -106,6 +110,7 @@ mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_e2e.sh # ===== Recovering files ========================= mv manifests/contextservice.yaml.bak manifests/contextservice.yaml mv src/webui/service/templates/main/home.html.bak src/webui/service/templates/main/home.html # ===== Wait Content for NATS Subscription ========================= Loading
src/tests/ofc25/dump-logs.sh +5 −5 Original line number Diff line number Diff line Loading @@ -14,11 +14,11 @@ # limitations under the License. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" path="$SCRIPT_DIR/tmp" rm -rf $path/exec mkdir -p $path/exec echo "dumping logs to $path/exec" cd $path TMP_PATH="$SCRIPT_DIR/tmp" rm -rf $TMP_PATH/exec mkdir -p $TMP_PATH/exec echo "dumping logs to $TMP_PATH/exec" cd $TMP_PATH echo "Collecting logs for E2E..." kubectl logs --namespace tfs-e2e deployment/contextservice -c server > exec/e2e-context.log Loading
src/tests/ofc25/tests/Fixtures.py 0 → 100644 +180 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # 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. import os import pytest from typing import Optional, Tuple from context.client.ContextClient import ContextClient from device.client.DeviceClient import DeviceClient from monitoring.client.MonitoringClient import MonitoringClient from e2e_orchestrator.client.E2EOrchestratorClient import E2EOrchestratorClient from service.client.ServiceClient import ServiceClient from vnt_manager.client.VNTManagerClient import VNTManagerClient # Service endpoints from kubectl get services -A # These are ClusterIP addresses - update if services are redeployed SERVICE_ENDPOINTS = { 'opt': { 'context': ('10.152.183.189', 1010), 'device': ('10.152.183.92', 2020), 'service': ('10.152.183.198', 3030), }, 'ip': { 'context': ('10.152.183.79', 1010), 'device': ('10.152.183.112', 2020), 'service': ('10.152.183.174', 3030), 'vnt_manager': ('10.152.183.23', 10080), }, 'e2e': { 'context': ('10.152.183.81', 1010), 'device': ('10.152.183.169', 2020), 'service': ('10.152.183.177', 3030), 'e2e_orchestrator': ('10.152.183.201', 10050), } } def _get_endpoint(layer: str, service_name: str) -> Tuple[str, int]: """Get service endpoint from environment variable or default mapping.""" env_host = os.getenv(f'TFS_{layer.upper()}_{service_name.upper()}_HOST') env_port = os.getenv(f'TFS_{layer.upper()}_{service_name.upper()}_PORT') if env_host and env_port: return (env_host, int(env_port)) endpoint = SERVICE_ENDPOINTS.get(layer, {}).get(service_name) if endpoint is None: raise ValueError(f"No endpoint found for layer='{layer}', service='{service_name}'") return endpoint # ========== Optical Layer Fixtures ========== @pytest.fixture(scope='session') def context_client_opt(): host, port = _get_endpoint('opt', 'context') _client = ContextClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def device_client_opt(): host, port = _get_endpoint('opt', 'device') _client = DeviceClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def service_client_opt(): host, port = _get_endpoint('opt', 'service') _client = ServiceClient(host=host, port=port) yield _client _client.close() # ========== IP Layer Fixtures ========== @pytest.fixture(scope='session') def context_client_ip(): host, port = _get_endpoint('ip', 'context') _client = ContextClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def device_client_ip(): host, port = _get_endpoint('ip', 'device') _client = DeviceClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def service_client_ip(): host, port = _get_endpoint('ip', 'service') _client = ServiceClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def vnt_manager_client_ip(): host, port = _get_endpoint('ip', 'vnt_manager') _client = VNTManagerClient(host=host, port=port) yield _client _client.close() # ========== E2E Layer Fixtures ========== @pytest.fixture(scope='session') def context_client_e2e(): host, port = _get_endpoint('e2e', 'context') _client = ContextClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def device_client_e2e(): host, port = _get_endpoint('e2e', 'device') _client = DeviceClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def service_client_e2e(): host, port = _get_endpoint('e2e', 'service') _client = ServiceClient(host=host, port=port) yield _client _client.close() @pytest.fixture(scope='session') def e2eorchestrator_client_e2e(): host, port = _get_endpoint('e2e', 'e2e_orchestrator') _client = E2EOrchestratorClient(host=host, port=port) yield _client _client.close() # ========== Legacy Fixtures (for backward compatibility) ========== # These use environment variables from tfs_runtime_env_vars.sh @pytest.fixture(scope='session') def service_client(): _client = ServiceClient() yield _client _client.close() @pytest.fixture(scope='session') def context_client(): _client = ContextClient() yield _client _client.close() @pytest.fixture(scope='session') def device_client(): _client = DeviceClient() yield _client _client.close() @pytest.fixture(scope='session') def monitoring_client(): _client = MonitoringClient() yield _client _client.close() @pytest.fixture(scope='session') def e2eorchestrator_client(): _client = E2EOrchestratorClient() yield _client _client.close()