Merge "[VOL-2939] Adding pipeline support for ETCD Metrics"
diff --git a/jjb/cord-test/voltha.yaml b/jjb/cord-test/voltha.yaml
index 84a5695..a6c62c1 100644
--- a/jjb/cord-test/voltha.yaml
+++ b/jjb/cord-test/voltha.yaml
@@ -380,6 +380,8 @@
           release: 'master'
           branch: 'master'
           num-of-openonu: '2'
+          num-of-onos: '3'
+          num-of-atomix: '3'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
           oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
@@ -431,6 +433,8 @@
           release: 'master'
           branch: 'master'
           num-of-openonu: '2'
+          num-of-onos: '3'
+          num-of-atomix: '3'
           name-extension: '_DT'
           work-flow: 'DT'
           test-repo: 'voltha-system-tests'
diff --git a/jjb/device-management.yaml b/jjb/device-management.yaml
index aa8014f..b4eb61b 100644
--- a/jjb/device-management.yaml
+++ b/jjb/device-management.yaml
@@ -13,7 +13,7 @@
           testvm: 'tucson-pod'
           config-pod: 'tucson-pod'
           branch: 'master'
-          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
+          oltDebVersion: 'openolt_asfvolt16-2.4.6-5d9ab1a36e13e55ca3687af160cfd4f582317493.deb'
           profile: 'Default'
           time-trigger: "@daily"
 
diff --git a/jjb/pipeline/voltha-scale-test.groovy b/jjb/pipeline/voltha-scale-test.groovy
index 80ab0a4..c2d2a38 100644
--- a/jjb/pipeline/voltha-scale-test.groovy
+++ b/jjb/pipeline/voltha-scale-test.groovy
@@ -351,18 +351,24 @@
         reportFileName: 'RobotLogs/report.html',
         unstableThreshold: 0]);
       // get all the logs from kubernetes PODs
-      sh '''
-        mkdir -p $WORKSPACE/logs
-        kubectl get pods -o wide > $WORKSPACE/logs/pods.txt
-        kubectl logs -l app=adapter-open-olt > $WORKSPACE/logs/open-olt-logs.logs
-        kubectl logs -l app=adapter-open-onu > $WORKSPACE/logs/open-onu-logs.logs
-        kubectl logs -l app=rw-core > $WORKSPACE/logs/voltha-rw-core-logs.logs
-        kubectl logs -l app=ofagent > $WORKSPACE/logs/voltha-ofagent-logs.logs
-        kubectl logs -l app=bbsim > $WORKSPACE/logs/bbsim-logs.logs
-        kubectl logs -l app=onos > $WORKSPACE/logs/onos-logs.logs
-        kubectl logs -l app=onos-onos-classic > $WORKSPACE/logs/onos-onos-classic-logs.logs
-        kubectl logs -l app=etcd > $WORKSPACE/logs/etcd-logs.logs
-        kubectl logs -l app=kafka > $WORKSPACE/logs/kafka-logs.logs
+      sh returnStdout: false, script: '''
+        LOG_FOLDER=$WORKSPACE/logs
+        mkdir -p $LOG_FOLDER
+
+        # store information on the running pods
+        kubectl get pods -o wide > $LOG_FOLDER/pods.txt
+        kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-images.txt
+        kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-imagesId.txt
+
+        # log in individual files for all the container that match the selector app=$APP_TO_LOG
+
+        APPS_TO_LOG=(etcd kafka onos onos-onos-classic adapter-open-onu adapter-open-olt rw-core ofagent bbsim)
+        for app in "${APPS_TO_LOG[@]}"
+        do
+          echo "Getting logs for: ${app}"
+          kubectl get pods -l app=${app} -o=jsonpath=\"{.items[*]['metadata.name']}\"
+          printf '%s\n' $(kubectl get pods -l app=$app -o=jsonpath="{.items[*]['metadata.name']}") | xargs -I@ bash -c "kubectl logs @ > $LOG_FOLDER/@.logs"
+        done
       '''
       // count how many ONUs have been activated
       sh '''
@@ -397,11 +403,6 @@
           echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 dhcpl2relay-allocations | grep DHCPACK | wc -l) >> $WORKSPACE/logs/onos-dhcp-count.txt
         fi
       '''
-      // check which containers were used in this build
-      sh '''
-        kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
-        kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
-      '''
       // dump all the BBSim(s) ONU informations
       sh '''
       BBSIM_IDS=$(kubectl get pods | grep bbsim | grep -v server | awk '{print $1}')