diff --git a/src/device/service/drivers/xr/README_XR.md b/src/device/service/drivers/xr/README_XR.md index f7c2316ce5fa810969d373e1fad7bc5ca83b9e49..3bfdf5b019b3c36e7ded09d58ac625a48add36a9 100644 --- a/src/device/service/drivers/xr/README_XR.md +++ b/src/device/service/drivers/xr/README_XR.md @@ -110,7 +110,7 @@ Upload descriptors_emulatex_xr.json via WEB UI to setup fake topology. Setup service by following commands in src directory. Kubernetes endpoins change on every build, so setup script is mandatory. ```bash - source tests/ofc22/setup_test_env.sh + source device/service/drivers/xr/setup_test_env.sh python -m pytest --verbose tests/ofc22/tests/test_functional_create_service_xr.py ``` diff --git a/src/device/service/drivers/xr/setup_test_env.sh b/src/device/service/drivers/xr/setup_test_env.sh new file mode 100755 index 0000000000000000000000000000000000000000..1f8b0a5a7a8dc986715c6f54a62151f6afa4ad80 --- /dev/null +++ b/src/device/service/drivers/xr/setup_test_env.sh @@ -0,0 +1,9 @@ +#!/bin/sh +export CONTEXTSERVICE_SERVICE_HOST=$(kubectl get service/contextservice --namespace tfs --template '{{.spec.clusterIP}}') +export CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service/contextservice --namespace tfs -o jsonpath='{.spec.ports[?(@.name=="grpc")].port}') +export COMPUTESERVICE_SERVICE_HOST=$(kubectl get service/computeservice --namespace tfs --template '{{.spec.clusterIP}}') +export COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service/computeservice --namespace tfs -o jsonpath='{.spec.ports[?(@.name=="http")].port}') +echo "CONTEXTSERVICE_SERVICE_HOST=$CONTEXTSERVICE_SERVICE_HOST" +echo "CONTEXTSERVICE_SERVICE_PORT_GRPC=$CONTEXTSERVICE_SERVICE_PORT_GRPC" +echo "COMPUTESERVICE_SERVICE_HOST=$COMPUTESERVICE_SERVICE_HOST" +echo "COMPUTESERVICE_SERVICE_PORT_HTTP=$COMPUTESERVICE_SERVICE_PORT_HTTP" diff --git a/src/tests/ofc22/tests/test_functional_create_service_xr.py b/src/tests/ofc22/tests/test_functional_create_service_xr.py index bb78abc1efe7701308448ad4b83ef2a6e32079c4..6008eaa10702f0491742f6195a5fdf15735e5f14 100644 --- a/src/tests/ofc22/tests/test_functional_create_service_xr.py +++ b/src/tests/ofc22/tests/test_functional_create_service_xr.py @@ -20,7 +20,7 @@ from common.tools.object_factory.Connection import json_connection_id from common.tools.object_factory.Device import json_device_id from common.tools.object_factory.Service import json_service_id from common.tools.grpc.Tools import grpc_message_to_json_string -from compute.tests.mock_osm.MockOSM import MockOSM +from tests.tools.mock_osm.MockOSM import MockOSM from context.client.ContextClient import ContextClient from context.client.EventsCollector import EventsCollector from common.proto.context_pb2 import ContextId, Empty diff --git a/src/tests/ofc22/tests/test_functional_delete_service_xr.py b/src/tests/ofc22/tests/test_functional_delete_service_xr.py index f28828be056e755058a0f6b15bd8ea3e9acbbdeb..546a8781bee125dd48723c67cddd2aec26dc3ed9 100644 --- a/src/tests/ofc22/tests/test_functional_delete_service_xr.py +++ b/src/tests/ofc22/tests/test_functional_delete_service_xr.py @@ -20,7 +20,7 @@ from common.tools.object_factory.Connection import json_connection_id from common.tools.object_factory.Device import json_device_id from common.tools.object_factory.Service import json_service_id from common.tools.grpc.Tools import grpc_message_to_json_string -from compute.tests.mock_osm.MockOSM import MockOSM +from tests.tools.mock_osm.MockOSM import MockOSM from context.client.ContextClient import ContextClient from context.client.EventsCollector import EventsCollector from common.proto.context_pb2 import ContextId, Empty, ServiceTypeEnum