diff --git a/my_deploy.sh b/my_deploy.sh index 6d0a488c293f8109262cbb0adcd8c94e3cdbca04..344ca44ee335e73dcc7b8f8c9ca71ead7d90880f 100755 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -20,7 +20,7 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator qos_profile" +export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" # Uncomment to activate Monitoring (old) #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" diff --git a/src/qos_profile/.gitlab-ci.yml b/src/qos_profile/.gitlab-ci.yml index f46d6385662a34107ca2b3dc984daba209e02241..0525e69b348eef8cd070ae9fc898a556e1ade680 100644 --- a/src/qos_profile/.gitlab-ci.yml +++ b/src/qos_profile/.gitlab-ci.yml @@ -53,12 +53,10 @@ unit_test qos_profile: # QoSProfile-related - if docker container ls | grep crdb; then docker rm -f crdb; else echo "CockroachDB container is not in the system"; fi - if docker volume ls | grep crdb; then docker volume rm -f crdb; else echo "CockroachDB volume is not in the system"; fi - - if docker container ls | grep nats; then docker rm -f nats; else echo "NATS container is not in the system"; fi - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "cockroachdb/cockroach:latest-v22.2" - - docker pull "nats:2.9" - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" # environment preparation @@ -68,26 +66,17 @@ unit_test qos_profile: --env COCKROACH_DATABASE=tfs_test --env COCKROACH_USER=tfs --env COCKROACH_PASSWORD=tfs123 --volume "crdb:/cockroach/cockroach-data" cockroachdb/cockroach:latest-v22.2 start-single-node - - > - docker run --name nats -d --network=teraflowbridge -p 4222:4222 -p 8222:8222 - nats:2.9 --http_port 8222 --user tfs --pass tfs123 - echo "Waiting for initialization..." - while ! docker logs crdb 2>&1 | grep -q 'finished creating default user \"tfs\"'; do sleep 1; done - docker logs crdb - - while ! docker logs nats 2>&1 | grep -q 'Server is ready'; do sleep 1; done - - docker logs nats - docker ps -a - CRDB_ADDRESS=$(docker inspect crdb --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}") - echo $CRDB_ADDRESS - - NATS_ADDRESS=$(docker inspect nats --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}") - - echo $NATS_ADDRESS - > # QoSProfile preparation - > docker run --name $IMAGE_NAME -d -p 3030:3030 --env "CRDB_URI=cockroachdb://tfs:tfs123@${CRDB_ADDRESS}:26257/tfs_test?sslmode=require" - --env "MB_BACKEND=nats" - --env "NATS_URI=nats://tfs:tfs123@${NATS_ADDRESS}:4222" --volume "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG @@ -108,10 +97,7 @@ unit_test qos_profile: # Check status after the tests - docker ps -a - docker logs $IMAGE_NAME - - - docker rm -f $IMAGE_NAME - - - docker rm -f $IMAGE_NAME crdb nats + - docker rm -f $IMAGE_NAME crdb - docker volume rm -f crdb - docker network rm teraflowbridge - docker volume prune --force diff --git a/src/qos_profile/tests/conftest.py b/src/qos_profile/tests/conftest.py index 7c8424e00bf9dfb9bc7ffdcd1a99ea918b7746a2..8983183f3b3fc5da2ffa5a2efb2d2d0bac203f43 100644 --- a/src/qos_profile/tests/conftest.py +++ b/src/qos_profile/tests/conftest.py @@ -45,4 +45,4 @@ def create_qos_profile_from_json(qos_profile_data: dict) -> QoSProfile: qos_profile.packetDelayBudget.CopyFrom(create_QoSProfileValueUnitPair(qos_profile_data['packetDelayBudget'])) qos_profile.jitter.CopyFrom(create_QoSProfileValueUnitPair(qos_profile_data['jitter'])) qos_profile.packetErrorLossRate = qos_profile_data['packetErrorLossRate'] - return qos_profile \ No newline at end of file + return qos_profile diff --git a/src/qos_profile/tests/test_constraints.py b/src/qos_profile/tests/test_constraints.py index dd03ff7ae23a69f72e489caaf16f0bbd54eadb55..78fe73d64c11502c6468134f937003d2700e5b71 100644 --- a/src/qos_profile/tests/test_constraints.py +++ b/src/qos_profile/tests/test_constraints.py @@ -91,4 +91,4 @@ def test_get_constraints(qos_profile_client: QoSProfileClient): assert constraint_2.schedule.start_timestamp == 1726063284.25332 assert constraint_2.schedule.duration_days == 1 - qos_profile_client.DeleteQoSProfile(qos_profile.qos_profile_id) \ No newline at end of file + qos_profile_client.DeleteQoSProfile(qos_profile.qos_profile_id) diff --git a/src/qos_profile/tests/test_crud.py b/src/qos_profile/tests/test_crud.py index 1037f3849885f6976ccba658c54189de15838415..9b92646c3341d2801e3b04741430075b4956a263 100644 --- a/src/qos_profile/tests/test_crud.py +++ b/src/qos_profile/tests/test_crud.py @@ -114,4 +114,4 @@ def test_failed_delete_qos_profiles(qos_profile_client: QoSProfileClient): def test_delete_qos_profiles(qos_profile_client: QoSProfileClient): qos_profile = create_qos_profile_from_json(qos_profile_data) qos_profiles_deleted = qos_profile_client.DeleteQoSProfile(qos_profile.qos_profile_id) - assert qos_profiles_deleted == Empty() \ No newline at end of file + assert qos_profiles_deleted == Empty()