Fix grype location
[releng.git] / jjb / functest / functest.yaml
index 09494e7..9e91d8e 100644 (file)
     tag:
       - latest:
           from:
-          buildargs:
+          build_args:
           branch: master
           slave: lf-pod4-2
           DASHBOARD_URL: http://172.30.12.85
-          dependency: 3.13
+          dependency: 3.14
+      - xena:
+          from:
+          build_args:
+          branch: stable/xena
+          slave: lf-pod4-2
+          DASHBOARD_URL: http://172.30.12.85
+          dependency: 3.14
       - wallaby:
           from:
-          buildargs:
+          build_args:
           branch: stable/wallaby
           slave: lf-virtual6
           DASHBOARD_URL: http://172.30.13.91
           dependency: 3.13
       - leguer:
           from:
-          buildargs:
+          build_args:
           branch: stable/leguer
           slave: lf-virtual9
           DASHBOARD_URL: http://172.30.13.94
           dependency: 3.12
       - kali:
           from:
-          buildargs:
+          build_args:
           branch: stable/kali
           slave: lf-pod4-3
           DASHBOARD_URL: http://172.30.12.88
           dependency: 3.11
       - jerma:
           from:
-          buildargs:
+          build_args:
           branch: stable/jerma
           slave: lf-pod4
           DASHBOARD_URL: http://172.30.12.83
@@ -90,6 +97,8 @@
     <<: *functest-containers
     test: '{test}'
     privileged: '{privileged}'
+    volumes: '{volumes}'
+    env: '{env}'
     network: '{network}'
     DASHBOARD_URL: '{DASHBOARD_URL}'
 
     builders:
       - shell: |
           set +x
+          volumes=;
+          if [ "{volumes}" != "None" ]; then
+            for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
+              do volumes="-v $i $volumes"; done
+          fi
+          env=;
+          if [ "{env}" != "None" ]; then
+            for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
+              do env="-e $i $env"; done
+          fi
           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
           if [ "{repo}" = "_" ]; then
             image={container}:{tag}
           sudo docker run --rm \
             --privileged={privileged} \
             --network={network} \
+            $volumes \
+            $env \
             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
             -e S3_DST_URL=s3://artifacts.opnfv.org/functest/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
             -e HTTP_DST_URL=http://artifacts.opnfv.org/functest/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
             -e NODE_NAME=$slave \
             -e BUILD_TAG=$BUILD_TAG \
             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
-            -e EXTERNAL_NETWORK=$EXTERNAL_NETWORK \
-            -e VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME \
-            -e IMAGE_PROPERTIES=$IMAGE_PROPERTIES \
             -e DASHBOARD_URL={DASHBOARD_URL} \
-            -v /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file \
-            -v /home/opnfv/functest/images:/home/opnfv/functest/images \
             $image run_tests -t {test} -p -r
 
 - builder:
       - 'functest-{repo}-{container}-{tag}-rmi'
 
 - job-template:
-    name: 'functest-{repo}-{container}-{tag}-{test}-run'
+    name: 'functest-opnfv-functest-healthcheck-{tag}-{test}-run'
     parameters:
       - functest-slave:
           slave: '{slave}'
 - project:
     name: 'functest-opnfv-functest-healthcheck'
     <<: *functest-params
+    volumes:
+      - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
+      - /home/opnfv/functest/images:/home/opnfv/functest/images
+    env:
+      - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
+      - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
+      - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
     container: 'functest-healthcheck'
     test:
       - connection_check
     privileged: 'false'
     network: bridge
     jobs:
-      - 'functest-{repo}-{container}-{tag}-{test}-run'
+      - 'functest-opnfv-functest-healthcheck-{tag}-{test}-run'
+
+- job-template:
+    name: 'functest-opnfv-functest-smoke-{tag}-{test}-run'
+    parameters:
+      - functest-slave:
+          slave: '{slave}'
+      - functest-build_tag:
+          build_tag: ''
+      - functest-EXTERNAL_NETWORK:
+          EXTERNAL_NETWORK: public
+      - functest-VOLUME_DEVICE_NAME:
+          VOLUME_DEVICE_NAME: sdb
+      - functest-IMAGE_PROPERTIES:
+          IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
+    builders:
+      - functest-run-containers:
+          <<: *functest-run-containers
 
 - project:
     name: 'functest-opnfv-functest-smoke'
     <<: *functest-params
+    volumes:
+      - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
+      - /home/opnfv/functest/images:/home/opnfv/functest/images
+    env:
+      - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
+      - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
+      - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
     container: 'functest-smoke'
     test:
       - tempest_neutron
         test: networking-sfc
       - tag: latest
         test: patrole
+      - tag: xena
+        test: refstack_defcore
+      - tag: xena
+        test: networking-bgpvpn
+      - tag: xena
+        test: networking-sfc
+      - tag: xena
+        test: patrole
       - tag: wallaby
         test: refstack_defcore
       - tag: wallaby
       - tag: jerma
         test: tempest_cyborg
     jobs:
-      - 'functest-{repo}-{container}-{tag}-{test}-run'
+      - 'functest-opnfv-functest-smoke-{tag}-{test}-run'
+
+- job-template:
+    name: 'functest-opnfv-functest-smoke-cntt-{tag}-{test}-run'
+    parameters:
+      - functest-slave:
+          slave: '{slave}'
+      - functest-build_tag:
+          build_tag: ''
+      - functest-EXTERNAL_NETWORK:
+          EXTERNAL_NETWORK: public
+      - functest-VOLUME_DEVICE_NAME:
+          VOLUME_DEVICE_NAME: sdb
+      - functest-IMAGE_PROPERTIES:
+          IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
+    builders:
+      - functest-run-containers:
+          <<: *functest-run-containers
 
 - project:
     name: 'functest-opnfv-functest-smoke-cntt'
     <<: *functest-params
+    volumes:
+      - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
+      - /home/opnfv/functest/images:/home/opnfv/functest/images
+    env:
+      - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
+      - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
+      - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
     container: 'functest-smoke-cntt'
     test:
       - tempest_neutron_cntt
     privileged: 'false'
     network: bridge
     jobs:
-      - 'functest-{repo}-{container}-{tag}-{test}-run'
+      - 'functest-opnfv-functest-smoke-cntt-{tag}-{test}-run'
+
+- job-template:
+    name: 'functest-opnfv-functest-benchmarking-{tag}-{test}-run'
+    parameters:
+      - functest-slave:
+          slave: '{slave}'
+      - functest-build_tag:
+          build_tag: ''
+      - functest-EXTERNAL_NETWORK:
+          EXTERNAL_NETWORK: public
+      - functest-VOLUME_DEVICE_NAME:
+          VOLUME_DEVICE_NAME: sdb
+      - functest-IMAGE_PROPERTIES:
+          IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
+    builders:
+      - functest-run-containers:
+          <<: *functest-run-containers
 
 - project:
     name: 'functest-opnfv-functest-benchmarking'
     <<: *functest-params
+    volumes:
+      - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
+      - /home/opnfv/functest/images:/home/opnfv/functest/images
+    env:
+      - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
+      - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
+      - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
     container: 'functest-benchmarking'
     test:
       - rally_full
     privileged: 'false'
     network: bridge
     jobs:
-      - 'functest-{repo}-{container}-{tag}-{test}-run'
+      - 'functest-opnfv-functest-benchmarking-{tag}-{test}-run'
+
+- job-template:
+    name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-{test}-run'
+    parameters:
+      - functest-slave:
+          slave: '{slave}'
+      - functest-build_tag:
+          build_tag: ''
+      - functest-EXTERNAL_NETWORK:
+          EXTERNAL_NETWORK: public
+      - functest-VOLUME_DEVICE_NAME:
+          VOLUME_DEVICE_NAME: sdb
+      - functest-IMAGE_PROPERTIES:
+          IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
+    builders:
+      - functest-run-containers:
+          <<: *functest-run-containers
 
 - project:
     name: 'functest-opnfv-functest-benchmarking-cntt'
     <<: *functest-params
+    volumes:
+      - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
+      - /home/opnfv/functest/images:/home/opnfv/functest/images
+    env:
+      - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
+      - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
+      - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
     container: 'functest-benchmarking-cntt'
     test:
       - rally_full_cntt
     privileged: 'false'
     network: bridge
     jobs:
-      - 'functest-{repo}-{container}-{tag}-{test}-run'
+      - 'functest-opnfv-functest-benchmarking-cntt-{tag}-{test}-run'
+
+- job-template:
+    name: 'functest-opnfv-functest-vnf-{tag}-{test}-run'
+    parameters:
+      - functest-slave:
+          slave: '{slave}'
+      - functest-build_tag:
+          build_tag: ''
+      - functest-EXTERNAL_NETWORK:
+          EXTERNAL_NETWORK: public
+      - functest-VOLUME_DEVICE_NAME:
+          VOLUME_DEVICE_NAME: sdb
+      - functest-IMAGE_PROPERTIES:
+          IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
+    builders:
+      - functest-run-containers:
+          <<: *functest-run-containers
 
 - project:
     name: 'functest-opnfv-functest-vnf'
     <<: *functest-params
+    volumes:
+      - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
+      - /home/opnfv/functest/images:/home/opnfv/functest/images
+    env:
+      - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
+      - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
+      - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
     container: 'functest-vnf'
     test:
       - cloudify
     privileged: 'false'
     network: bridge
     jobs:
-      - 'functest-{repo}-{container}-{tag}-{test}-run'
+      - 'functest-opnfv-functest-vnf-{tag}-{test}-run'
 
 - builder:
     name: functest-zip
     builders:
       - shell: |
           set +x
+          volumes=;
+          if [ "{volumes}" != "None" ]; then
+            for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
+              do volumes="-v $i $volumes"; done
+          fi
+          env=;
+          if [ "{env}" != "None" ]; then
+            for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
+              do env="-e $i $env"; done
+          fi
           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
           if [ "{repo}" = "_" ]; then
             image={container}:{tag}
             image={repo}:{port}/{container}:{tag}
           fi
           sudo docker run --rm \
+            $volumes \
+            $env \
             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
             -e S3_DST_URL=s3://artifacts.opnfv.org/functest \
             -e HTTP_DST_URL=http://artifacts.opnfv.org/functest \
             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
             -e BUILD_TAG=$BUILD_TAG \
             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
-            -e EXTERNAL_NETWORK=$EXTERNAL_NETWORK \
-            -e VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME \
-            -e IMAGE_PROPERTIES=$IMAGE_PROPERTIES \
-            -v /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file \
-            -v /home/opnfv/functest/images:/home/opnfv/functest/images \
             $image zip_campaign
 
 - job-template:
     builders:
       - functest-zip:
           <<: *functest-containers
+          volumes: '{volumes}'
+          env: '{env}'
 
 - project:
     name: 'functest-{tag}-zip'
     <<: *functest-params
+    volumes:
+      - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
+      - /home/opnfv/functest/images:/home/opnfv/functest/images
+    env:
+      - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
+      - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
+      - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
     container: 'functest-healthcheck'
     jobs:
       - 'functest-{tag}-zip'
           projects:
             - name: 'functest-{tag}-zip'
               <<: *functest-jobs
+    publishers:
+      - email-ext:
+          failure: false
+          first-failure: true
+          fixed: true
+          recipients: cedric.ollivier@orange.com
 
 - project:
     name: 'functest-daily'
     <<: *functest-containers
     ref_arg: '{ref_arg}'
     path: '{path}'
-    buildargs: '{buildargs}'
+    build_args: '{build_args}'
     from: '{from}'
 
 - builder:
             image={repo}:{port}/{container}:{tag}
           fi
           build_args=""
-          if [ "{buildargs}" != "None" ]; then
-            build_args="{buildargs}"
+          if [ "{build_args}" != "None" ]; then
+            for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
+              do build_args="--build-arg $i $build_args"; done
           fi
           if [ "{ref_arg}" != "None" ]; then
             build_args="$build_args --build-arg {ref_arg}={ref}"
     builders:
       - shell: |
           set +x
-          sudo apt-get update && sudo apt-get install \
-            software-properties-common gpg -y
+          sudo apt-get -o DPkg::Lock::Timeout=300 update && \
+          sudo DEBIAN_FRONTEND=noninteractive apt-get \
+            -o DPkg::Lock::Timeout=300 dist-upgrade -y
+          sudo DEBIAN_FRONTEND=noninteractive \
+          apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
           sudo add-apt-repository -y ppa:deadsnakes/ppa
-          sudo apt-get update && sudo apt-get install python3.8 \
-            python3.8-dev python3.8-distutils \
+          sudo apt-get -o DPkg::Lock::Timeout=300 update && \
+          sudo DEBIAN_FRONTEND=noninteractive apt-get \
+            -o DPkg::Lock::Timeout=300 install \
+            python3.9 python3.9-dev python3.9-distutils \
+            python3.8 python3.8-dev python3.8-distutils \
             python3.7 python3.7-dev python3.6 python3.6-dev \
             python python-dev python3-pip enchant -y
           sudo pip3 install tox tox-pip-version
       - functest-build-containers:
           <<: *functest-build-containers
           ref: $GERRIT_REFSPEC
-          buildargs: '{buildargs}'
+          build_args: '{build_args}'
 
 - project:
     name: functest-opnfv-functest-core-{tag}-gate
     path: docker/tempest
     exclude:
       - {'tag': 'latest'}
+      - {'tag': 'xena'}
       - {'tag': 'wallaby'}
       - {'tag': 'leguer'}
       - {'tag': 'kali'}
               <<: *functest-jobs
             - name: 'functest-opnfv-functest-vnf-{tag}-juju_epc-run'
               <<: *functest-jobs
+    publishers:
+      - email-ext:
+          failure: false
+          first-failure: true
+          fixed: true
+          recipients: cedric.ollivier@orange.com
 
 - project:
     name: 'functest-review'
       - functest-build-containers:
           <<: *functest-build-containers
           ref: '{branch}'
-          buildargs: '{buildargs}'
+          build_args: '{build_args}'
       - functest-push-containers:
           <<: *functest-build-containers
           ref: '{branch}'
     path: docker/tempest
     exclude:
       - {'tag': 'latest'}
+      - {'tag': 'xena'}
       - {'tag': 'wallaby'}
       - {'tag': 'leguer'}
       - {'tag': 'kali'}
               <<: *functest-jobs
             - name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-build'
               <<: *functest-jobs
+    publishers:
+      - email-ext:
+          failure: false
+          first-failure: true
+          fixed: true
+          recipients: cedric.ollivier@orange.com
 
 - builder:
     name: functest-trivy
     builders:
       - shell: |
-          sudo apt-get update && sudo apt-get install curl -y
+          sudo apt-get -o DPkg::Lock::Timeout=300 update && \
+          sudo DEBIAN_FRONTEND=noninteractive apt-get \
+            -o DPkg::Lock::Timeout=300 install curl -y
 
           curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
           if [ "{repo}" = "_" ]; then
     builders:
       - functest-trivy:
           <<: *functest-containers
+    publishers:
+      - email-ext:
+          failure: false
+          first-failure: true
+          fixed: true
+          recipients: cedric.ollivier@orange.com
 
 - project:
     name: 'functest-opnfv-functest-core-trivy'
     jobs:
       - 'functest-{repo}-{container}-{tag}-trivy'
 
+- builder:
+    name: functest-grype
+    builders:
+      - shell: |
+          sudo apt-get -o DPkg::Lock::Timeout=300 update && \
+          sudo DEBIAN_FRONTEND=noninteractive apt-get \
+            -o DPkg::Lock::Timeout=300 install curl -y
+
+          curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
+          if [ "{repo}" = "_" ]; then
+            image={container}:{tag}
+          elif [ "{port}" = "None" ]; then
+            image={repo}/{container}:{tag}
+          else
+            image={repo}:{port}/{container}:{tag}
+          fi
+          ./grype -q $image
+
+- job-template:
+    name: 'functest-{repo}-{container}-{tag}-grype'
+    triggers:
+      - timed: '@weekly'
+    parameters:
+      - functest-slave:
+          slave: '{slave}'
+    builders:
+      - functest-grype:
+          <<: *functest-containers
+    publishers:
+      - email-ext:
+          failure: false
+          first-failure: true
+          fixed: true
+          recipients: cedric.ollivier@orange.com
+
+- project:
+    name: 'functest-opnfv-functest-core-grype'
+    <<: *functest-params
+    container: 'functest-core'
+    jobs:
+      - 'functest-{repo}-{container}-{tag}-grype'
+
+- project:
+    name: 'functest-opnfv-functest-tempest-grype'
+    <<: *functest-params
+    container: 'functest-tempest'
+    jobs:
+      - 'functest-{repo}-{container}-{tag}-grype'
+
+- project:
+    name: 'functest-opnfv-functest-healthcheck-grype'
+    <<: *functest-params
+    container: 'functest-healthcheck'
+    jobs:
+      - 'functest-{repo}-{container}-{tag}-grype'
+
+- project:
+    name: 'functest-opnfv-functest-smoke-grype'
+    <<: *functest-params
+    container: 'functest-smoke'
+    jobs:
+      - 'functest-{repo}-{container}-{tag}-grype'
+
+- project:
+    name: 'functest-opnfv-functest-benchmarking-grype'
+    <<: *functest-params
+    container: 'functest-benchmarking'
+    jobs:
+      - 'functest-{repo}-{container}-{tag}-grype'
+
+- project:
+    name: 'functest-opnfv-functest-vnf-grype'
+    <<: *functest-params
+    container: 'functest-vnf'
+    jobs:
+      - 'functest-{repo}-{container}-{tag}-grype'
+
+- project:
+    name: 'functest-opnfv-functest-smoke-cntt-grype'
+    <<: *functest-params
+    container: 'functest-smoke-cntt'
+    jobs:
+      - 'functest-{repo}-{container}-{tag}-grype'
+
+- project:
+    name: 'functest-opnfv-functest-benchmarking-cntt-grype'
+    <<: *functest-params
+    container: 'functest-benchmarking-cntt'
+    jobs:
+      - 'functest-{repo}-{container}-{tag}-grype'
+
 - project:
     name: 'functest'
     <<: *functest-params
       - last-failure
       - last-duration
     regex: (?!functest-kubernetes)(?!functest-pi)^functest-[a-z-0-9.]+-trivy$
+
+- view:
+    name: functest-grype
+    view-type: list
+    columns:
+      - status
+      - weather
+      - job
+      - last-success
+      - last-failure
+      - last-duration
+    regex: (?!functest-kubernetes)(?!functest-pi)^functest-[a-z-0-9.]+-grype$