From a083b51a24002bc4602c7bb8a39e32ff999e8e27 Mon Sep 17 00:00:00 2001
From: Lluis Gifre <lluis.gifre@cttc.es>
Date: Mon, 18 Jul 2022 13:49:25 +0200
Subject: [PATCH] Fixing a few things on the tests.

---
 deploy_in_kubernetes.sh                                 | 2 +-
 src/tests/ofc22/run_test_01_bootstrap.sh                | 2 +-
 src/tests/ofc22/tests/LoadDescriptors.py                | 2 +-
 src/tests/ofc22/tests/Objects.py                        | 4 ++--
 src/tests/ofc22/tests/test_functional_cleanup.py        | 2 +-
 src/tests/ofc22/tests/test_functional_create_service.py | 2 +-
 src/tests/ofc22/tests/test_functional_delete_service.py | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/deploy_in_kubernetes.sh b/deploy_in_kubernetes.sh
index a1b4551dd..d659e48e4 100755
--- a/deploy_in_kubernetes.sh
+++ b/deploy_in_kubernetes.sh
@@ -81,7 +81,7 @@ for COMPONENT in $COMPONENTS; do
     if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then
         docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG"
     else 
-        docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/ > "$BUILD_LOG"
+        docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG"
     fi
 
     if [ -n "$REGISTRY_IMAGE" ]; then
diff --git a/src/tests/ofc22/run_test_01_bootstrap.sh b/src/tests/ofc22/run_test_01_bootstrap.sh
index 634fed02d..9a91c0f4b 100755
--- a/src/tests/ofc22/run_test_01_bootstrap.sh
+++ b/src/tests/ofc22/run_test_01_bootstrap.sh
@@ -47,5 +47,5 @@ export COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-pub
 
 # Run functional test and analyze coverage of code at same time
 
-coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
+coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose -x \
     tests/ofc22/tests/test_functional_bootstrap.py
diff --git a/src/tests/ofc22/tests/LoadDescriptors.py b/src/tests/ofc22/tests/LoadDescriptors.py
index 4d3af78f5..33bc699af 100644
--- a/src/tests/ofc22/tests/LoadDescriptors.py
+++ b/src/tests/ofc22/tests/LoadDescriptors.py
@@ -15,7 +15,7 @@
 import json, logging, sys
 from common.Settings import get_setting
 from context.client.ContextClient import ContextClient
-from context.proto.context_pb2 import Context, Device, Link, Topology
+from common.proto.context_pb2 import Context, Device, Link, Topology
 from device.client.DeviceClient import DeviceClient
 
 LOGGER = logging.getLogger(__name__)
diff --git a/src/tests/ofc22/tests/Objects.py b/src/tests/ofc22/tests/Objects.py
index 2141beb69..f8d109696 100644
--- a/src/tests/ofc22/tests/Objects.py
+++ b/src/tests/ofc22/tests/Objects.py
@@ -195,14 +195,14 @@ WIM_SEP_R1_ID          = compose_service_endpoint_id(ENDPOINT_ID_R1_13_1_2)
 WIM_SEP_R1_ROUTER_ID   = '10.10.10.1'
 WIM_SEP_R1_ROUTER_DIST = '65000:111'
 WIM_SEP_R1_SITE_ID     = '1'
-WIM_SEP_R1_BEARER      = compose_bearer(ENDPOINT_ID_R1_13_1_2, WIM_SEP_R1_ROUTER_ID, WIM_SEP_R1_ROUTER_DIST)
+WIM_SEP_R1_BEARER      = WIM_SEP_R1_ID
 WIM_SRV_R1_VLAN_ID     = 400
 
 WIM_SEP_R3_ID          = compose_service_endpoint_id(ENDPOINT_ID_R3_13_1_2)
 WIM_SEP_R3_ROUTER_ID   = '20.20.20.1'
 WIM_SEP_R3_ROUTER_DIST = '65000:222'
 WIM_SEP_R3_SITE_ID     = '2'
-WIM_SEP_R3_BEARER      = compose_bearer(ENDPOINT_ID_R3_13_1_2, WIM_SEP_R3_ROUTER_ID, WIM_SEP_R3_ROUTER_DIST)
+WIM_SEP_R3_BEARER      = WIM_SEP_R3_ID
 WIM_SRV_R3_VLAN_ID     = 500
 
 WIM_USERNAME = 'admin'
diff --git a/src/tests/ofc22/tests/test_functional_cleanup.py b/src/tests/ofc22/tests/test_functional_cleanup.py
index eb78a5850..6c3a79dfd 100644
--- a/src/tests/ofc22/tests/test_functional_cleanup.py
+++ b/src/tests/ofc22/tests/test_functional_cleanup.py
@@ -21,7 +21,7 @@ from common.tools.object_factory.Link import json_link_id
 from common.tools.object_factory.Topology import json_topology_id
 from context.client.ContextClient import ContextClient
 from context.client.EventsCollector import EventsCollector
-from context.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId
+from common.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId
 from device.client.DeviceClient import DeviceClient
 from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES
 
diff --git a/src/tests/ofc22/tests/test_functional_create_service.py b/src/tests/ofc22/tests/test_functional_create_service.py
index f3389fdbf..a63050181 100644
--- a/src/tests/ofc22/tests/test_functional_create_service.py
+++ b/src/tests/ofc22/tests/test_functional_create_service.py
@@ -23,7 +23,7 @@ from common.tools.grpc.Tools import grpc_message_to_json_string
 from compute.tests.mock_osm.MockOSM import MockOSM
 from context.client.ContextClient import ContextClient
 from context.client.EventsCollector import EventsCollector
-from context.proto.context_pb2 import ContextId, Empty
+from common.proto.context_pb2 import ContextId, Empty
 from .Objects import (
     CONTEXT_ID, CONTEXTS, DEVICE_O1_UUID, DEVICE_R1_UUID, DEVICE_R3_UUID, DEVICES, LINKS, TOPOLOGIES,
     WIM_MAPPING, WIM_PASSWORD, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE, WIM_USERNAME)
diff --git a/src/tests/ofc22/tests/test_functional_delete_service.py b/src/tests/ofc22/tests/test_functional_delete_service.py
index 51e91a596..222dee5ad 100644
--- a/src/tests/ofc22/tests/test_functional_delete_service.py
+++ b/src/tests/ofc22/tests/test_functional_delete_service.py
@@ -23,7 +23,7 @@ from common.tools.grpc.Tools import grpc_message_to_json_string
 from compute.tests.mock_osm.MockOSM import MockOSM
 from context.client.ContextClient import ContextClient
 from context.client.EventsCollector import EventsCollector
-from context.proto.context_pb2 import ContextId, Empty
+from common.proto.context_pb2 import ContextId, Empty
 from .Objects import (
     CONTEXT_ID, CONTEXTS, DEVICE_O1_UUID, DEVICE_R1_UUID, DEVICE_R3_UUID, DEVICES, LINKS, TOPOLOGIES, WIM_MAPPING,
     WIM_PASSWORD, WIM_USERNAME)
-- 
GitLab