Merge "Integrating Sanity Test for Openonu-go in Pipeline"
diff --git a/jjb/cord-test/att-workflow.yaml b/jjb/cord-test/att-workflow.yaml
index f4d304c..16f334b 100644
--- a/jjb/cord-test/att-workflow.yaml
+++ b/jjb/cord-test/att-workflow.yaml
@@ -8,6 +8,11 @@
 
     build-timeout: '300'
 
+    work-flow: ''
+    num-of-openonu: '1'
+    num-of-onos: '1'
+    num-of-atomix: '0'
+
     jobs:
       # onlab pod1 build
       - 'build_pod_manual':
diff --git a/jjb/cord-test/nightly-build-pipeline.yaml b/jjb/cord-test/nightly-build-pipeline.yaml
index c78a2e3..1b4dd59 100644
--- a/jjb/cord-test/nightly-build-pipeline.yaml
+++ b/jjb/cord-test/nightly-build-pipeline.yaml
@@ -116,6 +116,25 @@
           default: '16'
           description: "Onus per PonPort"
 
+      - string:
+          name: workFlow
+          default: '{work-flow}'
+          description: 'Installs and uses the specified work flow on the POD'
+
+      - string:
+          name: NumOfOpenOnu
+          default: '{num-of-openonu}'
+          description: 'Installs the specified Number of OpenOnu Adapters'
+
+      - string:
+          name: NumOfOnos
+          default: '{num-of-onos}'
+          description: 'Installs the specified Number of ONOS instances'
+
+      - string:
+          name: NumOfAtomix
+          default: '{num-of-atomix}'
+          description: 'Installs the specified Number of Atomix Instances'
     concurrent: true
 
     pipeline-scm:
diff --git a/jjb/cord-test/voltha.yaml b/jjb/cord-test/voltha.yaml
index a54f0ee..c19d8f0 100644
--- a/jjb/cord-test/voltha.yaml
+++ b/jjb/cord-test/voltha.yaml
@@ -22,6 +22,7 @@
           config-pod: 'flex-ocp-cord'
           release: 'master'
           branch: 'master'
+          num-of-openonu: '2'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-build'
           oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
@@ -346,6 +347,26 @@
           profile: 'Default'
 
 
+      # Infosys pod with olt/onu - Manual BUILD/TEST job
+      - 'build_pod_manual':
+          build-node: 'infosys-test-pod'
+          config-pod: 'infosys-pod'
+          release: 'master'
+          branch: 'master'
+          num-of-openonu: '2'
+          test-repo: 'voltha-system-tests'
+          Jenkinsfile: 'Jenkinsfile-voltha-build'
+          oltDebVersion: 'openolt_asfvolt16-2.3.0-bc6e0853e0e8bf6bd7e4223d4a7ee0dd35ce634d.deb'
+          profile: 'Default'
+      # infosys test job - Manual Job
+      - 'build_pod_test':
+          build-node: 'infosys-test-pod'
+          config-pod: 'infosys-pod'
+          branch: 'master'
+          test-repo: 'voltha-system-tests'
+          profile: 'Default'
+          Jenkinsfile: 'Jenkinsfile-voltha-test'
+
       # Berlin pod with olt/onu - master versions Default tech profile and timer based job
       - 'build_voltha_pod_release':
           build-node: 'dt-berlin-community-pod'
diff --git a/jjb/pipeline/voltha-dt-physical-functional-tests.groovy b/jjb/pipeline/voltha-dt-physical-functional-tests.groovy
index fef91c7..a576bc0 100644
--- a/jjb/pipeline/voltha-dt-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha-dt-physical-functional-tests.groovy
@@ -133,6 +133,21 @@
       }
     }
 
+    stage('Dataplane Tests') {
+      environment {
+        ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
+        ROBOT_FILE="Voltha_DT_PODTests.robot"
+        ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/DataplaneTests"
+      }
+      steps {
+        sh """
+        mkdir -p $ROBOT_LOGS_DIR
+        export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i dataplaneDt -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE"
+        make -C $WORKSPACE/voltha/voltha-system-tests voltha-dt-test || true
+        """
+      }
+    }
+
     stage('Error Scenario Tests') {
       environment {
         ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml"
diff --git a/jjb/pipeline/voltha-physical-functional-tests.groovy b/jjb/pipeline/voltha-physical-functional-tests.groovy
index 6772519..f118e07 100644
--- a/jjb/pipeline/voltha-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha-physical-functional-tests.groovy
@@ -108,7 +108,7 @@
         ./log-combine.sh > /dev/null &
 
         mkdir -p $ROBOT_LOGS_DIR
-        export ROBOT_MISC_ARGS="--removekeywords wuks -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE"
+        export ROBOT_MISC_ARGS="--removekeywords wuks -i sanity -i functional -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE"
         make -C $WORKSPACE/voltha/voltha-system-tests voltha-test || true
         """
       }
@@ -133,6 +133,21 @@
       }
     }
 
+    stage('Dataplane Tests') {
+      environment {
+        ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
+        ROBOT_FILE="Voltha_PODTests.robot"
+        ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/DataplaneTests"
+      }
+      steps {
+        sh """
+        mkdir -p $ROBOT_LOGS_DIR
+        export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i dataplane -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE"
+        make -C $WORKSPACE/voltha/voltha-system-tests voltha-test || true
+        """
+      }
+    }
+
     stage('Error Scenario Tests') {
       environment {
         ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
diff --git a/jjb/pipeline/voltha-scale-measurements.groovy b/jjb/pipeline/voltha-scale-measurements.groovy
deleted file mode 100644
index 30998d1..0000000
--- a/jjb/pipeline/voltha-scale-measurements.groovy
+++ /dev/null
@@ -1,498 +0,0 @@
-/* voltha-scale-measurements pipeline */
-pipeline {
-  /* no label, executor is determined by JJB */
-  agent {
-    label "${params.buildNode}"
-  }
-  environment {
-    SSHPASS="karaf"
-  }
-  stages {
-    stage('Set build description') {
-      steps {
-        script {
-          currentBuild.description = "$BUILD_TIMESTAMP"
-        }
-      }
-    }
-    stage('Cleanup') {
-      steps {
-        sh '''
-          rm -rf *.txt
-          for hchart in \$(helm list -q | grep -E -v 'docker-registry|kafkacat|etcd-operator');
-          do
-              echo "Purging chart: \${hchart}"
-              helm delete --purge "\${hchart}"
-          done
-          bash /home/cord/voltha-scale/wait_for_pods.sh
-          bash /home/cord/voltha-scale/stop_port_forward.sh
-        '''
-      }
-    }
-    stage('Start') {
-      steps {
-        sh '''
-          #!/usr/bin/env bash
-          set -euo pipefail
-          '''
-      }
-    }
-    stage('Deploy voltha') {
-      options {
-        timeout(time:10)
-      }
-      steps {
-        sh '''
-          helm repo update
-          helm install -n cord-kafka incubator/kafka -f /home/cord/voltha-scale/voltha-values.yaml --version 0.13.3 --set replicas=${numOfKafka} --set persistence.enabled=false --set zookeeper.replicaCount=${numOfKafka} --set zookeeper.persistence.enabled=false
-          helm install -n nem-monitoring cord/nem-monitoring --set kpi_exporter.enabled=false,dashboards.xos=false,dashboards.onos=false,dashboards.aaa=false,dashboards.voltha=false
-
-          helm install -n radius onf/freeradius ${extraHelmFlags}
-
-          # Multi BBSim sadis server (to be migrated in ONF and included in the helm-chart)
-          # kubectl create -f https://raw.githubusercontent.com/ciena/bbsim-sadis-server/master/bbsim-sadis-server.yaml
-
-          # NOTE wait for the infrastructure to be running before installing VOLTHA
-          bash /home/cord/voltha-scale/wait_for_pods.sh
-
-          IFS=: read -r onosRepo onosTag <<< ${onosImg}
-          helm install -n onos onf/onos --set images.onos.repository=${onosRepo} --set images.onos.tag=${onosTag} ${extraHelmFlags}
-
-          IFS=: read -r volthaRepo volthaTag <<< ${volthaImg}
-          IFS=: read -r ofAgentRepo ofAgentTag <<< ${ofAgentImg}
-          helm install -n voltha ${volthaChart} -f /home/cord/voltha-scale/voltha-values.yaml --set defaults.log_level=${logLevel},images.rw_core.repository=${volthaRepo},images.rw_core.tag=${volthaTag},images.ofagent_go.repository=${ofAgentRepo},images.ofagent_go.tag=${ofAgentTag} ${extraHelmFlags}
-
-          IFS=: read -r openoltAdapterRepo openoltAdapterTag <<< ${openoltAdapterImg}
-          helm install -n openolt ${openoltAdapterChart} -f /home/cord/voltha-scale/voltha-values.yaml --set defaults.log_level=${logLevel},images.adapter_open_olt.repository=${openoltAdapterRepo},images.adapter_open_olt.tag=${openoltAdapterTag} ${extraHelmFlags}
-
-          IFS=: read -r openonuAdapterRepo openonuAdapterTag <<< ${openonuAdapterImg}
-          helm install -n openonu ${openonuAdapterChart} -f /home/cord/voltha-scale/voltha-values.yaml --set defaults.log_level=${logLevel},images.adapter_open_onu.repository=${openonuAdapterRepo},images.adapter_open_onu.tag=${openonuAdapterTag} ${extraHelmFlags}
-
-          IFS=: read -r bbsimRepo bbsimTag <<< ${bbsimImg}
-
-          for i in $(seq 1 $((${numOfBbsim}))); do
-            helm install -n bbsim-$i ${bbsimChart} --set olt_id=$i,enablePerf=true,pon=${ponPorts},onu=${onuPerPon},auth=${bbsimAuth},dhcp=${bbsimDhcp},delay=${BBSIMdelay},images.bbsim.repository=${bbsimRepo},images.bbsim.tag=${bbsimTag} ${extraHelmFlags}
-          done
-
-          bash /home/cord/voltha-scale/wait_for_pods.sh
-          bash /home/cord/voltha-scale/start_port_forward.sh
-          '''
-      }
-    }
-    stage('Wait for Adapters to be registered in VOLTHA') {
-      options {
-        timeout(time:5)
-      }
-      steps{
-        waitUntil {
-          script {
-            openolt_res = sh returnStdout: true, script: """
-            voltctl adapter list | grep openolt | wc -l
-            """
-
-            openonu_res = sh returnStdout: true, script: """
-            voltctl adapter list | grep brcm_openomci_onu | wc -l
-            """
-
-            return openolt_res.toInteger() >= 1 && openonu_res.toInteger() >= 1
-          }
-        }
-      }
-    }
-    stage('Push MIB template to ETCD') {
-      steps {
-        sh '''
-          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 exec -it $(kubectl get pods | grep etcd-cluster | awk 'NR==1{print $1}') etcdctl put service/voltha/omci_mibs/templates/BBSM/12345123451234512345/00000000000001
-          fi
-        '''
-      }
-    }
-    stage('Configure ONOS and VOLTHA') {
-      steps {
-        sh '''
-          #Setting LOG level to ${logLevel}
-          sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 log:set ${logLevel}
-          kubectl exec $(kubectl get pods | grep bbsim | awk 'NR==1{print $1}') bbsimctl log warn false
-
-          #Setting link discovery
-          sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 cfg set org.onosproject.provider.lldp.impl.LldpLinkProvider enabled ${setLinkDiscovery}
-
-          # extending voltctl timeout
-          sed -i 's/timeout: 10s/timeout: 5m/g' /home/cord/.volt/config
-
-          #Setting the flow and ports stats collection interval
-          sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 cfg set org.onosproject.provider.of.flow.impl.OpenFlowRuleProvider flowPollFrequency ${flowStatInterval}
-          sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 cfg set org.onosproject.provider.of.device.impl.OpenFlowDeviceProvider portStatsPollFrequency ${portsStatInterval}
-
-          # Always deactivate org.opencord.kafka
-          sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 app deactivate org.opencord.kafka
-
-          #Check withOnosApps and disable apps accordingly
-          if [ ${withOnosApps} = false ] ; then
-            sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 app deactivate org.opencord.olt
-            sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 app deactivate org.opencord.aaa
-            sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 app deactivate org.opencord.dhcpl2relay
-          else
-            # config SADIS
-            curl --fail -sSL --user karaf:karaf -X POST -H Content-Type:application/json "http://127.0.0.1:30120/onos/v1/network/configuration/apps/org.opencord.sadis" --data '{
-              "sadis": {
-                  "integration": {
-                      "url": "http://bbsim-sadis-server.default.svc:58080/subscribers/%s",
-                      "cache": {
-                          "enabled": true,
-                          "maxsize": 50,
-                          "ttl": "PT1m"
-                      }
-                  }
-              },
-              "bandwidthprofile": {
-                  "integration": {
-                      "url": "http://bbsim-sadis-server.default.svc:58080/profiles/%s",
-                      "cache": {
-                          "enabled": true,
-                          "maxsize": 50,
-                          "ttl": "PT1m"
-                      }
-                  }
-              }
-            }'
-
-            # config AAA
-            curl --fail -sSL --user karaf:karaf -X POST -H Content-Type:application/json "http://127.0.0.1:30120/onos/v1/network/configuration/apps/org.opencord.aaa" --data '{
-              "AAA": {
-                "radiusConnectionType" : "socket",
-                "radiusHost": "radius.default.svc.cluster.local",
-                "radiusServerPort": "1812",
-                "radiusSecret": "SECRET"
-              }
-            }'
-
-            # config DHCP
-            curl --fail -sSL --user karaf:karaf -X POST -H Content-Type:application/json "http://127.0.0.1:30120/onos/v1/network/configuration/apps/org.opencord.dhcpl2relay" --data '{
-              "dhcpl2relay" : {
-                "useOltUplinkForServerPktInOut": true
-              }
-            }'
-          fi
-        '''
-      }
-    }
-    stage('Set timeout at 10 minutes') {
-      options {
-        timeout(time:10)
-      }
-      stages {
-        stage('Activate OLTs') {
-          steps {
-            sh '''
-            for i in $(seq 1 $((${numOfBbsim}))); do
-              voltctl device create -t openolt -H bbsim-$i:50060 -m 0f:f1:ce:c$i:ff:ee
-            done
-            voltctl device list --filter Type~openolt -q | xargs voltctl device enable
-            '''
-          }
-        }
-        stage('Wait for ONUs to be enabled') {
-          steps {
-            sh '''
-              if [ -z ${expectedOnus} ]
-              then
-                echo -e "You need to set the target ONU number\n"
-                exit 1
-              fi
-
-              # check ONUs reached Active State in VOLTHA
-              i=$(voltctl device list | grep -v OLT | grep ACTIVE | wc -l)
-              until [ $i -eq ${expectedOnus} ]
-              do
-                echo "$i ONUs ACTIVE of ${expectedOnus} expected (time: $SECONDS)"
-                sleep ${pollInterval}
-                i=$(voltctl device list | grep -v OLT | grep ACTIVE | wc -l)
-              done
-              echo "${expectedOnus} ONUs Activated in $SECONDS seconds (time: $SECONDS)"
-
-              echo $SECONDS > voltha-devices-time-num.txt
-
-              echo "VOLTHA Duration(s)" > voltha-devices-time.txt
-              cat voltha-devices-time-num.txt >> voltha-devices-time.txt
-            '''
-          }
-        }
-        stage('Wait for ports to be discovered in ONOS') {
-          steps {
-            sh '''
-              # Check ports showed up in ONOS
-              z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 ports -e | grep BBSM | wc -l)
-              until [ $z -eq ${expectedOnus} ]
-              do
-                echo "${z} enabled ports of ${expectedOnus} expected (time: $SECONDS)"
-                sleep ${pollInterval}
-                z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 ports -e | grep BBSM | wc -l)
-              done
-              echo "${expectedOnus} ports enabled in $SECONDS seconds (time: $SECONDS)"
-
-              echo $SECONDS > temp.txt
-              paste voltha-devices-time-num.txt temp.txt | awk '{print ($1 + $2)}' > onos-ports-time-num.txt
-
-              echo "PORTs Duration(s)" > onos-ports-time.txt
-              cat onos-ports-time-num.txt >> onos-ports-time.txt
-            '''
-          }
-        }
-        stage('Wait for flows to be programmed in VOLTHA') {
-          steps {
-            sh '''
-            if [ ${withOnosApps} = false ] ; then
-              echo "ONOS Apps are not enabled, nothing to check"
-            else
-              function get_flows() {
-                local TOTAL
-                TOTAL=0
-
-                arr=("$@")
-                for id in "${arr[@]}"
-                do
-                  TOTAL=$((TOTAL + $(voltctl logicaldevice flows $id | grep -v ID | wc -l)))
-                done
-                echo $TOTAL
-              }
-
-              LOGICAL_DEVICE_IDS=$(voltctl logicaldevice list | grep BBSIM | awk '{print $1}')
-              IDS=($LOGICAL_DEVICE_IDS)
-
-              FLOWS=$(get_flows "${IDS[@]}")
-
-              until [ $FLOWS -eq ${expectedFlows} ]
-              do
-                echo "${FLOWS} of ${expectedFlows} flows programmed in VOLTHA (time: $SECONDS)"
-                sleep ${pollInterval}
-                FLOWS=$(get_flows "${IDS[@]}")
-              done
-              echo "${expectedFlows} flows correctly programmed (time: $SECONDS)"
-              echo $SECONDS > temp.txt
-              paste onos-ports-time-num.txt temp.txt | awk '{print ($1 + $2)}' > voltha-flows-time-num.txt
-
-              echo "VOLTHA FLOWs Duration(s)" > voltha-flows-time.txt
-              cat voltha-flows-time-num.txt >> voltha-flows-time.txt
-            fi
-            '''
-          }
-        }
-        stage('Wait for flows to be acknowledged in ONOS') {
-          steps {
-            sh '''
-            if [ ${withOnosApps} = false ] ; then
-              echo "ONOS Apps are not enabled, nothing to check"
-            else
-              # wait until all flows are in added state
-              z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 flows -s | grep ADDED | wc -l)
-              until [ $z -eq ${expectedFlows} ]
-              do
-                echo "${z} of ${expectedFlows} flows in ADDED state (time: $SECONDS)"
-                sleep ${pollInterval}
-                z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 flows -s | grep ADDED | wc -l)
-              done
-              echo "${expectedFlows} flows correctly acknowledged (time: $SECONDS)"
-
-              echo $SECONDS > temp.txt
-              paste voltha-flows-time-num.txt temp.txt | awk '{print ($1 + $2)}' > onos-flows-time-num.txt
-
-              echo "ONOS FLOWs Duration(s)" > onos-flows-time.txt
-              cat onos-flows-time-num.txt >> onos-flows-time.txt
-            fi
-            '''
-          }
-        }
-        stage('Wait for subscribers to authenticate') {
-          steps {
-            sh '''
-            if [ ${withOnosApps} = false ] ; then
-              echo "ONOS Apps are not enabled, nothing to check"
-            elif [ ${bbsimAuth} = false ] ; then
-              echo "Authentication is disabled, nothing to check"
-            else
-              # wait until all subscribers authenticate
-              z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 aaa-users | grep AUTHORIZED_STATE | wc -l)
-              until [ $z -eq ${expectedOnus} ]
-              do
-                echo "${z} of ${expectedOnus} subscribers in AUTHORIZED_STATE state (time: $SECONDS)"
-                sleep ${pollInterval}
-                z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 aaa-users | grep AUTHORIZED_STATE | wc -l)
-              done
-              echo "${expectedOnus} subscribers in AUTHORIZED_STATE (time: $SECONDS)"
-
-              echo $SECONDS > temp.txt
-              paste onos-flows-time-num.txt temp.txt | awk '{print ($1 + $2)}' > onos-auth-time-num.txt
-
-              echo "ONOS Authentication Duration(s)" > onos-auth-time.txt
-              cat onos-auth-time-num.txt >> onos-auth-time.txt
-            fi
-            '''
-          }
-        }
-        stage('Provision subscribers') {
-          steps {
-            sh '''
-            if [ ${withOnosApps} = false ] ; then
-              echo "ONOS Apps are not enabled, nothing to do"
-            elif [ ${bbsimAuth} = false ] ; then
-              echo "Authentication is disabled, nothing to do"
-            else
-              # provision all authenticated subscribers
-              subs=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 aaa-users | grep AUTHORIZED_STATE | grep -o -E "of:[a-z0-9]+/[0-9]+")
-              echo $subs
-              subs=($subs)
-
-              for s in "${subs[@]}"
-              do
-                IFS=/ read -r device port <<< $s
-                echo "Adding subscriber on device $device and port $port"
-                sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 volt-add-subscriber-access $device $port
-              done
-            fi
-            '''
-          }
-        }
-        stage('Wait for subscribers to DHCP') {
-          steps {
-            sh '''
-            if [ ${withOnosApps} = false ] ; then
-              echo "ONOS Apps are not enabled, nothing to check"
-            elif [ ${bbsimDhcp} = false ] ; then
-              echo "DHCP is disabled, nothing to check"
-            else
-              # wait until all subscribers DHCP
-              z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 dhcpl2relay-allocations | grep DHCPACK | wc -l)
-              until [ $z -eq ${expectedOnus} ]
-              do
-                echo "${z} of ${expectedOnus} subscribers received DHCPACK (time: $SECONDS)"
-                sleep ${pollInterval}
-                z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 dhcpl2relay-allocations | grep DHCPACK | wc -l)
-              done
-              echo "${expectedOnus} subscribers received DHCPACK (time: $SECONDS)"
-
-              echo $SECONDS > temp.txt
-              paste onos-auth-time-num.txt temp.txt | awk '{print ($1 + $2)}' > onos-dhcp-time-num.txt
-
-              echo "ONOS DHCP Duration(s)" > onos-dhcp-time.txt
-              cat onos-dhcp-time-num.txt >> onos-dhcp-time.txt
-            fi
-            '''
-          }
-        }
-      }
-    }
-  }
-  post {
-    success {
-      plot([
-        csvFileName: 'plot-onu-activation.csv',
-        csvSeries: [
-          [displayTableFlag: false, exclusionValues: '', file: 'voltha-devices-time.txt', inclusionFlag: 'OFF', url: ''],
-          [displayTableFlag: false, exclusionValues: '', file: 'onos-ports-time.txt', inclusionFlag: 'OFF', url: ''],
-          [displayTableFlag: false, exclusionValues: '', file: 'voltha-flows-time.txt', inclusionFlag: 'OFF', url: ''],
-          [displayTableFlag: false, exclusionValues: '', file: 'onos-flows-time.txt', inclusionFlag: 'OFF', url: ''],
-          [displayTableFlag: false, exclusionValues: '', file: 'onos-auth-time.txt', inclusionFlag: 'OFF', url: ''],
-          [displayTableFlag: false, exclusionValues: '', file: 'onos-dhcp-time.txt', inclusionFlag: 'OFF', url: ''],
-        ],
-        group: 'Voltha-Scale-Numbers', numBuilds: '20', style: 'line', title: "Time (${BBSIMdelay}s Delay)", yaxis: 'Time (s)', useDescr: true
-      ])
-    }
-    always {
-      // count how many ONUs have been activated
-      sh '''
-        echo "#-of-ONUs" > voltha-devices-count.txt
-        echo $(voltctl device list | grep -v OLT | grep ACTIVE | wc -l) >> voltha-devices-count.txt
-      '''
-      // count how many ports have been discovered
-      sh '''
-        echo "#-of-ports" > onos-ports-count.txt
-        echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 ports -e | grep BBSM | wc -l) >> onos-ports-count.txt
-      '''
-      // count how many flows have been provisioned
-      sh '''
-        echo "#-of-flows" > onos-flows-count.txt
-        echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 flows -s | grep ADDED | wc -l) >> onos-flows-count.txt
-      '''
-      // dump and count the authenticated users
-      sh '''
-        if [ ${withOnosApps} = true ] && [ ${bbsimAuth} ] ; then
-          echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 aaa-users) >> onos-aaa-users.txt
-
-          echo "#-of-authenticated-users" > onos-aaa-count.txt
-          echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 aaa-users | grep AUTHORIZED_STATE | wc -l) >> onos-aaa-count.txt
-        fi
-      '''
-      // dump and count the dhcp users
-      sh '''
-        if [ ${withOnosApps} = true ] && [ ${bbsimDhcp} ] ; then
-          echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 dhcpl2relay-allocations) >> onos-dhcp-allocations.txt
-
-          echo "#-of-dhcp-allocations" > onos-dhcp-count.txt
-          echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 dhcpl2relay-allocations | grep DHCPACK | wc -l) >> 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 VOLTHA devices informations
-      sh '''
-        voltctl device list -o json > device-list.json
-        python -m json.tool device-list.json > voltha-devices-list.json
-      '''
-      // dump all the BBSim(s) ONU informations
-      sh '''
-      BBSIM_IDS=$(kubectl get pods | grep bbsim | grep -v server | awk '{print $1}')
-      IDS=($BBSIM_IDS)
-
-      for bbsim in "${IDS[@]}"
-      do
-        kubectl exec -t $bbsim bbsimctl onu list > $bbsim-device-list.txt
-      done
-      '''
-      // get ports and flows from ONOS
-      sh '''
-        sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 ports > onos-ports-list.txt
-        sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 flows -s > onos-flows-list.txt
-      '''
-      // collect the CPU usage
-      sh '''
-        curl -s -X GET -G http://127.0.0.1:31301/api/v1/query --data-urlencode 'query=avg(rate(container_cpu_usage_seconds_total[10m])*100) by (pod_name)' | jq . > cpu-usage.json
-      '''
-      // get all the logs from kubernetes PODs
-      sh '''
-        kubectl get pods -o wide
-        kubectl logs -l app=adapter-open-olt > open-olt-logs.txt
-        kubectl logs -l app=adapter-open-onu > open-onu-logs.txt
-        kubectl logs -l app=rw-core > voltha-rw-core-logs.txt
-        kubectl logs -l app=ofagent > voltha-ofagent-logs.txt
-        kubectl logs -l app=bbsim > bbsim-logs.txt
-        kubectl logs -l app=onos > onos-logs.txt
-      '''
-      // cleanup of things we don't want to archive
-      sh '''
-        rm -rf BBSM-12345123451234512345-00000000000001-v1.json device-list.json temp.txt
-      '''
-      // compile a plot of the activate informations
-      plot([
-        csvFileName: 'plot-numbers.csv',
-        csvSeries: [
-          [displayTableFlag: false, exclusionValues: '', file: 'voltha-devices-count.txt', inclusionFlag: 'OFF', url: ''],
-          [displayTableFlag: false, exclusionValues: '', file: 'onos-ports-count.txt', inclusionFlag: 'OFF', url: ''],
-          [displayTableFlag: false, exclusionValues: '', file: 'onos-flows-count.txt', inclusionFlag: 'OFF', url: ''],
-          [displayTableFlag: false, exclusionValues: '', file: 'onos-aaa-count.txt', inclusionFlag: 'OFF', url: ''],
-          [displayTableFlag: false, exclusionValues: '', file: 'onos-dhcp-count.txt', inclusionFlag: 'OFF', url: ''],
-        ],
-        group: 'Voltha-Scale-Numbers', numBuilds: '100', style: 'line', title: "Activated ONUs and Recognized Ports", yaxis: 'Number of Ports/ONUs', useDescr: true
-      ])
-
-      archiveArtifacts artifacts: '*.log,*.json,*txt'
-
-    }
-  }
-}
diff --git a/jjb/pipeline/voltha-scale-test.groovy b/jjb/pipeline/voltha-scale-test.groovy
index 9f0f2b4..b5785e3 100644
--- a/jjb/pipeline/voltha-scale-test.groovy
+++ b/jjb/pipeline/voltha-scale-test.groovy
@@ -37,7 +37,7 @@
     DEPLOY_K8S="no"
     CONFIG_SADIS="external"
     WITH_KAFKA="kafka.default.svc.cluster.local"
-    WITH_ETCD="external"
+    WITH_ETCD="etcd-cluster-client.default.svc.cluster.local"
 
     // install everything in the default namespace
     VOLTHA_NS="default"
@@ -116,11 +116,13 @@
       }
     }
     stage('Deploy common infrastructure') {
-      // includes monitoring, kafka
+      // includes monitoring, kafka, etcd
       steps {
         sh '''
         helm install -n kafka incubator/kafka --version 0.13.3 --set replicas=3 --set persistence.enabled=false --set zookeeper.replicaCount=3 --set zookeeper.persistence.enabled=false --version=0.15.3
 
+        helm install --set clusterName=etcd-cluster --set autoCompactionRetention=1 --set clusterSize=3 --set defaults.log_level=WARN --namespace default -n etcd-cluster onf/voltha-etcd-cluster
+
         if [ ${withMonitoring} = true ] ; then
           helm install -n nem-monitoring cord/nem-monitoring \
           --set prometheus.alertmanager.enabled=false,prometheus.pushgateway.enabled=false \
@@ -209,40 +211,42 @@
     }
     stage('Run Test') {
       steps {
-        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 \
-            -e teardown "
+        timeout(time: 11, 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 \
+              -e teardown "
 
-          if [ ${withEapol} = false ] ; then
-            ROBOT_PARAMS+="-e authentication "
-          fi
+            if [ ${withEapol} = false ] ; then
+              ROBOT_PARAMS+="-e authentication "
+            fi
 
-          if [ ${withDhcp} = false ] ; then
-            ROBOT_PARAMS+="-e dhcp "
-          fi
+            if [ ${withDhcp} = false ] ; then
+              ROBOT_PARAMS+="-e dhcp "
+            fi
 
-          if [ ${provisionSubscribers} = false ] ; then
-            ROBOT_PARAMS+="-e provision -e flow-after "
-          fi
+            if [ ${provisionSubscribers} = false ] ; then
+              ROBOT_PARAMS+="-e provision -e flow-after "
+            fi
 
-          if [ ${withFlows} = false ] ; then
-            ROBOT_PARAMS+="-i setup -i activation "
-          fi
+            if [ ${withFlows} = false ] ; then
+              ROBOT_PARAMS+="-i setup -i activation "
+            fi
 
-          mkdir -p $WORKSPACE/RobotLogs
-          cd voltha-system-tests
-          make vst_venv
-          source ./vst_venv/bin/activate
-          robot -d $WORKSPACE/RobotLogs \
-          $ROBOT_PARAMS tests/scale/Voltha_Scale_Tests.robot
-        '''
+            mkdir -p $WORKSPACE/RobotLogs
+            cd voltha-system-tests
+            make vst_venv
+            source ./vst_venv/bin/activate
+            robot -d $WORKSPACE/RobotLogs \
+            $ROBOT_PARAMS tests/scale/Voltha_Scale_Tests.robot
+          '''
+        }
       }
     }
     stage('Collect results') {
diff --git a/jjb/voltha-scale.yaml b/jjb/voltha-scale.yaml
index dbb019b..90424ee 100644
--- a/jjb/voltha-scale.yaml
+++ b/jjb/voltha-scale.yaml
@@ -7,66 +7,6 @@
     project-name: '{name}'
 
     jobs:
-      - 'voltha-scale-measurements-periodic-legacy':
-          name: 'voltha-scale-measurements-periodic-10-20-200ms'
-          build-node: 'onf-pod1-head-node'
-          time-trigger: "H H/4 * * *"
-          onuPerPon: 20
-          ponPorts: 10
-          expectedOnus: 200
-          BBSIMdelay: 200
-      - 'voltha-scale-measurements-periodic-legacy':
-          name: 'voltha-scale-measurements-periodic-16-32-200ms'
-          build-node: 'onf-pod1-head-node'
-          time-trigger: "H H/4 * * *"
-          onuPerPon: 32
-          ponPorts: 16
-          expectedOnus: 512
-          BBSIMdelay: 200
-          # multi-adapter
-          extraHelmFlags: "--set replicas.adapter_open_onu=8"
-      - 'voltha-scale-measurements-periodic-legacy':
-          name: 'voltha-scale-measurements-periodic-16-64-200ms'
-          build-node: 'onf-pod1-head-node'
-          time-trigger: "H H/4 * * *"
-          onuPerPon: 64
-          ponPorts: 16
-          expectedOnus: 1024
-          BBSIMdelay: 200
-          # multi-adapter
-          extraHelmFlags: "--set replicas.adapter_open_onu=8"
-      - 'voltha-scale-measurements-periodic-legacy':
-          name: 'voltha-scale-measurements-periodic-1-64-200ms'
-          build-node: 'onf-pod1-head-node'
-          time-trigger: "H H/4 * * *"
-          onuPerPon: 64
-          ponPorts: 1
-          expectedOnus: 64
-          BBSIMdelay: 200
-      - 'voltha-scale-measurements-periodic-legacy':
-          name: 'voltha-scale-measurements-periodic-2-OLTs-10-10-200ms'
-          build-node: 'onf-pod1-head-node'
-          time-trigger: "H H/4 * * *"
-          onuPerPon: 10
-          ponPorts: 10
-          numOfBbsim: 2
-          expectedOnus: 200
-          BBSIMdelay: 200
-      - 'voltha-scale-measurements-periodic-legacy':
-          name: 'voltha-scale-measurements-periodic-10-20-200ms-with-flows'
-          build-node: 'onf-pod1-head-node'
-          time-trigger: "H H/4 * * *"
-          onuPerPon: 20
-          ponPorts: 10
-          expectedOnus: 200
-          BBSIMdelay: 200
-          withOnosApps: true
-          flowStatInterval: 5
-          portsStatInterval: 5
-          expectedFlows: 201
-          bbsimAuth: false
-          bbsimDhcp: false
-
       # new Jobs
       # name format is <job-template>-<olts>-<pon>-<onus>-<setup>
       # needed for comparison with the openonu-go adapter
@@ -222,201 +162,6 @@
           build-node: 'voltha-scale'
 
 - job-template:
-    id: 'voltha-scale-measurements-periodic-legacy'
-    name: '{name}'
-    pipeline-script: 'voltha-scale-measurements.groovy'
-
-    description: |
-      <!-- Managed by Jenkins Job Builder -->
-      Created by {id} job-template from ci-management/jjb/voltha-scale.yaml  <br /><br />
-      Using pipeline {pipeline-script} <br/><br/>
-      Scale measurements for VOLTHA 2.x
-
-    properties:
-      - cord-infra-properties:
-          build-days-to-keep: '{build-days-to-keep}'
-          artifact-num-to-keep: '{artifact-num-to-keep}'
-
-    wrappers:
-      - lf-infra-wrappers:
-          build-timeout: '{build-timeout}'
-          jenkins-ssh-credential: '{jenkins-ssh-credential}'
-
-    # default parameters
-    bbsimImg: voltha/bbsim:master
-    bbsimChart: onf/bbsim
-    volthaImg: voltha/voltha-rw-core:master
-    ofAgentImg: voltha/voltha-ofagent-go:master
-    volthaChart: onf/voltha
-    openoltAdapterImg:  voltha/voltha-openolt-adapter:master
-    openoltAdapterChart: onf/voltha-adapter-openolt
-    openonuAdapterImg: voltha/voltha-openonu-adapter:master
-    openonuAdapterChart: onf/voltha-adapter-openonu
-    onosImg: voltha/voltha-onos:master
-    extraHelmFlags: ''
-    withMibTemplate: true
-    numOfBbsim: 1
-    numOfKafka: 3
-    withOnosApps: false
-    setLinkDiscovery: false
-    flowStatInterval: 600
-    portsStatInterval: 600
-    expectedFlows: 0 # by defualt ONOS apps are deactivated
-    bbsimAuth: true
-    bbsimDhcp: true
-
-    parameters:
-      - string:
-          name: buildNode
-          default: '{build-node}'
-          description: 'Name of the Jenkins node to run the job on'
-
-      - string:
-          name: logLevel
-          default: 'WARN'
-          description: 'Log level for all the components'
-
-      - string:
-          name: onuPerPon
-          default: '{onuPerPon}'
-          description: 'Number of ONUs to provision'
-
-      - string:
-          name: ponPorts
-          default: '{ponPorts}'
-          description: 'Number of PONs to provision'
-
-      - string:
-          name: expectedOnus
-          default: '{expectedOnus}'
-          description: 'Expected number of activated ONUs'
-
-      - string:
-          name: expectedFlows
-          default: '{expectedFlows}'
-          description: 'Expected number of flows in ONOS'
-
-      - string:
-          name: pollInterval
-          default: 5
-          description: 'Sleep time between ONU activation checks'
-
-      - bool:
-          name: withOnosApps
-          default: '{withOnosApps}'
-          description: 'Option to deactivate certain ONOS apps'
-
-      - bool:
-          name: withMibTemplate
-          default: '{withMibTemplate}'
-          description: 'Option to trigger MIB template command'
-
-      - bool:
-          name: setLinkDiscovery
-          default: '{setLinkDiscovery}'
-          description: 'Option to toggle Link Discovery'
-
-      - string:
-          name: BBSIMdelay
-          default: '{BBSIMdelay}'
-          description: 'BBSIM Delay, milliseconds'
-
-      - string:
-          name: flowStatInterval
-          default: '{flowStatInterval}'
-          description: 'Flow Stats Collection Interval, milliseconds'
-
-      - string:
-          name: portsStatInterval
-          default: {portsStatInterval}
-          description: 'Ports Stats Collection Interval, milliseconds'
-
-      - bool:
-          name: bbsimAuth
-          default: '{bbsimAuth}'
-          description: 'Option to toggle BBSIM EAPOL true/false'
-
-      - bool:
-          name: bbsimDhcp
-          default: '{bbsimDhcp}'
-          description: 'Option to toggle BBSIM DHCP true/false'
-
-      - string:
-          name: bbsimImg
-          default: '{bbsimImg}'
-          description: 'Custom image selection for BBSIM (repo:tag)'
-
-      - string:
-          name: bbsimChart
-          default: '{bbsimChart}'
-          description: 'BBSim chart name (or location on file system)'
-
-      - string:
-          name: volthaImg
-          default: '{volthaImg}'
-          description: 'Custom image selection for VOLTHA (repo:tag)'
-
-      - string:
-          name: ofAgentImg
-          default: '{ofAgentImg}'
-          description: 'Custom image selection for OfAgent (repo:tag), only supports the go version'
-
-      - string:
-          name: volthaChart
-          default: '{volthaChart}'
-          description: 'VOLTHA chart name (or location on file system)'
-
-      - string:
-          name: openoltAdapterImg
-          default: '{openoltAdapterImg}'
-          description: 'Custom image selection for Openolt Adapter (repo:tag)'
-
-      - string:
-          name: openoltAdapterChart
-          default: '{openoltAdapterChart}'
-          description: 'OpenOLT chart name (or location on file system)'
-
-      - string:
-          name: openonuAdapterImg
-          default: '{openonuAdapterImg}'
-          description: 'Custom image selection for Openonu Adapter (repo:tag)'
-
-      - string:
-          name: openonuAdapterChart
-          default: '{openonuAdapterChart}'
-          description: 'OpenONU chart name (or location on file system)'
-
-      - string:
-          name: onosImg
-          default: '{onosImg}'
-          description: 'Custom image selection for Openonu Adapter (repo:tag)'
-
-      - string:
-          name: extraHelmFlags
-          default: '{extraHelmFlags}'
-          description: 'Any extra helm parameters you want (passed to every helm install command)'
-
-      - string:
-          name: numOfBbsim
-          default: '{numOfBbsim}'
-          description: 'How many BBSim instances to run'
-
-      - string:
-          name: numOfKafka
-          default: '{numOfKafka}'
-          description: 'How many Kafka instances to run'
-
-    project-type: pipeline
-    concurrent: false
-
-    dsl: !include-raw-escape: pipeline/{pipeline-script}
-
-    triggers:
-      - timed: |
-                 TZ=America/Los_Angeles
-                 {time-trigger}
-
-- job-template:
     id: 'voltha-scale-measurements'
     name: '{name}'
     pipeline-script: 'voltha-scale-test.groovy'