[VOL-2585] Variable refrences fixed - awk

Change-Id: I13213eaf6e914116ca81e7e58865e224c1f6a64e
diff --git a/jjb/pipeline/voltha-scale-measurements.groovy b/jjb/pipeline/voltha-scale-measurements.groovy
index d7aad03..02a4f8d 100644
--- a/jjb/pipeline/voltha-scale-measurements.groovy
+++ b/jjb/pipeline/voltha-scale-measurements.groovy
@@ -10,11 +10,12 @@
     PATH="$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
     TYPE="minimal"
     FANCY=0
+    SECONDS=0
     WITH_SIM_ADAPTERS="n"
     WITH_RADIUS="y"
     WITH_BBSIM="y"
     DEPLOY_K8S="y"
-    VOLTHA_LOG_LEVEL="DEBUG"
+    VOLTHA_LOG_LEVEL="WARN"
     CONFIG_SADIS="n"
     ROBOT_MISC_ARGS="-d $WORKSPACE/RobotLogs -v teardown_device:False"
     SSHPASS="karaf"
@@ -51,7 +52,7 @@
         sh '''
           cd kind-voltha
 
-          EXTRA_HELM_FLAGS="--set onu=${onuCount},pon=${ponCount}" ./voltha up
+          EXTRA_HELM_FLAGS="--set onu=${onuPerPon},pon=${ponPorts},delay=${BBSIMdelay}" ./voltha up
 
           '''
       }
@@ -59,9 +60,9 @@
     stage('MIB-template') {
       steps {
         sh '''
-          if [ "$withMibTemplate" = true ] ; then
+          if [ ${withMibTemplate} = true ] ; then
             git clone https://github.com/opencord/voltha-openonu-adapter.git
-            cat voltha-openonu-adapter/templates/BBSM-12345123451234512345-00000000000001-v1.json | kubectl exec -it -n voltha $(kubectl get pods -n voltha | grep etcd-cluster | awk 'NR==1{print $1}') etcdctl put service/voltha/omci_mibs/templates/BBSM/12345123451234512345/00000000000001
+            cat voltha-openonu-adapter/templates/BBSM-12345123451234512345-00000000000001-v1.json | kubectl exec -it -n voltha $(kubectl get pods -n voltha | grep etcd-cluster | awk 'NR==1{print $1') etcdctl put service/voltha/omci_mibs/templates/BBSM/12345123451234512345/00000000000001
             rm -rf voltha-openonu-adapter
           fi
         '''
@@ -71,7 +72,7 @@
       steps {
          sh '''
           #Check withOnosApps and disable apps accordingly
-          if [ "$withOnosApps" = false ] ; then
+          if [ ${withOnosApps} = false ] ; then
             sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@localhost app deactivate org.opencord.olt
             sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@localhost app deactivate org.opencord.aaa
             sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@localhost app deactivate org.opencord.dhcpl2relay
@@ -79,10 +80,25 @@
          '''
       }
     }
+    stage('configuration') {
+      steps {
+        sh '''
+          #Setting LOG level to WARN
+          sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@localhost log:set WARN
+          #kubectl exec -n voltha $(kubectl get pods -n voltha | 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 8101 karaf@localhost cfg set org.onosproject.provider.lldp.impl.LldpLinkProvider enabled ${setLinkDiscovery}
+          #Setting the flow stats collection interval
+          sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@localhost cfg set org.onosproject.provider.of.flow.impl.OpenFlowRuleProvider flowPollFrequency ${flowStatInterval}
+          #Setting the ports stats collection interval
+          sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@localhost cfg set org.onosproject.provider.of.device.impl.OpenFlowDeviceProvider portStatsPollFrequency ${portsStatInterval}
+        '''
+      }
+    }
     stage('activate-ONUs') {
       steps {
         sh '''
-          if [ -z "$onuTarget" ]
+          if [ -z ${expectedOnus} ]
           then
             echo -e "You need to set the target ONU number\n"
             exit 1
@@ -90,19 +106,16 @@
 
           voltctl device create -t openolt -H bbsim:50060
           voltctl device enable $(voltctl device list --filter Type~openolt -q)
-          SECONDS=0
 
           # check ONUs reached Active State in VOLTHA
           i=$(voltctl device list | grep -v OLT | grep ACTIVE | wc -l)
-          until [ $i -eq $onuTarget ]
+          until [ $i -eq ${expectedOnus} ]
           do
-            echo "$i ONUs ACTIVE of $onuTarget expected (time: $SECONDS)"
-            sleep $pollInterval
+            echo "$i ONUs ACTIVE of ${expectedOnus} expected (time: $SECONDS)"
+            sleep ${pollInterval}
             i=$(voltctl device list | grep -v OLT | grep ACTIVE | wc -l)
           done
-          echo "$onuTarget ONUs Activated in $SECONDS seconds (time: $SECONDS)"
-          #exit 0
-
+          echo "${expectedOnus} ONUs Activated in $SECONDS seconds (time: $SECONDS)"
         '''
       }
     }
@@ -111,13 +124,13 @@
         sh '''    
           # Check ports showed up in ONOS
           z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@localhost ports -e | grep BBSM | wc -l)
-          until [ $z -eq "$onuTarget" ]
+          until [ $z -eq ${expectedOnus} ]
           do
-            echo "${z} enabled ports of "$onuTarget" expected (time: $SECONDS)"
-            sleep $pollInterval
+            echo "${z} enabled ports of ${expectedOnus} expected (time: $SECONDS)"
+            sleep ${pollInterval}
             z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@localhost ports -e | grep BBSM | wc -l)
           done
-          echo "$onuTarget ports enabled in $SECONDS seconds (time: $SECONDS)"
+          echo "${expectedOnus} ports enabled in $SECONDS seconds (time: $SECONDS)"
         '''
       }
     }