VOL-2000 Add sanity-test on voltha-helm-chart patchsets

Change-Id: I1690d6b084ca4b7615fce42b5647daea2aa9213b
diff --git a/jjb/pipeline/voltha-bbsim-tests.groovy b/jjb/pipeline/voltha-bbsim-tests.groovy
index ba36b66..5575c8d 100644
--- a/jjb/pipeline/voltha-bbsim-tests.groovy
+++ b/jjb/pipeline/voltha-bbsim-tests.groovy
@@ -67,6 +67,7 @@
     }
 
     stage('Build Images') {
+      when { expression { return params.buildImages } }
       steps {
         sh """
            cd $WORKSPACE/voltha/${gerritProject}/
@@ -76,6 +77,7 @@
     }
 
     stage('Push Images') {
+      when { expression { return params.buildImages } }
       steps {
         sh '''
            export GOROOT=/usr/local/go
@@ -91,7 +93,7 @@
     }
     stage('Deploy Voltha') {
       steps {
-        sh """
+        sh '''
            HELM_FLAG="--set defaults.image_tag=voltha-2.1 "
 
            if [ "${gerritProject}" = "voltha-go" ]; then
@@ -114,10 +116,19 @@
              HELM_FLAG+="--set images.afrouter.tag=citest,images.afrouter.pullPolicy=Never,images.afrouterd.tag=citest,images.afrouterd.pullPolicy=Never"
            fi
 
-           cd kind-voltha/
+           if [ "${gerritProject}" = "voltha-helm-charts" ]; then
+             export VOLTHA_CHART=$WORKSPACE/voltha/voltha
+             export VOLTHA_ADAPTER_OPEN_OLT_CHART=$WORKSPACE/voltha/voltha-adapter-openolt
+             export VOLTHA_ADAPTER_OPEN_ONU_CHART=$WORKSPACE/voltha/voltha-adapter-openonu
+             helm dep update \$VOLTHA_CHART
+             helm dep update \$VOLTHA_ADAPTER_OPEN_OLT_CHART
+             helm dep update \$VOLTHA_ADAPTER_OPEN_ONU_CHART
+           fi
+
+           cd $WORKSPACE/kind-voltha/
            echo \$HELM_FLAG
            EXTRA_HELM_FLAGS=\$HELM_FLAG VOLTHA_LOG_LEVEL=DEBUG TYPE=minimal WITH_RADIUS=y WITH_BBSIM=y INSTALL_ONOS_APPS=y CONFIG_SADIS=y FANCY=0 ./voltha up
-           """
+           '''
       }
     }
 
@@ -187,3 +198,4 @@
     }
   }
 }
+
diff --git a/jjb/verify/voltha-api-server.yaml b/jjb/verify/voltha-api-server.yaml
index 9ce9713..6532fda 100644
--- a/jjb/verify/voltha-api-server.yaml
+++ b/jjb/verify/voltha-api-server.yaml
@@ -10,7 +10,7 @@
           branch-regexp: '{all-branches-regexp}'
       - 'publish-voltha-api-server-jobs':
           branch-regexp: '{all-branches-regexp}'
-      - 'voltha-go-system-tests':
+      - 'voltha-api-server-system-tests':
           branch-regexp: '{all-branches-regexp}'
 
 - job-group:
@@ -38,4 +38,5 @@
     name: 'voltha-api-server-system-tests'
     jobs:
       - 'voltha-patch-test':
-         pipeline: 'voltha-bbsim-tests.groovy'
+          buildImages: true
+          pipeline: 'voltha-bbsim-tests.groovy'
diff --git a/jjb/verify/voltha-bbsim.yaml b/jjb/verify/voltha-bbsim.yaml
index 4ef56b4..00a2d59 100644
--- a/jjb/verify/voltha-bbsim.yaml
+++ b/jjb/verify/voltha-bbsim.yaml
@@ -23,7 +23,8 @@
           junit-allow-empty-results: true
           build-node: 'ubuntu16.04-basebuild-1c-2g'
       - 'voltha-patch-test':
-         pipeline: 'voltha-bbsim-tests.groovy'
+          buildImages: true
+          pipeline: 'voltha-bbsim-tests.groovy'
 
 - job-group:
     name: 'publish-voltha-bbsim-jobs'
diff --git a/jjb/verify/voltha-go.yaml b/jjb/verify/voltha-go.yaml
index 42a2c6d..c0feae2 100644
--- a/jjb/verify/voltha-go.yaml
+++ b/jjb/verify/voltha-go.yaml
@@ -44,4 +44,5 @@
     name: 'voltha-go-system-tests'
     jobs:
       - 'voltha-patch-test':
-         pipeline: 'voltha-bbsim-tests.groovy'
+          buildImages: true
+          pipeline: 'voltha-bbsim-tests.groovy'
diff --git a/jjb/verify/voltha-helm-charts.yaml b/jjb/verify/voltha-helm-charts.yaml
index 50b1399..c1f8b17 100644
--- a/jjb/verify/voltha-helm-charts.yaml
+++ b/jjb/verify/voltha-helm-charts.yaml
@@ -17,4 +17,7 @@
           dependency-jobs: 'verify_voltha-helm-charts_licensed'
       - 'verify-helm-lint':
           dependency-jobs: 'verify_voltha-helm-charts_tag-collision'
+      - 'voltha-patch-test':
+          buildImages: false
+          pipeline: 'voltha-bbsim-tests.groovy'
 
diff --git a/jjb/verify/voltha-openolt-adapter.yaml b/jjb/verify/voltha-openolt-adapter.yaml
index 3f9790d..64be69c 100644
--- a/jjb/verify/voltha-openolt-adapter.yaml
+++ b/jjb/verify/voltha-openolt-adapter.yaml
@@ -45,4 +45,5 @@
     name: 'voltha-openolt-adapter-system-tests'
     jobs:
       - 'voltha-patch-test':
-         pipeline: 'voltha-bbsim-tests.groovy'
+          buildImages: true
+          pipeline: 'voltha-bbsim-tests.groovy'
diff --git a/jjb/verify/voltha-openonu-adapter.yaml b/jjb/verify/voltha-openonu-adapter.yaml
index 8c41c58..e504dfa 100644
--- a/jjb/verify/voltha-openonu-adapter.yaml
+++ b/jjb/verify/voltha-openonu-adapter.yaml
@@ -37,4 +37,5 @@
     name: 'voltha-openonu-adapter-system-tests'
     jobs:
       - 'voltha-patch-test':
-         pipeline: 'voltha-bbsim-tests.groovy'
+          buildImages: true
+          pipeline: 'voltha-bbsim-tests.groovy'
diff --git a/jjb/voltha-e2e.yaml b/jjb/voltha-e2e.yaml
index 34e39c9..253ad0c 100644
--- a/jjb/voltha-e2e.yaml
+++ b/jjb/voltha-e2e.yaml
@@ -205,6 +205,11 @@
           default: '-e notready'
           description: 'test tags'
 
+      - bool:
+         name: buildImages
+         default: {buildImages}
+         description: 'Build modified voltha components'
+
     project-type: pipeline
     concurrent: true