[VOL-4566] Add UNIs number and mibTramplateUrl parameters to scale

Change-Id: If626c48bc2615f790a6e0b2002e942a91c21f8dd
diff --git a/jjb/pipeline/voltha/master/voltha-scale-test.groovy b/jjb/pipeline/voltha/master/voltha-scale-test.groovy
index f89349c..bdee200 100644
--- a/jjb/pipeline/voltha/master/voltha-scale-test.groovy
+++ b/jjb/pipeline/voltha/master/voltha-scale-test.groovy
@@ -212,7 +212,7 @@
               fi
 
               # set BBSim parameters
-              EXTRA_HELM_FLAGS+='--set enablePerf=true,pon=${pons},onu=${onus} '
+              EXTRA_HELM_FLAGS+='--set enablePerf=true,pon=${pons},onu=${onus},uni=${unis} '
 
               # disable the securityContext, this is a development cluster
               EXTRA_HELM_FLAGS+='--set securityContext.enabled=false '
@@ -280,7 +280,7 @@
               etcdReplica: etcdReplicas,
             ])
 
-            stackHelmFlags = " --set onu=${onus},pon=${pons} --set global.log_level=${logLevel.toLowerCase()} "
+            stackHelmFlags = " --set onu=${onus},pon=${pons},uni=${unis} --set global.log_level=${logLevel.toLowerCase()} "
             stackHelmFlags += " --set voltha.ingress.enabled=true --set voltha.ingress.enableVirtualHosts=true --set voltha.fullHostnameOverride=voltha.scale1.dev "
             stackHelmFlags += extraHelmFlags + " " + params.extraHelmFlags
 
@@ -404,8 +404,8 @@
       steps {
         sh """
         # load MIB template
-        wget https://raw.githubusercontent.com/opencord/voltha-openonu-adapter-go/master/templates/BBSM-12345123451234512345-BBSM_IMG_00001-v1.json
-        cat BBSM-12345123451234512345-BBSM_IMG_00001-v1.json | kubectl exec -it \$(kubectl get pods |grep etcd-0 | awk 'NR==1{print \$1}') -- etcdctl put service/voltha/omci_mibs/go_templates/BBSM/12345123451234512345/BBSM_IMG_00001
+        wget ${mibTemplateUrl} -O mibTemplate.json
+        cat mibTemplate.json | kubectl exec -it \$(kubectl get pods |grep etcd-0 | awk 'NR==1{print \$1}') -- etcdctl put service/voltha/omci_mibs/go_templates/BBSM/12345123451234512345/BBSM_IMG_00001
         """
       }
     }
@@ -750,7 +750,7 @@
           [file: 'plots/plot-onos-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
           [file: 'plots/plot-onos-dhcp.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
         ],
-        group: 'Voltha-Scale-Numbers', numBuilds: '20', style: 'line', title: "Scale Test (OLTs: ${olts}, PONs: ${pons}, ONUs: ${onus})", yaxis: 'Time (s)', useDescr: true
+        group: 'Voltha-Scale-Numbers', numBuilds: '20', style: 'line', title: "Scale Test (OLTs: ${olts}, PONs: ${pons}, ONUs: ${onus}, UNIs: ${unis})", yaxis: 'Time (s)', useDescr: true
       ])
       script {
         try {
diff --git a/jjb/voltha-scale.yaml b/jjb/voltha-scale.yaml
index 205ae5e..aba2803 100644
--- a/jjb/voltha-scale.yaml
+++ b/jjb/voltha-scale.yaml
@@ -152,6 +152,7 @@
           olts: 2
           pons: 64
           onus: 32
+          unis: 1
           withFlows: true
           provisionSubscribers: true
           workflow: dt
@@ -160,7 +161,8 @@
           withIgmp: false
           onosImg: andreacampanella/voltha-onos:4k-dev
           withMibTemplate: false
-          extraHelmFlags: '-f /home/jenkins/voltha-scale/voltha-values.yaml --set uni=1 --set etcd.persistence.enabled=true,etcd.persistence.storageClass=longhorn'
+          mibTemplateUrl: 'https://raw.githubusercontent.com/opencord/voltha-openonu-adapter-go/master/templates/BBSM-12345123451234512345-BBSM_IMG_00001-v1-1UNI.json'
+          extraHelmFlags: '-f /home/jenkins/voltha-scale/voltha-values.yaml --set etcd.persistence.enabled=true,etcd.persistence.storageClass=longhorn'
 
       - 'voltha-scale-measurements':
             name: 'voltha-scale-measurements-master-1-64-63-dt-subscribers'
@@ -170,6 +172,7 @@
             olts: 1
             pons: 64
             onus: 63
+            unis: 1
             withFlows: true
             provisionSubscribers: true
             workflow: dt
@@ -178,7 +181,8 @@
             withIgmp: false
             onosImg: andreacampanella/voltha-onos:4k-dev
             withMibTemplate: false
-            extraHelmFlags: '-f /home/jenkins/voltha-scale/voltha-values.yaml --set uni=1 --set etcd.persistence.enabled=true,etcd.persistence.storageClass=longhorn -f /home/cord/dt-custom-values.yaml'
+            mibTemplateUrl: 'https://raw.githubusercontent.com/opencord/voltha-openonu-adapter-go/master/templates/BBSM-12345123451234512345-BBSM_IMG_00001-v1-1UNI.json'
+            extraHelmFlags: '-f /home/jenkins/voltha-scale/voltha-values.yaml --set etcd.persistence.enabled=true,etcd.persistence.storageClass=longhorn -f /home/cord/dt-custom-values.yaml'
 
       - 'voltha-scale-measurements':
             name: 'voltha-scale-measurements-master-1-64-63-tt-subscribers'
@@ -188,6 +192,7 @@
             olts: 1
             pons: 64
             onus: 63
+            unis: 1
             withFlows: true
             provisionSubscribers: true
             workflow: tt
@@ -196,7 +201,8 @@
             withIgmp: true
             onosImg: andreacampanella/voltha-onos:4k-dev
             withMibTemplate: false
-            extraHelmFlags: '-f /home/jenkins/voltha-scale/voltha-values.yaml --set uni=1 --set etcd.persistence.enabled=true,etcd.persistence.storageClass=longhorn -f /home/cord/dt-custom-values.yaml'
+            mibTemplateUrl: 'https://raw.githubusercontent.com/opencord/voltha-openonu-adapter-go/master/templates/BBSM-12345123451234512345-BBSM_IMG_00001-v1-1UNI.json'
+            extraHelmFlags: '-f /home/jenkins/voltha-scale/voltha-values.yaml --set etcd.persistence.enabled=true,etcd.persistence.storageClass=longhorn -f /home/cord/dt-custom-values.yaml'
 
       # multi-stack jobs
       - 'voltha-scale-measurements':
@@ -534,6 +540,11 @@
           description: 'Number of VOLTHA Stacks to deploy'
 
       - string:
+          name: unis
+          default: '{unis}'
+          description: 'Number of UNIs to provision'
+
+      - string:
           name: onus
           default: '{onus}'
           description: 'Number of ONUs to provision'
@@ -727,6 +738,11 @@
           name: withMibTemplate
           default: '{withMibTemplate}'
 
+      - string:
+          name: mibTemplateUrl
+          default: '{mibTemplateUrl}'
+          description: 'URL of the MIB template file to use, if "withMibTemplate" is selected'
+
 - job-template:
     id: 'voltha-scale-measurements'
     name: '{name}'
@@ -771,6 +787,7 @@
     olts: 2
     pons: 2
     onus: 2
+    unis: 4
     workflow: att
     withOnuUpgrade: false
     withFlows: false
@@ -798,6 +815,7 @@
     kindVolthaChange: ''
     inMemoryEtcdStorage: true
     withMibTemplate: true
+    mibTemplateUrl: 'https://raw.githubusercontent.com/opencord/voltha-openonu-adapter-go/master/templates/BBSM-12345123451234512345-BBSM_IMG_00001-v1.json'
     karafHome: 'apache-karaf-4.2.14'
     logLevel: 'INFO'
     testTimeout: 10
@@ -879,6 +897,7 @@
     olts: 2
     pons: 2
     onus: 2
+    unis: 4
     workflow: att
     withOnuUpgrade: false
     withFlows: true
@@ -906,6 +925,7 @@
     kindVolthaChange: ''
     inMemoryEtcdStorage: true
     withMibTemplate: true
+    mibTemplateUrl: 'https://raw.githubusercontent.com/opencord/voltha-openonu-adapter-go/master/templates/BBSM-12345123451234512345-BBSM_IMG_00001-v1.json'
     karafHome: 'apache-karaf-4.2.14'
     logLevel: 'INFO'
     testTimeout: 10