Commit 635efe54 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

CI/CD tests:

- Disable all unitary tests
- Disable all end-to-end tests but RyuOpenFlow
parent 5f3f7d28
Loading
Loading
Loading
Loading
+33 −33
Original line number Diff line number Diff line
@@ -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'
+12 −12
Original line number Diff line number Diff line
@@ -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'
+48 −94
Original line number Diff line number Diff line
@@ -56,27 +56,29 @@ build ryu-openflow:
#      asgamb1/oc23bgp.img:latest /confd/examples.confd/OC23/startNetconfAgent.sh


## 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
# Deploy TeraFlowSDN and Execute end-2-end test
end2end_test ryu-openflow:
  timeout: 90m
  variables:
    TEST_NAME: 'ryu-openflow'
     IMAGE_TAG: 'mr$CI_MERGE_REQUEST_IID'
  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
#
    # cleanup mininet
  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}
@@ -86,16 +88,15 @@ build ryu-openflow:
#    - cd /tmp/clab/${TEST_NAME}
#    - containerlab deploy --reconfigure --topo ryu-openflow.clab.yml
#    - cd $RUNNER_PATH
#

# deploy ryu

# deploy mininet

#    # 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
@@ -145,49 +146,7 @@ build ryu-openflow:
#      --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\""
#    # Dump configuration of the switches (OpenFlow rules configured) (before configure IETF service)
#
#    # Run end-to-end test: configure service IETF
#    - >
@@ -196,10 +155,7 @@ build ryu-openflow:
#      --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\""
#    # Dump configuration of the switches (OpenFlow rules configured) (after configure IETF service)
#
#    # 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)
@@ -228,10 +184,7 @@ build ryu-openflow:
#      --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\""
#    # Dump configuration of the switches (OpenFlow rules configured) (after deconfigure IETF service)
#
#    # Run end-to-end test: cleanup scenario
#    - >
@@ -241,10 +194,7 @@ build ryu-openflow:
#      $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 configuration of the switches (OpenFlow rules configured) (on after_script)
#
#    # Dump TeraFlowSDN component logs
#    - source src/tests/${TEST_NAME}/deploy_specs.sh
@@ -262,17 +212,21 @@ build ryu-openflow:
#    - 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

# destroy ryu
# destroy mininet

#    - 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

    # 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