Skip to content
Snippets Groups Projects
Commit d8cd5309 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Tests - Ryu-OpenFlow integration test:

- Testing CI/CD pipeline
parent d8a114e3
No related branches found
No related tags found
2 merge requests!359Release TeraFlowSDN 5.0,!296Resolve "(CTTC) Add OpenFlow support through Ryu SDN controller"
......@@ -21,39 +21,39 @@ stages:
# include the individual .gitlab-ci.yml of each micro-service and tests
include:
#- local: '/manifests/.gitlab-ci.yml'
- local: '/src/monitoring/.gitlab-ci.yml'
- local: '/src/nbi/.gitlab-ci.yml'
- local: '/src/context/.gitlab-ci.yml'
- local: '/src/device/.gitlab-ci.yml'
- local: '/src/service/.gitlab-ci.yml'
- local: '/src/dbscanserving/.gitlab-ci.yml'
- local: '/src/opticalattackmitigator/.gitlab-ci.yml'
- local: '/src/opticalattackdetector/.gitlab-ci.yml'
- local: '/src/opticalattackmanager/.gitlab-ci.yml'
- local: '/src/opticalcontroller/.gitlab-ci.yml'
- local: '/src/ztp/.gitlab-ci.yml'
- local: '/src/policy/.gitlab-ci.yml'
- local: '/src/automation/.gitlab-ci.yml'
- local: '/src/forecaster/.gitlab-ci.yml'
#- local: '/src/webui/.gitlab-ci.yml'
#- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml'
#- local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml'
#- local: '/src/l3_attackmitigator/.gitlab-ci.yml'
- local: '/src/slice/.gitlab-ci.yml'
#- local: '/src/interdomain/.gitlab-ci.yml'
- local: '/src/pathcomp/.gitlab-ci.yml'
#- local: '/src/dlt/.gitlab-ci.yml'
- local: '/src/load_generator/.gitlab-ci.yml'
- local: '/src/bgpls_speaker/.gitlab-ci.yml'
- local: '/src/kpi_manager/.gitlab-ci.yml'
- local: '/src/kpi_value_api/.gitlab-ci.yml'
#- local: '/src/kpi_value_writer/.gitlab-ci.yml'
#- local: '/src/telemetry/.gitlab-ci.yml'
- local: '/src/analytics/.gitlab-ci.yml'
- local: '/src/qos_profile/.gitlab-ci.yml'
- local: '/src/vnt_manager/.gitlab-ci.yml'
- local: '/src/e2e_orchestrator/.gitlab-ci.yml'
# #- local: '/manifests/.gitlab-ci.yml'
# - local: '/src/monitoring/.gitlab-ci.yml'
# - local: '/src/nbi/.gitlab-ci.yml'
# - local: '/src/context/.gitlab-ci.yml'
# - local: '/src/device/.gitlab-ci.yml'
# - local: '/src/service/.gitlab-ci.yml'
# - local: '/src/dbscanserving/.gitlab-ci.yml'
# - local: '/src/opticalattackmitigator/.gitlab-ci.yml'
# - local: '/src/opticalattackdetector/.gitlab-ci.yml'
# - local: '/src/opticalattackmanager/.gitlab-ci.yml'
# - local: '/src/opticalcontroller/.gitlab-ci.yml'
# - local: '/src/ztp/.gitlab-ci.yml'
# - local: '/src/policy/.gitlab-ci.yml'
# - local: '/src/automation/.gitlab-ci.yml'
# - local: '/src/forecaster/.gitlab-ci.yml'
# #- local: '/src/webui/.gitlab-ci.yml'
# #- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml'
# #- local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml'
# #- local: '/src/l3_attackmitigator/.gitlab-ci.yml'
# - local: '/src/slice/.gitlab-ci.yml'
# #- local: '/src/interdomain/.gitlab-ci.yml'
# - local: '/src/pathcomp/.gitlab-ci.yml'
# #- local: '/src/dlt/.gitlab-ci.yml'
# - local: '/src/load_generator/.gitlab-ci.yml'
# - local: '/src/bgpls_speaker/.gitlab-ci.yml'
# - local: '/src/kpi_manager/.gitlab-ci.yml'
# - local: '/src/kpi_value_api/.gitlab-ci.yml'
# #- local: '/src/kpi_value_writer/.gitlab-ci.yml'
# #- local: '/src/telemetry/.gitlab-ci.yml'
# - local: '/src/analytics/.gitlab-ci.yml'
# - local: '/src/qos_profile/.gitlab-ci.yml'
# - local: '/src/vnt_manager/.gitlab-ci.yml'
# - local: '/src/e2e_orchestrator/.gitlab-ci.yml'
# This should be last one: end-to-end integration tests
- local: '/src/tests/.gitlab-ci.yml'
......@@ -14,16 +14,16 @@
# include the individual .gitlab-ci.yml of each end-to-end integration test
include:
- local: '/src/tests/ofc22/.gitlab-ci.yml'
#- local: '/src/tests/oeccpsc22/.gitlab-ci.yml'
- local: '/src/tests/ecoc22/.gitlab-ci.yml'
#- local: '/src/tests/nfvsdn22/.gitlab-ci.yml'
#- local: '/src/tests/ofc23/.gitlab-ci.yml'
- local: '/src/tests/ofc24/.gitlab-ci.yml'
- local: '/src/tests/eucnc24/.gitlab-ci.yml'
- local: '/src/tests/ofc25-camara-agg-net-controller/.gitlab-ci.yml'
- local: '/src/tests/ofc25-camara-e2e-controller/.gitlab-ci.yml'
#- local: '/src/tests/ofc25/.gitlab-ci.yml'
#- local: '/src/tests/ryu-openflow/.gitlab-ci.yml'
# - local: '/src/tests/ofc22/.gitlab-ci.yml'
# #- local: '/src/tests/oeccpsc22/.gitlab-ci.yml'
# - local: '/src/tests/ecoc22/.gitlab-ci.yml'
# #- local: '/src/tests/nfvsdn22/.gitlab-ci.yml'
# #- local: '/src/tests/ofc23/.gitlab-ci.yml'
# - local: '/src/tests/ofc24/.gitlab-ci.yml'
# - local: '/src/tests/eucnc24/.gitlab-ci.yml'
# - local: '/src/tests/ofc25-camara-agg-net-controller/.gitlab-ci.yml'
# - local: '/src/tests/ofc25-camara-e2e-controller/.gitlab-ci.yml'
# #- local: '/src/tests/ofc25/.gitlab-ci.yml'
- local: '/src/tests/ryu-openflow/.gitlab-ci.yml'
- local: '/src/tests/tools/mock_tfs_nbi_dependencies/.gitlab-ci.yml'
# - local: '/src/tests/tools/mock_tfs_nbi_dependencies/.gitlab-ci.yml'
......@@ -19,7 +19,12 @@ build ryu-openflow:
stage: build
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker ps -aq | xargs -r docker rm -f
- containerlab destroy --all --cleanup || true
script:
- echo "CI_PIPELINE_SOURCE = $CI_PIPELINE_SOURCE"
- echo "CI_MERGE_REQUEST_ID = $CI_MERGE_REQUEST_ID"
- echo "CI_MERGE_REQUEST_IID = $CI_MERGE_REQUEST_IID"
- docker buildx build -t "${TEST_NAME}:latest" -f ./src/tests/${TEST_NAME}/Dockerfile .
- docker tag "${TEST_NAME}:latest" "$CI_REGISTRY_IMAGE/${TEST_NAME}:latest"
- docker push "$CI_REGISTRY_IMAGE/${TEST_NAME}:latest"
......@@ -35,224 +40,223 @@ build ryu-openflow:
- src/tests/${TEST_NAME}/Dockerfile
- .gitlab-ci.yml
# Deploy TeraFlowSDN and Execute end-2-end test
end2end_test ryu-openflow:
timeout: 90m
variables:
TEST_NAME: 'ryu-openflow'
stage: end2end_test
# Disable to force running it after all other tasks
#needs:
# - build ryu-openflow
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker rm -f ${TEST_NAME} || true
- containerlab destroy --all --cleanup || true
script:
# Download Docker image to run the test
- docker pull "${CI_REGISTRY_IMAGE}/${TEST_NAME}:latest"
# Check MicroK8s is ready
- microk8s status --wait-ready
- kubectl get pods --all-namespaces
# Deploy ContainerLab Scenario
- RUNNER_PATH=`pwd`
#- cd $PWD/src/tests/${TEST_NAME}
- mkdir -p /tmp/clab/${TEST_NAME}
- cp -R src/tests/${TEST_NAME}/clab/* /tmp/clab/${TEST_NAME}
- tree -la /tmp/clab/${TEST_NAME}
- cd /tmp/clab/${TEST_NAME}
- containerlab deploy --reconfigure --topo ryu-openflow.clab.yml
- cd $RUNNER_PATH
# Wait for initialization of Device NOSes
- sleep 3
- docker ps -a
# Dump configuration of the routers (before any configuration)
- containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# Configure TeraFlowSDN deployment
# Uncomment if DEBUG log level is needed for the components
#- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/contextservice.yaml
#- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/deviceservice.yaml
#- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="frontend").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/pathcompservice.yaml
#- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/serviceservice.yaml
#- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/nbiservice.yaml
#- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/monitoringservice.yaml
- source src/tests/${TEST_NAME}/deploy_specs.sh
#- export TFS_REGISTRY_IMAGES="${CI_REGISTRY_IMAGE}"
#- export TFS_SKIP_BUILD="YES"
#- export TFS_IMAGE_TAG="latest"
#- echo "TFS_REGISTRY_IMAGES=${CI_REGISTRY_IMAGE}"
# Deploy TeraFlowSDN
- ./deploy/crdb.sh
- ./deploy/nats.sh
- ./deploy/kafka.sh
- ./deploy/qdb.sh
- ./deploy/tfs.sh
- ./deploy/show.sh
## Wait for Context to be subscribed to NATS
## WARNING: this loop is infinite if there is no subscriber (such as monitoring).
## Investigate if we can use a counter to limit the number of iterations.
## For now, keep it commented out.
#- LOOP_MAX_ATTEMPTS=180
#- LOOP_COUNTER=0
#- >
# while ! kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server 2>&1 | grep -q 'Subscriber is Ready? True'; do
# echo "Attempt: $LOOP_COUNTER"
# kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server 2>&1;
# sleep 1;
# LOOP_COUNTER=$((LOOP_COUNTER + 1))
# if [ "$LOOP_COUNTER" -ge "$LOOP_MAX_ATTEMPTS" ]; then
# echo "Max attempts reached, exiting the loop."
# break
# fi
# done
- kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server
# Run end-to-end test: onboard scenario
- >
docker run -t --rm --name ${TEST_NAME} --network=host
--volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
--volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
$CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-onboarding.sh
# Run end-to-end test: configure service TFS
- >
docker run -t --rm --name ${TEST_NAME} --network=host
--volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
--volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
$CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-tfs-create.sh
# Dump configuration of the routers (after configure TFS service)
- containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# Run end-to-end test: test connectivity with ping
- export TEST1_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.1.10' --format json)
- echo $TEST1_10
- echo $TEST1_10 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
- export TEST1_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.1.1' --format json)
- echo $TEST1_1
- echo $TEST1_1 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
- export TEST2_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.2.1' --format json)
- echo $TEST2_1
- echo $TEST2_1 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
- export TEST2_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.2.10' --format json)
- echo $TEST2_10
- echo $TEST2_10 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
- export TEST3_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.3.1' --format json)
- echo $TEST3_1
- echo $TEST3_1 | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
- export TEST3_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.3.10' --format json)
- echo $TEST3_10
- echo $TEST3_10 | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
# Run end-to-end test: deconfigure service TFS
- >
docker run -t --rm --name ${TEST_NAME} --network=host
--volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
--volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
$CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-tfs-remove.sh
# Dump configuration of the routers (after deconfigure TFS service)
- containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# Run end-to-end test: configure service IETF
- >
docker run -t --rm --name ${TEST_NAME} --network=host
--volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
--volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
$CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-ietf-create.sh
# Dump configuration of the routers (after configure IETF service)
- containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# Run end-to-end test: test connectivity with ping
- export TEST1_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.1.10' --format json)
- echo $TEST1_10
- echo $TEST1_10 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
- export TEST1_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.1.1' --format json)
- echo $TEST1_1
- echo $TEST1_1 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
- export TEST2_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.2.1' --format json)
- echo $TEST2_1
- echo $TEST2_1 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
- export TEST2_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.2.10' --format json)
- echo $TEST2_10
- echo $TEST2_10 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
- export TEST3_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.3.1' --format json)
- echo $TEST3_1
- echo $TEST3_1 | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
- export TEST3_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.3.10' --format json)
- echo $TEST3_10
- echo $TEST3_10 | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
# Run end-to-end test: deconfigure service IETF
- >
docker run -t --rm --name ${TEST_NAME} --network=host
--volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
--volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
$CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-ietf-remove.sh
# Dump configuration of the routers (after deconfigure IETF service)
- containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# Run end-to-end test: cleanup scenario
- >
docker run -t --rm --name ${TEST_NAME} --network=host
--volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
--volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
$CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-cleanup.sh
after_script:
# Dump configuration of the routers (on after_script)
- containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
- containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# Dump TeraFlowSDN component logs
- source src/tests/${TEST_NAME}/deploy_specs.sh
- kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server
- kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/deviceservice -c server
- kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/pathcompservice -c frontend
- kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/serviceservice -c server
- kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/nbiservice -c server
#- kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/monitoringservice -c server
# Destroy Scenario
- docker rm -f ${TEST_NAME} || true
- RUNNER_PATH=`pwd`
#- cd $PWD/src/tests/${TEST_NAME}
- cd /tmp/clab/${TEST_NAME}
- containerlab destroy --topo ryu-openflow.clab.yml --cleanup || true
- sudo rm -rf clab-ryu-openflow/ .ryu-openflow.clab.yml.bak || true
- cd $RUNNER_PATH
- kubectl delete namespaces tfs || true
# Clean old docker images
- docker images --filter="dangling=true" --quiet | xargs -r docker rmi
#coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
artifacts:
when: always
reports:
junit: ./src/tests/${TEST_NAME}/report_*.xml
## Deploy TeraFlowSDN and Execute end-2-end test
#end2end_test ryu-openflow:
# timeout: 90m
# variables:
# TEST_NAME: 'ryu-openflow'
# stage: end2end_test
# # Disable to force running it after all other tasks
# #needs:
# # - build ryu-openflow
# before_script:
# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# - docker ps -aq | xargs -r docker rm -f
# - containerlab destroy --all --cleanup || true
# script:
# # Download Docker image to run the test
# - docker pull "${CI_REGISTRY_IMAGE}/${TEST_NAME}:latest"
#
# # Check MicroK8s is ready
# - microk8s status --wait-ready
# - kubectl get pods --all-namespaces
#
# # Deploy ContainerLab Scenario
# - RUNNER_PATH=`pwd`
# #- cd $PWD/src/tests/${TEST_NAME}
# - mkdir -p /tmp/clab/${TEST_NAME}
# - cp -R src/tests/${TEST_NAME}/clab/* /tmp/clab/${TEST_NAME}
# - tree -la /tmp/clab/${TEST_NAME}
# - cd /tmp/clab/${TEST_NAME}
# - containerlab deploy --reconfigure --topo ryu-openflow.clab.yml
# - cd $RUNNER_PATH
#
# # Wait for initialization of Device NOSes
# - sleep 3
# - docker ps -a
#
# # Dump configuration of the routers (before any configuration)
# - containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
#
# # Configure TeraFlowSDN deployment
# # Uncomment if DEBUG log level is needed for the components
# #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/contextservice.yaml
# #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/deviceservice.yaml
# #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="frontend").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/pathcompservice.yaml
# #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/serviceservice.yaml
# #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/nbiservice.yaml
# #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/monitoringservice.yaml
#
# - source src/tests/${TEST_NAME}/deploy_specs.sh
# #- export TFS_REGISTRY_IMAGES="${CI_REGISTRY_IMAGE}"
# #- export TFS_SKIP_BUILD="YES"
# #- export TFS_IMAGE_TAG="latest"
# #- echo "TFS_REGISTRY_IMAGES=${CI_REGISTRY_IMAGE}"
#
# # Deploy TeraFlowSDN
# - ./deploy/crdb.sh
# - ./deploy/nats.sh
# - ./deploy/kafka.sh
# - ./deploy/qdb.sh
# - ./deploy/tfs.sh
# - ./deploy/show.sh
#
# ## Wait for Context to be subscribed to NATS
# ## WARNING: this loop is infinite if there is no subscriber (such as monitoring).
# ## Investigate if we can use a counter to limit the number of iterations.
# ## For now, keep it commented out.
# #- LOOP_MAX_ATTEMPTS=180
# #- LOOP_COUNTER=0
# #- >
# # while ! kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server 2>&1 | grep -q 'Subscriber is Ready? True'; do
# # echo "Attempt: $LOOP_COUNTER"
# # kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server 2>&1;
# # sleep 1;
# # LOOP_COUNTER=$((LOOP_COUNTER + 1))
# # if [ "$LOOP_COUNTER" -ge "$LOOP_MAX_ATTEMPTS" ]; then
# # echo "Max attempts reached, exiting the loop."
# # break
# # fi
# # done
# - kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server
#
# # Run end-to-end test: onboard scenario
# - >
# docker run -t --rm --name ${TEST_NAME} --network=host
# --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
# --volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
# $CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-onboarding.sh
#
# # Run end-to-end test: configure service TFS
# - >
# docker run -t --rm --name ${TEST_NAME} --network=host
# --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
# --volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
# $CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-tfs-create.sh
#
# # Dump configuration of the routers (after configure TFS service)
# - containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
#
# # Run end-to-end test: test connectivity with ping
# - export TEST1_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.1.10' --format json)
# - echo $TEST1_10
# - echo $TEST1_10 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
# - export TEST1_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.1.1' --format json)
# - echo $TEST1_1
# - echo $TEST1_1 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
# - export TEST2_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.2.1' --format json)
# - echo $TEST2_1
# - echo $TEST2_1 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
# - export TEST2_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.2.10' --format json)
# - echo $TEST2_10
# - echo $TEST2_10 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
# - export TEST3_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.3.1' --format json)
# - echo $TEST3_1
# - echo $TEST3_1 | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
# - export TEST3_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.3.10' --format json)
# - echo $TEST3_10
# - echo $TEST3_10 | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
#
# # Run end-to-end test: deconfigure service TFS
# - >
# docker run -t --rm --name ${TEST_NAME} --network=host
# --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
# --volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
# $CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-tfs-remove.sh
#
# # Dump configuration of the routers (after deconfigure TFS service)
# - containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
#
# # Run end-to-end test: configure service IETF
# - >
# docker run -t --rm --name ${TEST_NAME} --network=host
# --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
# --volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
# $CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-ietf-create.sh
#
# # Dump configuration of the routers (after configure IETF service)
# - containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
#
# # Run end-to-end test: test connectivity with ping
# - export TEST1_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.1.10' --format json)
# - echo $TEST1_10
# - echo $TEST1_10 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
# - export TEST1_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.1.1' --format json)
# - echo $TEST1_1
# - echo $TEST1_1 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
# - export TEST2_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.2.1' --format json)
# - echo $TEST2_1
# - echo $TEST2_1 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
# - export TEST2_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.2.10' --format json)
# - echo $TEST2_10
# - echo $TEST2_10 | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
# - export TEST3_1=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.3.1' --format json)
# - echo $TEST3_1
# - echo $TEST3_1 | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
# - export TEST3_10=$(containerlab exec --name ryu-openflow --label clab-node-name=dc1 --cmd 'ping -n -c3 172.16.3.10' --format json)
# - echo $TEST3_10
# - echo $TEST3_10 | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
#
# # Run end-to-end test: deconfigure service IETF
# - >
# docker run -t --rm --name ${TEST_NAME} --network=host
# --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
# --volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
# $CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-ietf-remove.sh
#
# # Dump configuration of the routers (after deconfigure IETF service)
# - containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
#
# # Run end-to-end test: cleanup scenario
# - >
# docker run -t --rm --name ${TEST_NAME} --network=host
# --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
# --volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
# $CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-cleanup.sh
#
# after_script:
# # Dump configuration of the routers (on after_script)
# - containerlab exec --name ryu-openflow --label clab-node-name=r1 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r2 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
# - containerlab exec --name ryu-openflow --label clab-node-name=r3 --cmd "Cli --command \"enable"$'\n'$"show running-config\""
#
# # Dump TeraFlowSDN component logs
# - source src/tests/${TEST_NAME}/deploy_specs.sh
# - kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server
# - kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/deviceservice -c server
# - kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/pathcompservice -c frontend
# - kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/serviceservice -c server
# - kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/nbiservice -c server
# #- kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/monitoringservice -c server
#
# # Destroy Scenario
# - docker rm -f ${TEST_NAME} || true
# - RUNNER_PATH=`pwd`
# #- cd $PWD/src/tests/${TEST_NAME}
# - cd /tmp/clab/${TEST_NAME}
# - containerlab destroy --topo ryu-openflow.clab.yml --cleanup || true
# - sudo rm -rf clab-ryu-openflow/ .ryu-openflow.clab.yml.bak || true
# - cd $RUNNER_PATH
# - kubectl delete namespaces tfs || true
#
# # Clean old docker images
# - docker images --filter="dangling=true" --quiet | xargs -r docker rmi
#
# #coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
# rules:
# - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
# artifacts:
# when: always
# reports:
# junit: ./src/tests/${TEST_NAME}/report_*.xml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment