diff --git a/run_integration_tests.sh b/run_integration_tests.sh index b9232c7176ebf0cfb2c49404b0fd6194660c9214..7cbbda122078ae1443fe9db8c51d7f47cd92c9d6 100755 --- a/run_integration_tests.sh +++ b/run_integration_tests.sh @@ -1,10 +1,10 @@ #!/bin/bash -## Make folder containing the script the root folder for its execution -#cd $(dirname $0) - -#ENDPOINT=($(kubectl --namespace teraflow-development get service contextservice -o 'jsonpath={.spec.clusterIP} {.spec.ports[?(@.name=="grpc")].port}')) -#docker run -it --env TEST_TARGET_ADDRESS=${ENDPOINT[0]} --env TEST_TARGET_PORT=${ENDPOINT[1]} context_service:test - - -kubectl run integration-test --restart=Never --rm -i --tty --image centos -- /bin/bash +IMAGE_NAME='integration_tester' +IMAGE_TAG='latest' +CI_REGISTRY_IMAGE='registry.gitlab.com/teraflow-h2020/controller' + +kubectl delete pod $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --wait=true --ignore-not-found=true +kubectl get all +kubectl run $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --image "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" --restart=Never --rm -i +kubectl get all diff --git a/src/context/service/ContextServiceServicerImpl.py b/src/context/service/ContextServiceServicerImpl.py index 765a825081985f8f973ef9e71f6a5639780f444b..6a189d67835a3185c3d87f52bd76dd9582e261dc 100644 --- a/src/context/service/ContextServiceServicerImpl.py +++ b/src/context/service/ContextServiceServicerImpl.py @@ -2,6 +2,7 @@ from typing import Dict, List, Set, Tuple import grpc, logging from prometheus_client import Counter, Histogram from common.Checkers import chk_string +from common.database.api.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID from common.database.api.Database import Database from common.exceptions.ServiceException import ServiceException from context.proto.context_pb2 import Empty, Link, LinkId, Topology @@ -9,9 +10,6 @@ from context.proto.context_pb2_grpc import ContextServiceServicer LOGGER = logging.getLogger(__name__) -DEFAULT_CONTEXT_ID = 'admin' -DEFAULT_TOPOLOGY_ID = 'admin' - GETTOPOLOGY_COUNTER_STARTED = Counter ('context_gettopology_counter_started', 'Context:GetTopology counter of requests started' ) GETTOPOLOGY_COUNTER_COMPLETED = Counter ('context_gettopology_counter_completed', diff --git a/src/device/service/DeviceServiceServicerImpl.py b/src/device/service/DeviceServiceServicerImpl.py index 2aa135c287e153031b2b5651af19f41112416d4e..71c4bfc6d8dc809a837669614aaf60c7e6578fd9 100644 --- a/src/device/service/DeviceServiceServicerImpl.py +++ b/src/device/service/DeviceServiceServicerImpl.py @@ -2,6 +2,7 @@ from typing import List, Tuple import grpc, logging from prometheus_client import Counter, Histogram from common.Checkers import chk_options, chk_string +from common.database.api.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID from common.database.api.Database import Database from common.database.api.context.OperationalStatus import OperationalStatus, operationalstatus_enum_values, \ to_operationalstatus_enum @@ -11,9 +12,6 @@ from device.proto.device_pb2_grpc import DeviceServiceServicer LOGGER = logging.getLogger(__name__) -DEFAULT_CONTEXT_ID = 'admin' -DEFAULT_TOPOLOGY_ID = 'admin' - ADDDEVICE_COUNTER_STARTED = Counter ('device_adddevice_counter_started', 'Device:AddDevice counter of requests started' ) ADDDEVICE_COUNTER_COMPLETED = Counter ('device_adddevice_counter_completed', diff --git a/src/integration_tester/.gitlab-ci.yml b/src/integration_tester/.gitlab-ci.yml index 8068408ee77193d4a8d1e8b1f0bd133c64ce0b86..d090e73a20e3eea4c0fb19cac579fd3aa251f79e 100644 --- a/src/integration_tester/.gitlab-ci.yml +++ b/src/integration_tester/.gitlab-ci.yml @@ -57,8 +57,7 @@ integration_test integration_tester: - kubectl get all - kubectl delete pod $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --wait=true --ignore-not-found=true - kubectl get all - # --rm to remove tester when it finishes - - kubectl run $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --image "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" --restart=Never -i + - kubectl run $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --image "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" --restart=Never -i --rm - kubectl get all #when: manual #allow_failure: false