From 9ebc0ca737216902ca8ed20b78ca71a37ecb061a Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Tue, 24 Dec 2024 16:28:24 +0000
Subject: [PATCH] ECOC24 test:

- Code styling
- Cleanup
---
 src/tests/ecoc24/.gitlab-ci.yml               |  2 +-
 src/tests/ecoc24/Dockerfile                   | 42 +++++++------------
 src/tests/ecoc24/deploy_specs_e2e.sh          |  8 +---
 src/tests/ecoc24/deploy_specs_ip.sh           |  7 +---
 src/tests/ecoc24/deploy_specs_opt.sh          | 17 ++++----
 src/tests/ecoc24/tests/__init__.py            |  2 +-
 .../tests/test_functional_bootstrap_e2e.py    |  2 +-
 .../tests/test_functional_bootstrap_ip.py     |  2 +-
 .../tests/test_functional_bootstrap_opt.py    |  2 +-
 9 files changed, 32 insertions(+), 52 deletions(-)

diff --git a/src/tests/ecoc24/.gitlab-ci.yml b/src/tests/ecoc24/.gitlab-ci.yml
index e1b56eaec..8e3f7e71a 100644
--- a/src/tests/ecoc24/.gitlab-ci.yml
+++ b/src/tests/ecoc24/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
+# Copyright 2022-2024 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.
diff --git a/src/tests/ecoc24/Dockerfile b/src/tests/ecoc24/Dockerfile
index 4a2d4e043..8fca59f57 100644
--- a/src/tests/ecoc24/Dockerfile
+++ b/src/tests/ecoc24/Dockerfile
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
+# Copyright 2022-2024 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.
@@ -22,11 +22,6 @@ RUN apt-get --yes --quiet --quiet update && \
 # Set Python to show logs as they occur
 ENV PYTHONUNBUFFERED=0
 
-# Download the gRPC health probe
-RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
-    wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
-    chmod +x /bin/grpc_health_probe
-
 # Get generic Python packages
 RUN python3 -m pip install --upgrade pip
 RUN python3 -m pip install --upgrade setuptools wheel
@@ -85,23 +80,18 @@ COPY src/tests/ecoc24/descriptors/descriptor_opt.json ./tests/ecoc24/descriptors
 COPY src/tests/ecoc24/descriptors/descriptor_e2e.json ./tests/ecoc24/descriptors/descriptor_e2e.json
 COPY src/tests/ecoc24/tests/. ./tests/ecoc24/tests/
 
-# RUN tee ./run_tests.sh <<EOF
-#!/bin/bash
-#source /var/teraflow/tfs_runtime_env_vars.sh
-#export PYTHONPATH=/var/teraflow
-#pytest --verbose --log-level=INFO /var/teraflow/tests/ecoc24/tests/test_functional_bootstrap_opt.py --junitxml=/opt/results/report_bootstrap_opt.xml
-#pytest --verbose --log-level=INFO /var/teraflow/tests/ecoc24/tests/test_functional_bootstrap_ip.py --junitxml=/opt/results/report_bootstrap_ip.xml
-#sleep 5
-#pytest --verbose --log-level=INFO /var/teraflow/tests/ecoc24/tests/test_functional_bootstrap_e2e.py --junitxml=/opt/results/report_bootstrap_e2e.xml
-#pytest --verbose --log-level=INFO /var/teraflow/tests/ofc24/tests/test_functional_create_service.py --junitxml=/opt/results/report_create_service.xml
-#pytest --verbose --log-level=INFO /var/teraflow/tests/ofc24/tests/test_functional_delete_service.py --junitxml=/opt/results/report_delete_service.xml
-#pytest --verbose --log-level=INFO /var/teraflow/tests/ofc24/tests/test_functional_cleanup.py        --junitxml=/opt/results/report_cleanup.xml
-#EOF
-#RUN chmod ug+x ./run_tests.sh
-
-
-
-
-
-# Run the tests
-# ENTRYPOINT ["./run_tests.sh"]
+RUN tee ./run_tests.sh <<EOF
+!/bin/bash
+source /var/teraflow/tfs_runtime_env_vars.sh
+export PYTHONPATH=/var/teraflow
+pytest --verbose --log-level=INFO /var/teraflow/tests/ecoc24/tests/test_functional_bootstrap_opt.py --junitxml=/opt/results/report_bootstrap_opt.xml
+pytest --verbose --log-level=INFO /var/teraflow/tests/ecoc24/tests/test_functional_bootstrap_ip.py --junitxml=/opt/results/report_bootstrap_ip.xml
+sleep 5
+pytest --verbose --log-level=INFO /var/teraflow/tests/ecoc24/tests/test_functional_bootstrap_e2e.py --junitxml=/opt/results/report_bootstrap_e2e.xml
+pytest --verbose --log-level=INFO /var/teraflow/tests/ofc24/tests/test_functional_create_service.py --junitxml=/opt/results/report_create_service.xml
+pytest --verbose --log-level=INFO /var/teraflow/tests/ofc24/tests/test_functional_delete_service.py --junitxml=/opt/results/report_delete_service.xml
+pytest --verbose --log-level=INFO /var/teraflow/tests/ofc24/tests/test_functional_cleanup.py        --junitxml=/opt/results/report_cleanup.xml
+EOF
+RUN chmod ug+x ./run_tests.sh
+
+#ENTRYPOINT ["./run_tests.sh"]
diff --git a/src/tests/ecoc24/deploy_specs_e2e.sh b/src/tests/ecoc24/deploy_specs_e2e.sh
index 2c4f165dc..2792f9fd3 100755
--- a/src/tests/ecoc24/deploy_specs_e2e.sh
+++ b/src/tests/ecoc24/deploy_specs_e2e.sh
@@ -66,7 +66,7 @@ export TFS_COMPONENTS="context device pathcomp service nbi webui"
 export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator"
 
 # Uncomment to activate VNT Manager
-# export TFS_COMPONENTS="${TFS_COMPONENTS} vnt_manager"
+#export TFS_COMPONENTS="${TFS_COMPONENTS} vnt_manager"
 
 # Uncomment to activate DLT and Interdomain
 #export TFS_COMPONENTS="${TFS_COMPONENTS} interdomain dlt"
@@ -129,15 +129,12 @@ export CRDB_USERNAME="tfs"
 # Set the database user's password to be used by Context.
 export CRDB_PASSWORD="tfs123"
 
-# Set the database name to be used by Context.
-export CRDB_DATABASE="tfs_e2e"
-
 # Set CockroachDB installation mode to 'single'. This option is convenient for development and testing.
 # See ./deploy/all.sh or ./deploy/crdb.sh for additional details
 export CRDB_DEPLOY_MODE="single"
 
 # Disable flag for dropping database, if it exists.
-export CRDB_DROP_DATABASE_IF_EXISTS="NO"
+export CRDB_DROP_DATABASE_IF_EXISTS="YES"
 
 # Disable flag for re-deploying CockroachDB from scratch.
 export CRDB_REDEPLOY=""
@@ -214,4 +211,3 @@ export KFK_SERVER_PORT="9092"
 
 # Set the flag to YES for redeploying of Apache Kafka
 export KFK_REDEPLOY=""
- 
\ No newline at end of file
diff --git a/src/tests/ecoc24/deploy_specs_ip.sh b/src/tests/ecoc24/deploy_specs_ip.sh
index 14abb933c..1e105557b 100755
--- a/src/tests/ecoc24/deploy_specs_ip.sh
+++ b/src/tests/ecoc24/deploy_specs_ip.sh
@@ -63,7 +63,7 @@ export TFS_COMPONENTS="context device pathcomp service nbi webui"
 #export TFS_COMPONENTS="${TFS_COMPONENTS} forecaster"
 
 # Uncomment to activate E2E Orchestrator
-# export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator"
+#export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator"
 
 # Uncomment to activate VNT Manager
 export TFS_COMPONENTS="${TFS_COMPONENTS} vnt_manager"
@@ -129,15 +129,12 @@ export CRDB_USERNAME="tfs"
 # Set the database user's password to be used by Context.
 export CRDB_PASSWORD="tfs123"
 
-# Set the database name to be used by Context.
-export CRDB_DATABASE="tfs_ip"
-
 # Set CockroachDB installation mode to 'single'. This option is convenient for development and testing.
 # See ./deploy/all.sh or ./deploy/crdb.sh for additional details
 export CRDB_DEPLOY_MODE="single"
 
 # Disable flag for dropping database, if it exists.
-export CRDB_DROP_DATABASE_IF_EXISTS="NO"
+export CRDB_DROP_DATABASE_IF_EXISTS="YES"
 
 # Disable flag for re-deploying CockroachDB from scratch.
 export CRDB_REDEPLOY=""
diff --git a/src/tests/ecoc24/deploy_specs_opt.sh b/src/tests/ecoc24/deploy_specs_opt.sh
index 0622e2581..ca650bb65 100755
--- a/src/tests/ecoc24/deploy_specs_opt.sh
+++ b/src/tests/ecoc24/deploy_specs_opt.sh
@@ -63,10 +63,10 @@ export TFS_COMPONENTS="context device pathcomp service nbi webui"
 #export TFS_COMPONENTS="${TFS_COMPONENTS} forecaster"
 
 # Uncomment to activate E2E Orchestrator
-# export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator"
+#export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator"
 
 # Uncomment to activate VNT Manager
-# export TFS_COMPONENTS="${TFS_COMPONENTS} vnt_manager"
+#export TFS_COMPONENTS="${TFS_COMPONENTS} vnt_manager"
 
 # Uncomment to activate DLT and Interdomain
 #export TFS_COMPONENTS="${TFS_COMPONENTS} interdomain dlt"
@@ -129,9 +129,6 @@ export CRDB_USERNAME="tfs"
 # Set the database user's password to be used by Context.
 export CRDB_PASSWORD="tfs123"
 
-# Set the database name to be used by Context.
-export CRDB_DATABASE="tfs_opt"
-
 # Set CockroachDB installation mode to 'single'. This option is convenient for development and testing.
 # See ./deploy/all.sh or ./deploy/crdb.sh for additional details
 export CRDB_DEPLOY_MODE="single"
@@ -149,10 +146,10 @@ export CRDB_REDEPLOY=""
 export NATS_NAMESPACE="nats-opt"
 
 # Set the external port NATS Client interface will be exposed to.
-export NATS_EXT_PORT_CLIENT="4224"
+export NATS_EXT_PORT_CLIENT="4225"
 
 # Set the external port NATS HTTP Mgmt GUI interface will be exposed to.
-export NATS_EXT_PORT_HTTP="8224"
+export NATS_EXT_PORT_HTTP="8225"
 
 # Set NATS installation mode to 'single'. This option is convenient for development and testing.
 # See ./deploy/all.sh or ./deploy/nats.sh for additional details
@@ -168,13 +165,13 @@ export NATS_REDEPLOY=""
 export QDB_NAMESPACE="qdb-opt"
 
 # Set the external port QuestDB Postgre SQL interface will be exposed to.
-export QDB_EXT_PORT_SQL="8814"
+export QDB_EXT_PORT_SQL="8815"
 
 # Set the external port QuestDB Influx Line Protocol interface will be exposed to.
-export QDB_EXT_PORT_ILP="9012"
+export QDB_EXT_PORT_ILP="9013"
 
 # Set the external port QuestDB HTTP Mgmt GUI interface will be exposed to.
-export QDB_EXT_PORT_HTTP="9002"
+export QDB_EXT_PORT_HTTP="9003"
 
 # Set the database username to be used for QuestDB.
 export QDB_USERNAME="admin"
diff --git a/src/tests/ecoc24/tests/__init__.py b/src/tests/ecoc24/tests/__init__.py
index 3ee6f7071..53d5157f7 100644
--- a/src/tests/ecoc24/tests/__init__.py
+++ b/src/tests/ecoc24/tests/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
+# Copyright 2022-2024 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.
diff --git a/src/tests/ecoc24/tests/test_functional_bootstrap_e2e.py b/src/tests/ecoc24/tests/test_functional_bootstrap_e2e.py
index cd72f5e94..27648969b 100644
--- a/src/tests/ecoc24/tests/test_functional_bootstrap_e2e.py
+++ b/src/tests/ecoc24/tests/test_functional_bootstrap_e2e.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
+# Copyright 2022-2024 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.
diff --git a/src/tests/ecoc24/tests/test_functional_bootstrap_ip.py b/src/tests/ecoc24/tests/test_functional_bootstrap_ip.py
index 692cd41e7..668213a56 100644
--- a/src/tests/ecoc24/tests/test_functional_bootstrap_ip.py
+++ b/src/tests/ecoc24/tests/test_functional_bootstrap_ip.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
+# Copyright 2022-2024 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.
diff --git a/src/tests/ecoc24/tests/test_functional_bootstrap_opt.py b/src/tests/ecoc24/tests/test_functional_bootstrap_opt.py
index 2f400c346..f3097519a 100644
--- a/src/tests/ecoc24/tests/test_functional_bootstrap_opt.py
+++ b/src/tests/ecoc24/tests/test_functional_bootstrap_opt.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
+# Copyright 2022-2024 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.
-- 
GitLab