From fddd2ca91a0659946aeecaa0922d292b8e1f1734 Mon Sep 17 00:00:00 2001
From: Cédric Ollivier <cedric.ollivier@orange.com>
Date: Sun, 21 Oct 2018 11:30:25 +0200
Subject: Run Functest hunter containers if Apex Rocky
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It replaces Queens logics as it should be useless since new gambia
jjbs have been created.

From the time being, Apex jjbs run master containers which should
work thanks to backward compatibility but vnfs are falsy skipped.
[1].

It updates verify-jobs to run the right container (hunter in case of
rocky).

[1] https://build.opnfv.org/ci/view/functest/job/functest-apex-baremetal-daily-master/373/console

Change-Id: I0df483eb78092e8155dd288d3c86d10b7762e433
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
---
 jjb/apex/apex-verify-jobs.yaml | 11 +++++++++++
 jjb/apex/apex.yaml             | 15 +++++++++------
 jjb/apex/apex.yaml.j2          | 15 +++++++++------
 3 files changed, 29 insertions(+), 12 deletions(-)

(limited to 'jjb')

diff --git a/jjb/apex/apex-verify-jobs.yaml b/jjb/apex/apex-verify-jobs.yaml
index 805fb7246..fb52fa1d9 100644
--- a/jjb/apex/apex-verify-jobs.yaml
+++ b/jjb/apex/apex-verify-jobs.yaml
@@ -353,6 +353,16 @@
               kill-phase-on: FAILURE
               abort-all-job: true
               git-revision: true
+      - shell: |
+          features=$(echo $DEPLOY_SCENARIO | sed -r -n 's/os-.+-(.+)-(noha|ha)/\1/p')
+          if [ "$features" == 'rocky' ]; then
+            echo "DOCKER_TAG=hunter" > functest_tag
+          elif [[ "$features" =~ 'rocky' ]]; then
+            echo "DOCKER_TAG=hunter" > functest_tag
+          fi
+      - inject:
+          properties-file: functest_tag
+          override-build-parameters: true
       - multijob:
           name: functest-smoke
           condition: ALWAYS
@@ -361,6 +371,7 @@
               current-parameters: false
               predefined-parameters: |
                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
+                DOCKER_TAG=$DOCKER_TAG
                 FUNCTEST_SUITE_NAME=tempest_smoke
                 FUNCTEST_MODE=testcase
                 GERRIT_BRANCH=$GERRIT_BRANCH
diff --git a/jjb/apex/apex.yaml b/jjb/apex/apex.yaml
index aa9ec2c81..564417c23 100644
--- a/jjb/apex/apex.yaml
+++ b/jjb/apex/apex.yaml
@@ -578,14 +578,16 @@
               git-revision: false
       - shell: |
           features=$(echo $DEPLOY_SCENARIO | sed -r -n 's/os-.+-(.+)-(noha|ha)/\1/p')
-          if [ "$features" == 'queens' ]; then
-            functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-queens-(noha|ha)/\1-nofeature-\2/p')
-          elif [[ "$features" =~ 'queens' ]]; then
-            functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-(.+)_queens-(noha|ha)/\1-\2-\3/p')
+          if [ "$features" == 'rocky' ]; then
+            functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-rocky-(noha|ha)/\1-nofeature-\2/p')
+            echo "DOCKER_TAG=hunter" > functest_scenario
+          elif [[ "$features" =~ 'rocky' ]]; then
+            functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-(.+)_rocky-(noha|ha)/\1-\2-\3/p')
+            echo "DOCKER_TAG=hunter" > functest_scenario
           else
             functest_scenario=$DEPLOY_SCENARIO
           fi
-          echo "DEPLOY_SCENARIO=$functest_scenario" > functest_scenario
+          echo "DEPLOY_SCENARIO=$functest_scenario" >> functest_scenario
       - inject:
           properties-file: functest_scenario
           override-build-parameters: true
@@ -596,8 +598,9 @@
             - name: 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
               node-parameters: true
               current-parameters: false
-              predefined-parameters:
+              predefined-parameters: |
                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
+                DOCKER_TAG=$DOCKER_TAG
               kill-phase-on: NEVER
               abort-all-job: true
               git-revision: false
diff --git a/jjb/apex/apex.yaml.j2 b/jjb/apex/apex.yaml.j2
index bd8e98abf..ec735534f 100644
--- a/jjb/apex/apex.yaml.j2
+++ b/jjb/apex/apex.yaml.j2
@@ -424,14 +424,16 @@
               git-revision: false
       - shell: |
           features=$(echo $DEPLOY_SCENARIO | sed -r -n 's/os-.+-(.+)-(noha|ha)/\1/p')
-          if [ "$features" == 'queens' ]; then
-            functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-queens-(noha|ha)/\1-nofeature-\2/p')
-          elif [[ "$features" =~ 'queens' ]]; then
-            functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-(.+)_queens-(noha|ha)/\1-\2-\3/p')
+          if [ "$features" == 'rocky' ]; then
+            functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-rocky-(noha|ha)/\1-nofeature-\2/p')
+            echo "DOCKER_TAG=hunter" > functest_scenario
+          elif [[ "$features" =~ 'rocky' ]]; then
+            functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-(.+)_rocky-(noha|ha)/\1-\2-\3/p')
+            echo "DOCKER_TAG=hunter" > functest_scenario
           else
             functest_scenario=$DEPLOY_SCENARIO
           fi
-          echo "DEPLOY_SCENARIO=$functest_scenario" > functest_scenario
+          echo "DEPLOY_SCENARIO=$functest_scenario" >> functest_scenario
       - inject:
           properties-file: functest_scenario
           override-build-parameters: true
@@ -442,8 +444,9 @@
             - name: 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
               node-parameters: true
               current-parameters: false
-              predefined-parameters:
+              predefined-parameters: |
                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
+                DOCKER_TAG=$DOCKER_TAG
               kill-phase-on: NEVER
               abort-all-job: true
               git-revision: false
-- 
cgit