Merge "[VOL-4043] Multi-stack pipeline fix, exposing correct ONOS port and output re-direction"
diff --git a/jjb/pipeline/voltha-tt-physical-functional-tests.groovy b/jjb/pipeline/voltha-tt-physical-functional-tests.groovy
index 93486ab..1b5cc40 100644
--- a/jjb/pipeline/voltha-tt-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha-tt-physical-functional-tests.groovy
@@ -178,9 +178,9 @@
 
         mkdir -p $ROBOT_LOGS_DIR
         if ( ${powerSwitch} ); then
-             export ROBOT_MISC_ARGS="--removekeywords wuks -i PowerSwitch -i sanityTT -i sanityTT-MCAST -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}"
+             export ROBOT_MISC_ARGS="--removekeywords wuks -i functionalTT -i PowerSwitch -i sanityTT -i sanityTT-MCAST -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}"
         else
-             export ROBOT_MISC_ARGS="--removekeywords wuks -e PowerSwitch -i sanityTT -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}"
+             export ROBOT_MISC_ARGS="--removekeywords wuks -i functionalTT -e PowerSwitch -i sanityTT -i sanityTT-MCAST -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}"
         fi
         make -C $WORKSPACE/voltha-system-tests voltha-tt-test || true
         """
@@ -206,6 +206,28 @@
       }
     }
 
+    stage('Multi-Tcont Tests') {
+      environment {
+        ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-TT.yaml"
+        ROBOT_FILE="Voltha_TT_MultiTcontTests.robot"
+        ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/tt-workflow/MultiTcontScenarios"
+        ROBOT_TEST_INPUT_FILE="$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-TT-multi-tcont-tests-input.yaml"
+      }
+      steps {
+        sh """
+        mkdir -p $ROBOT_LOGS_DIR
+        if [ "${params.branch}" == "master" ]; then
+           if ( ${powerSwitch} ); then
+              export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i functionalTT -i PowerSwitch -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel} -V $ROBOT_TEST_INPUT_FILE"
+           else
+              export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i functionalTT -e PowerSwitch -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel} -V $ROBOT_TEST_INPUT_FILE"
+           fi
+          make -C $WORKSPACE/voltha-system-tests voltha-tt-test || true
+        fi
+        """
+      }
+    }
+
   }
   post {
     always {
diff --git a/jjb/pipeline/voltha/master/periodic-bbsim-tests.groovy b/jjb/pipeline/voltha/master/periodic-bbsim-tests.groovy
index e0a0871..82a27ec 100755
--- a/jjb/pipeline/voltha/master/periodic-bbsim-tests.groovy
+++ b/jjb/pipeline/voltha/master/periodic-bbsim-tests.groovy
@@ -90,7 +90,7 @@
             done
           fi
           cd $WORKSPACE/${testTarget}-components/
-          gzip onos-voltha-startup-combined.log
+          gzip -k onos-voltha-startup-combined.log
           rm onos-voltha-startup-combined.log
         """
       }
@@ -131,7 +131,7 @@
         done
       fi
       cd $WORKSPACE/${testTarget}-components/
-      gzip onos-voltha-combined.log
+      gzip -k onos-voltha-combined.log
       rm onos-voltha-combined.log
     """
     getPodsInfo("$WORKSPACE/${testTarget}-components")
diff --git a/jjb/pipeline/voltha/master/voltha-scale-test.groovy b/jjb/pipeline/voltha/master/voltha-scale-test.groovy
index 6628eb9..b5fa6da 100644
--- a/jjb/pipeline/voltha/master/voltha-scale-test.groovy
+++ b/jjb/pipeline/voltha/master/voltha-scale-test.groovy
@@ -346,7 +346,7 @@
             put_result=\$(kubectl exec -it \$etcd_container -- /bin/sh -c 'cat /tmp/hsia.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/64')
             kubectl cp $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-VoIP.json \$etcd_container:/tmp/voip.json
             put_result=\$(kubectl exec -it \$etcd_container -- /bin/sh -c 'cat /tmp/voip.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/65')
-            kubectl cp $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-MCAST.json \$etcd_container:/tmp/mcast.json
+            kubectl cp $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-MCAST-AdditionalBW-NA.json \$etcd_container:/tmp/mcast.json
             put_result=\$(kubectl exec -it \$etcd_container -- /bin/sh -c 'cat /tmp/mcast.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/66')
           fi
 
diff --git a/jjb/pipeline/voltha/voltha-2.7/voltha-openonu-go-test-bbsim.groovy b/jjb/pipeline/voltha/voltha-2.7/voltha-openonu-go-test-bbsim.groovy
index 9d990a1..c689c0e 100755
--- a/jjb/pipeline/voltha/voltha-2.7/voltha-openonu-go-test-bbsim.groovy
+++ b/jjb/pipeline/voltha/voltha-2.7/voltha-openonu-go-test-bbsim.groovy
@@ -143,7 +143,7 @@
               done
             fi
             cd $WORKSPACE/1t1gem/
-            gzip onos-voltha-combined.log
+            gzip -k onos-voltha-combined.log
             rm onos-voltha-combined.log
             # get pods information
             kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t1gem/pods.txt || true
@@ -198,7 +198,7 @@
               done
             fi
             cd $WORKSPACE/1t4gem/
-            gzip onos-voltha-combined.log
+            gzip -k onos-voltha-combined.log
             rm onos-voltha-combined.log
             # get pods information
             kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t4gem/pods.txt || true
@@ -253,7 +253,7 @@
               done
             fi
             cd $WORKSPACE/1t8gem/
-            gzip onos-voltha-combined.log
+            gzip -k onos-voltha-combined.log
             rm onos-voltha-combined.log
             # get pods information
             kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t8gem/pods.txt || true
@@ -310,7 +310,7 @@
                done
              fi
              cd $WORKSPACE/mib/
-             gzip onos-voltha-combined.log
+             gzip -k onos-voltha-combined.log
              rm onos-voltha-combined.log
              # get pods information
              kubectl get pods -o wide --all-namespaces > $WORKSPACE/mib/pods.txt || true
@@ -372,7 +372,7 @@
                done
              fi
              cd $WORKSPACE/reconciledt/
-             gzip onos-voltha-combined.log
+             gzip -k onos-voltha-combined.log
              rm onos-voltha-combined.log
              # get pods information
              kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconciledt/pods.txt || true
@@ -440,7 +440,7 @@
                done
              fi
              cd $WORKSPACE/reconcileatt/
-             gzip onos-voltha-combined.log
+             gzip -k onos-voltha-combined.log
              rm onos-voltha-combined.log
              # get pods information
              kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcileatt/pods.txt || true
@@ -502,7 +502,7 @@
                done
              fi
              cd $WORKSPACE/reconcilett/
-             gzip onos-voltha-combined.log
+             gzip -k onos-voltha-combined.log
              rm onos-voltha-combined.log
              # get pods information
              kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcilett/pods.txt || true
diff --git a/jjb/voltha-e2e.yaml b/jjb/voltha-e2e.yaml
index 958cd22..1ee9547 100755
--- a/jjb/voltha-e2e.yaml
+++ b/jjb/voltha-e2e.yaml
@@ -260,7 +260,7 @@
       - 'voltha-periodic-test':
           name: 'periodic-voltha-pm-data-test-bbsim'
           code-branch: 'master'
-          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set externalAccess.enabled=true,externalAccess.service.type=NodePort,externalAccess.service.nodePorts[0]=30201,externalAccess.service.domain=127.0.0.1'
+          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1'
           time-trigger: "H H/23 * * *"
           logLevel: 'DEBUG'
           testTargets: |
@@ -282,7 +282,7 @@
           name: 'patchset-voltha-pm-data-test-bbsim'
           trigger-comment: "voltha test pm data singleolt"
           code-branch: '$GERRIT_BRANCH'
-          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set externalAccess.enabled=true,externalAccess.service.type=NodePort,externalAccess.service.nodePorts[0]=30201,externalAccess.service.domain=127.0.0.1'
+          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1'
           code-branch: '$GERRIT_BRANCH'
           gerrit-project: '$GERRIT_PROJECT'
           gerritRefspec: '$GERRIT_REFSPEC'
@@ -305,7 +305,7 @@
       - 'voltha-periodic-test':
           name: 'periodic-voltha-multiple-olts-pm-data-test-bbsim'
           code-branch: 'master'
-          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,pon=2 --set externalAccess.enabled=true,externalAccess.service.type=NodePort,externalAccess.service.nodePorts[0]=30201,externalAccess.service.domain=127.0.0.1'
+          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,pon=2 --set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1'
           olts: 2
           timeout: 180
           logLevel: 'DEBUG'
@@ -328,7 +328,7 @@
           name: 'patchset-voltha-multiple-olts-pm-data-test-bbsim'
           trigger-comment: "voltha test pm data multiolt"
           code-branch: '$GERRIT_BRANCH'
-          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,pon=2 --set externalAccess.enabled=true,externalAccess.service.type=NodePort,externalAccess.service.nodePorts[0]=30201,externalAccess.service.domain=127.0.0.1'
+          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,pon=2 --set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1'
           gerrit-project: '$GERRIT_PROJECT'
           gerritRefspec: '$GERRIT_REFSPEC'
           logLevel: 'DEBUG'
diff --git a/vars/getPodsInfo.groovy b/vars/getPodsInfo.groovy
index 28fc81d..03b17ce 100644
--- a/vars/getPodsInfo.groovy
+++ b/vars/getPodsInfo.groovy
@@ -3,11 +3,16 @@
 def call(String dest) {
   sh """
   mkdir -p ${dest}
+  # only tee the main infos
   kubectl get pods --all-namespaces -o wide | tee ${dest}/pods.txt || true
-  kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee ${dest}/pod-images.txt || true
-  kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee ${dest}/pod-imagesId.txt || true
+  helm ls --all-namespaces | tee ${dest}/helm-charts.txt
+
+  # everything else should not be dumped on the console
+  kubectl get svc --all-namespaces -o wide > ${dest}/svc.txt || true
+  kubectl get pvc --all-namespaces -o wide > ${dest}/pvcs.txt || true
+  kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq > ${dest}/pod-images.txt || true
+  kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq > ${dest}/pod-imagesId.txt || true
   kubectl describe pods --all-namespaces -l app.kubernetes.io/part-of=voltha > ${dest}/voltha-pods-describe.txt
   kubectl describe pods --all-namespaces -l app=onos-classic > ${dest}/onos-pods-describe.txt
-  helm ls --all-namespaces | tee ${dest}/helm-charts.txt
   """
 }