OpenOnuAdapter: Backport SW-Upgrade tests

Change-Id: I0ee7552add2e1489fd725e4c23dd8a5cd82056fe
diff --git a/jjb/pipeline/voltha/voltha-2.8/software-upgrades.groovy b/jjb/pipeline/voltha/voltha-2.8/software-upgrades.groovy
old mode 100644
new mode 100755
index 9b59ae5..c4c7045
--- a/jjb/pipeline/voltha/voltha-2.8/software-upgrades.groovy
+++ b/jjb/pipeline/voltha/voltha-2.8/software-upgrades.groovy
@@ -33,7 +33,12 @@
       _TAG=kail-${name} kail -n ${infraNamespace} -n ${volthaNamespace} > ${logsDir}/onos-voltha-startup-combined.log &
       """
       def extraHelmFlags = extraHelmFlags.trim()
-      extraHelmFlags = " --set global.log_level=${logLevel.toUpperCase()},onu=1,pon=1 --set onos-classic.replicas=3,onos-classic.atomix.replicas=3 " + extraHelmFlags
+      if ("${name}" == "onos-app-upgrade" || "${name}" == "onu-software-upgrade" || "${name}" == "voltha-component-upgrade" || "${name}" == "voltha-component-rolling-upgrade") {
+          extraHelmFlags = " --set global.log_level=${logLevel.toUpperCase()},onu=1,pon=1 --set onos-classic.replicas=3,onos-classic.atomix.replicas=3 " + extraHelmFlags
+      }
+      if ("${name}" == "onu-image-dwl-simultaneously") {
+          extraHelmFlags = " --set global.log_level=${logLevel.toUpperCase()},onu=2,pon=2 --set onos-classic.replicas=3,onos-classic.atomix.replicas=3 " + extraHelmFlags
+      }
 
       extraHelmFlags = " --set onos-classic.onosSshPort=30115 --set onos-classic.onosApiPort=30120 " + extraHelmFlags
       extraHelmFlags = " --set voltha.onos_classic.replicas=3 " + extraHelmFlags
@@ -44,13 +49,17 @@
          split = onosImg.split(':')
         extraHelmFlags = extraHelmFlags + " --set onos-classic.image.repository=" + split[0] +",onos-classic.image.tag=" + split[1] + " "
       }
+      def olts = 1
+      if ("${name}" == "onu-image-dwl-simultaneously") {
+          olts = 2
+      }
       def localCharts = false
       if (branch != "master") {
          localCharts = true
       }
       // Currently only testing with ATT workflow
       // TODO: Support for other workflows
-      volthaDeploy([workflow: "att", extraHelmFlags: extraHelmFlags, localCharts: localCharts])
+      volthaDeploy([bbsimReplica: olts.toInteger(), workflow: "att", extraHelmFlags: extraHelmFlags, localCharts: localCharts])
       // stop logging
       sh """
         P_IDS="\$(ps e -ww -A | grep "_TAG=kail-${name}" | grep -v grep | awk '{print \$1}')"
@@ -76,7 +85,7 @@
     }
   }
   stage('Test - '+ name) {
-    timeout(20) {
+    timeout(60) {
       sh """
         ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/${name}"
         mkdir -p \$ROBOT_LOGS_DIR
@@ -127,6 +136,10 @@
           export ROBOT_MISC_ARGS="-d \$ROBOT_LOGS_DIR -v image_version:${onuImageVersion.trim()} -v image_url:${onuImageUrl.trim()} -v image_vendor:${onuImageVendor.trim()} -v image_activate_on_success:${onuImageActivateOnSuccess.trim()} -v image_commit_on_success:${onuImageCommitOnSuccess.trim()} -v image_crc:${onuImageCrc.trim()} -e PowerSwitch"
           export TARGET=onu-upgrade-test
         fi
+        if [[ ${name} == 'onu-image-dwl-simultaneously' ]]; then
+          export ROBOT_MISC_ARGS="-d \$ROBOT_LOGS_DIR -v image_version:${onuImageVersion.trim()} -v image_url:${onuImageUrl.trim()} -v image_vendor:${onuImageVendor.trim()} -v image_activate_on_success:${onuImageActivateOnSuccess.trim()} -v image_commit_on_success:${onuImageCommitOnSuccess.trim()} -v image_crc:${onuImageCrc.trim()} -e PowerSwitch"
+          export TARGET=onu-upgrade-test-multiolt-kind-att
+        fi
         testLogging='False'
         if [ ${logging} = true ]; then
           testLogging='True'
@@ -177,7 +190,7 @@
     label "${params.buildNode}"
   }
   options {
-    timeout(time: 60, unit: 'MINUTES')
+    timeout(time: 120, unit: 'MINUTES')
   }
   environment {
     PATH="$PATH:$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
@@ -214,6 +227,7 @@
         test_software_upgrade("onos-app-upgrade")
         test_software_upgrade("voltha-component-upgrade")
         test_software_upgrade("onu-software-upgrade")
+        test_software_upgrade("onu-image-dwl-simultaneously")
       }
     }
   }