Merge "Support different build targets for different repos"
diff --git a/jjb/pipeline/voltha-nightly-tests-bbsim.groovy b/jjb/pipeline/voltha-nightly-tests-bbsim.groovy
index b2727af..9cd5f16 100644
--- a/jjb/pipeline/voltha-nightly-tests-bbsim.groovy
+++ b/jjb/pipeline/voltha-nightly-tests-bbsim.groovy
@@ -23,7 +23,7 @@
     label "${params.buildNode}"
   }
   options {
-      timeout(time: 190, unit: 'MINUTES')
+      timeout(time: 240, unit: 'MINUTES')
   }
   environment {
     KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
diff --git a/jjb/pipeline/voltha-openonu-go-test-bbsim.groovy b/jjb/pipeline/voltha-openonu-go-test-bbsim.groovy
index 7a1ab22..e3129b8 100755
--- a/jjb/pipeline/voltha-openonu-go-test-bbsim.groovy
+++ b/jjb/pipeline/voltha-openonu-go-test-bbsim.groovy
@@ -119,7 +119,7 @@
 
           mkdir -p $ROBOT_LOGS_DIR/1t1gem
           export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
-          export NAME=voltha_voltha
+          export KVSTOREPREFIX=voltha_voltha
 
           make -C $WORKSPACE/voltha-system-tests ${makeTarget} || true
 
@@ -145,7 +145,6 @@
       steps {
         sh '''
           cd $WORKSPACE/kind-voltha/
-          #source $NAME-env.sh
           WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
 
           export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
@@ -158,7 +157,7 @@
 
           mkdir -p $ROBOT_LOGS_DIR/1t4gem
           export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
-          export NAME=voltha_voltha
+          export KVSTOREPREFIX=voltha_voltha
 
           make -C $WORKSPACE/voltha-system-tests ${make1t4gemTestTarget} || true
 
@@ -184,7 +183,6 @@
       steps {
         sh '''
           cd $WORKSPACE/kind-voltha/
-          #source $NAME-env.sh
           WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
 
           export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
@@ -197,7 +195,7 @@
 
           mkdir -p $ROBOT_LOGS_DIR/1t8gem
           export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
-          export NAME=voltha_voltha
+          export KVSTOREPREFIX=voltha_voltha
 
           make -C $WORKSPACE/voltha-system-tests ${make1t8gemTestTarget} || true
 
@@ -224,7 +222,6 @@
       steps {
         sh '''
            cd $WORKSPACE/kind-voltha/
-           #source $NAME-env.sh
            WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
 
            export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
@@ -266,7 +263,6 @@
       steps {
         sh '''
            cd $WORKSPACE/kind-voltha/
-           #source $NAME-env.sh
            WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
 
            export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
diff --git a/jjb/pipeline/voltha-openonu-go-tests.groovy b/jjb/pipeline/voltha-openonu-go-tests.groovy
index e86d61f..d810638 100755
--- a/jjb/pipeline/voltha-openonu-go-tests.groovy
+++ b/jjb/pipeline/voltha-openonu-go-tests.groovy
@@ -202,7 +202,6 @@
       steps {
         sh '''
           cd $WORKSPACE/kind-voltha/
-          #source $NAME-env.sh
           WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
 
           export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
@@ -231,7 +230,7 @@
           export TARGET_1T8GEM=1t8gem-openonu-go-adapter-test
 
           if [ "${branch}" != "voltha-2.6" ]; then
-            export NAME=voltha_voltha
+            export KVSTOREPREFIX=voltha_voltha
           fi
 
           make -C $WORKSPACE/voltha-system-tests \$TARGET_1T8GEM || true
@@ -258,7 +257,6 @@
       steps {
         sh '''
            cd $WORKSPACE/kind-voltha/
-           #source $NAME-env.sh
            WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
 
            export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
diff --git a/jjb/pipeline/voltha-scale-multi-stack.groovy b/jjb/pipeline/voltha-scale-multi-stack.groovy
index 22b1549..5a56f29 100644
--- a/jjb/pipeline/voltha-scale-multi-stack.groovy
+++ b/jjb/pipeline/voltha-scale-multi-stack.groovy
@@ -255,12 +255,6 @@
             sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.olt
           fi
 
-          if [ ${withMibTemplate} = true ] ; then
-            rm -f BBSM-12345123451234512345-00000000000001-v1.json
-            wget https://raw.githubusercontent.com/opencord/voltha-openonu-adapter/master/templates/BBSM-12345123451234512345-00000000000001-v1.json
-            cat BBSM-12345123451234512345-00000000000001-v1.json | kubectl -n \$INFRA_NS exec -it \$(kubectl -n \$INFRA_NS get pods -l app=etcd | awk 'NR==2{print \$1}') -- etcdctl put service/voltha/omci_mibs/templates/BBSM/12345123451234512345/00000000000001
-          fi
-
           if [ ${withPcap} = true ] && [ ${volthaStacks} -eq 1 ] ; then
             # Start the tcp-dump in ofagent
             export OF_AGENT=\$(kubectl -n \$INFRA_NS get pods -l app=ofagent -o name)
diff --git a/jjb/pipeline/voltha-scale-test.groovy b/jjb/pipeline/voltha-scale-test.groovy
index 7959f48..3944b6e 100644
--- a/jjb/pipeline/voltha-scale-test.groovy
+++ b/jjb/pipeline/voltha-scale-test.groovy
@@ -328,6 +328,12 @@
             _TAG=onos-port-forward kubectl port-forward --address 0.0.0.0 -n default svc/voltha-infra-onos-classic-hs 8101:8101&
             _TAG=onos-port-forward kubectl port-forward --address 0.0.0.0 -n default svc/voltha-infra-onos-classic-hs 8181:8181&
             _TAG=voltha-port-forward kubectl port-forward --address 0.0.0.0 -n default svc/voltha1-voltha-api 55555:55555&
+
+            bbsimRestPortFwd=50071
+            for i in {0..${olts.toInteger() - 1}}; do
+              _TAG=bbsim-port-forward kubectl port-forward --address 0.0.0.0 -n default svc/bbsim\${i} \${bbsimRestPortFwd}:50071&
+              ((bbsimRestPortFwd++))
+            done
           """
         }
         sh returnStdout: false, script: '''
@@ -454,7 +460,7 @@
               -v withDhcp:${withDhcp} \
               -v withIgmp:${withIgmp} \
               --noncritical non-critical \
-              -e teardown "
+              -e igmp -e teardown "
 
             if [ ${withEapol} = false ] ; then
               ROBOT_PARAMS+="-e authentication "
@@ -481,6 +487,44 @@
         }
       }
     }
+    stage('Run Igmp Tests') {
+      environment {
+        ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/IgmpTests"
+      }
+      when {
+        expression {
+          return params.withIgmp
+        }
+      }
+      steps {
+        sh '''
+          set +e
+          mkdir -p $WORKSPACE/RobotLogs
+          cd $WORKSPACE/voltha-system-tests
+          make vst_venv
+        '''
+        timeout(time: 10, unit: 'MINUTES') {
+          sh '''
+            ROBOT_PARAMS="-v olt:${olts} \
+              -v pon:${pons} \
+              -v onu:${onus} \
+              -v workflow:${workflow} \
+              -v withEapol:${withEapol} \
+              -v withDhcp:${withDhcp} \
+              -v withIgmp:${withIgmp} \
+              --noncritical non-critical \
+              -i igmp \
+              -e setup -e activation -e flow-before \
+              -e authentication -e provision -e flow-after \
+              -e dhcp -e teardown "
+            cd $WORKSPACE/voltha-system-tests
+            source ./vst_venv/bin/activate
+            robot -d $ROBOT_LOGS_DIR \
+            $ROBOT_PARAMS tests/scale/Voltha_Scale_Tests.robot
+          '''
+        }
+      }
+    }
   }
   post {
     always {
@@ -575,12 +619,12 @@
       ])
       step([$class: 'RobotPublisher',
         disableArchiveOutput: false,
-        logFileName: 'RobotLogs/log.html',
+        logFileName: '**/log*.html',
         otherFiles: '',
-        outputFileName: 'RobotLogs/output.xml',
-        outputPath: '.',
+        outputFileName: '**/output*.xml',
+        outputPath: 'RobotLogs',
         passThreshold: 100,
-        reportFileName: 'RobotLogs/report.html',
+        reportFileName: '**/report*.html',
         unstableThreshold: 0]);
       // get all the logs from kubernetes PODs
       sh returnStdout: false, script: '''