Merge "Creating base tests for voltha-go-controller repository"
diff --git a/jjb/pipeline/voltha/master/dmi-build-and-test.groovy b/jjb/pipeline/voltha/master/dmi-build-and-test.groovy
index 3138e81..afa034f 100755
--- a/jjb/pipeline/voltha/master/dmi-build-and-test.groovy
+++ b/jjb/pipeline/voltha/master/dmi-build-and-test.groovy
@@ -93,11 +93,6 @@
       }
     }
     stage('Install Voltha')  {
-      when {
-        expression {
-          return installVoltha.toBoolean()
-        }
-      }
       steps {
         timeout(20) {
           installVoltctl("${branch}")
@@ -156,14 +151,18 @@
               etcdReplica: params.NumOfEtcd,
               bbsimReplica: bbsimReplicas.toInteger(),
               adaptersToWait: numberOfAdaptersToWait,
+              withVolthaInfra: installVolthaInfra.toBoolean(),
+              withVolthaStack: installVolthaStack.toBoolean(),
               ])
 
-            if(openoltAdapterChart != "onf/voltha-adapter-openolt"){
-              extraHelmFlags = extraHelmFlags + " --set global.log_level=${logLevel}"
-              deploy_custom_chart(volthaNamespace, oltAdapterReleaseName, openoltAdapterChart, extraHelmFlags)
-              waitForAdapters([
-                adaptersToWait: 2
-              ])
+            if(installVolthaStack.toBoolean()) {
+              if(openoltAdapterChart != "onf/voltha-adapter-openolt"){
+                extraHelmFlags = extraHelmFlags + " --set global.log_level=${logLevel}"
+                deploy_custom_chart(volthaNamespace, oltAdapterReleaseName, openoltAdapterChart, extraHelmFlags)
+                waitForAdapters([
+                  adaptersToWait: 2
+                ])
+              }
             }
           }
           sh """
diff --git a/jjb/pipeline/voltha/master/voltha-dt-physical-functional-tests.groovy b/jjb/pipeline/voltha/master/voltha-dt-physical-functional-tests.groovy
index d2a01e8..26ff325 100644
--- a/jjb/pipeline/voltha/master/voltha-dt-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha/master/voltha-dt-physical-functional-tests.groovy
@@ -151,6 +151,9 @@
         mkdir -p $ROBOT_LOGS_DIR
         if ( ${powerSwitch} ); then
              export ROBOT_MISC_ARGS="--removekeywords wuks -i PowerSwitch -i sanityDt -i functionalDt -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}"
+             if ( ${powerCycleOlt} ); then
+                  ROBOT_MISC_ARGS+=" -v power_cycle_olt:True"
+             fi
         else
              export ROBOT_MISC_ARGS="--removekeywords wuks -e PowerSwitch -i sanityDt -i functionalDt -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}"
         fi
diff --git a/jjb/pipeline/voltha/master/voltha-physical-functional-tests.groovy b/jjb/pipeline/voltha/master/voltha-physical-functional-tests.groovy
index b931f34..afc0127 100644
--- a/jjb/pipeline/voltha/master/voltha-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha/master/voltha-physical-functional-tests.groovy
@@ -130,6 +130,9 @@
         mkdir -p $ROBOT_LOGS_DIR
         if ( ${powerSwitch} ); then
              export ROBOT_MISC_ARGS="--removekeywords wuks -i PowerSwitch -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 -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}"
+             if ( ${powerCycleOlt} ); then
+                  ROBOT_MISC_ARGS+=" -v power_cycle_olt:True"
+             fi
         else
              export ROBOT_MISC_ARGS="--removekeywords wuks -e PowerSwitch -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 -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}"
         fi
diff --git a/jjb/pipeline/voltha/master/voltha-tt-physical-functional-tests.groovy b/jjb/pipeline/voltha/master/voltha-tt-physical-functional-tests.groovy
index 93f1f24..90470f5 100644
--- a/jjb/pipeline/voltha/master/voltha-tt-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha/master/voltha-tt-physical-functional-tests.groovy
@@ -135,6 +135,9 @@
         mkdir -p $ROBOT_LOGS_DIR
         if ( ${powerSwitch} ); then
              export ROBOT_MISC_ARGS="--removekeywords wuks -i functionalTT -i PowerSwitch -i sanityTT -i sanityTT-MCAST -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}"
+             if ( ${powerCycleOlt} ); then
+                  ROBOT_MISC_ARGS+=" -v power_cycle_olt:True"
+             fi
         else
              export ROBOT_MISC_ARGS="--removekeywords wuks -i functionalTT -e PowerSwitch -i sanityTT -i sanityTT-MCAST -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}"
         fi
diff --git a/jjb/software-upgrades.yaml b/jjb/software-upgrades.yaml
index ac458ac..65991c5 100644
--- a/jjb/software-upgrades.yaml
+++ b/jjb/software-upgrades.yaml
@@ -14,7 +14,7 @@
           aaa-version: '2.6.0.SNAPSHOT'
           aaa-oar-url: 'https://oss.sonatype.org/content/groups/public/org/opencord/aaa-app/2.6.0-SNAPSHOT/aaa-app-2.6.0-20220318.145620-3.oar'
           olt-version: '5.1.0.SNAPSHOT'
-          olt-oar-url: 'https://oss.sonatype.org/content/groups/public/org/opencord/olt-app/5.1.0-SNAPSHOT/olt-app-5.1.0-20220323.183932-13.oar'
+          olt-oar-url: 'https://oss.sonatype.org/content/groups/public/org/opencord/olt-app/5.1.0-SNAPSHOT/olt-app-5.1.0-20220503.122002-14.oar'
           dhcpl2relay-version: '2.7.0.SNAPSHOT'
           dhcpl2relay-oar-url: 'https://oss.sonatype.org/content/groups/public/org/opencord/dhcpl2relay-app/2.7.0-SNAPSHOT/dhcpl2relay-app-2.7.0-20220318.145606-4.oar'
           igmpproxy-version: '2.5.0.SNAPSHOT'
@@ -26,9 +26,9 @@
           kafka-version: '2.9.0.SNAPSHOT'
           kafka-oar-url: 'https://oss.sonatype.org/content/groups/public/org/opencord/kafka/2.9.0-SNAPSHOT/kafka-2.9.0-20220324.143019-4.oar'
           openolt-adapter-deploy-base-tag: '4.2.2'
-          openonu-adapter-deploy-base-tag: '2.2.2'
-          rw-core-deploy-base-tag: '3.1.0'
-          ofagent-deploy-base-tag: '2.1.1'
+          openonu-adapter-deploy-base-tag: '2.2.3'
+          rw-core-deploy-base-tag: '3.1.2'
+          ofagent-deploy-base-tag: '2.1.2'
           onu-image-version: 'BBSM_IMG_00002'
           onu-image-url: 'http://bbsim0:50074/images/software-image.img'
           onu-image-vendor: 'BBSM'
diff --git a/jjb/voltha-e2e.yaml b/jjb/voltha-e2e.yaml
index 3cb11f9..6c964e6 100755
--- a/jjb/voltha-e2e.yaml
+++ b/jjb/voltha-e2e.yaml
@@ -1282,7 +1282,7 @@
           build-node: 'ubuntu18.04-basebuild-4c-8g'
           code-branch: 'master'
           time-trigger: "@daily"
-          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master'
+          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master '
           testTargets: |
             - target: functional-single-kind-dt
               workflow: dt
diff --git a/jjb/voltha-test/voltha-certification.yaml b/jjb/voltha-test/voltha-certification.yaml
index 3f69ec5..f4802d8 100644
--- a/jjb/voltha-test/voltha-certification.yaml
+++ b/jjb/voltha-test/voltha-certification.yaml
@@ -10,6 +10,7 @@
 
     with-kind: false
     power-switch: False
+    power-cycle-olt: False
     work-flow: 'ATT'
     in-band-management: false
     num-of-openonu: 1
diff --git a/jjb/voltha-test/voltha-nightly-jobs.yaml b/jjb/voltha-test/voltha-nightly-jobs.yaml
index 0d07a91..30a2194 100644
--- a/jjb/voltha-test/voltha-nightly-jobs.yaml
+++ b/jjb/voltha-test/voltha-nightly-jobs.yaml
@@ -387,6 +387,11 @@
           default: '{power-switch}'
           description: "Indicate whether POD has power switch to reboot ONUs/OLT remotely"
 
+      - bool:
+          name: powerCycleOlt
+          default: '{power-cycle-olt}'
+          description: "Indicate whether to reboot OLT through power switch"
+
       - string:
           name: oltAdapterAppLabel
           default: '{oltAdapterAppLabel}'
@@ -514,6 +519,11 @@
           default: '{power-switch}'
           description: "Indicate whether POD has power switch to reboot ONUs/OLT remotely"
 
+      - bool:
+          name: powerCycleOlt
+          default: '{power-cycle-olt}'
+          description: "Indicate whether to reboot OLT through power switch"
+
       - string:
           name: oltAdapterAppLabel
           default: '{oltAdapterAppLabel}'
@@ -646,6 +656,11 @@
           description: "Indicate whether POD has power switch to reboot ONUs/OLT remotely"
 
       - bool:
+          name: powerCycleOlt
+          default: '{power-cycle-olt}'
+          description: "Indicate whether to reboot OLT through power switch"
+
+      - bool:
           name: enableMultiUni
           default: '{enableMultiUni}'
           description: "Enables the Multi UNI feature"
@@ -694,7 +709,8 @@
     <<: *voltha-pipe-job-boiler-plate
     # default values
     pipeline-script: 'voltha/master/dmi-build-and-test.groovy'
-    installVoltha: true
+    installVolthaInfra: true
+    installVolthaStack: true
     VolthaEtcdPort: 2379
     num-of-openonu: 1
     num-of-onos: 3
@@ -787,9 +803,14 @@
           description: 'Installs and uses the specified work flow on the POD'
 
       - bool:
-          name: installVoltha
-          default: '{installVoltha}'
-          description: "Whether to install VOLTHA"
+          name: installVolthaInfra
+          default: '{installVolthaInfra}'
+          description: "Whether to install VOLTHA Infra"
+
+      - bool:
+          name: installVolthaStack
+          default: '{installVolthaStack}'
+          description: "Whether to install VOLTHA Stack"
 
       - string:
           name: extraHelmFlags
diff --git a/jjb/voltha-test/voltha.yaml b/jjb/voltha-test/voltha.yaml
index 51a6afd..19c9383 100644
--- a/jjb/voltha-test/voltha.yaml
+++ b/jjb/voltha-test/voltha.yaml
@@ -10,6 +10,7 @@
 
     with-kind: false
     power-switch: False
+    power-cycle-olt: False
     work-flow: 'ATT'
     in-band-management: false
     num-of-openonu: '1'
@@ -73,6 +74,7 @@
           release: 'master'
           branch: 'master'
           power-switch: True
+          power-cycle-olt: True
           test-repo: 'voltha-system-tests'
           profile: 'Default'
 
@@ -126,6 +128,7 @@
           name-extension: '_TT'
           work-flow: 'TT'
           power-switch: True
+          power-cycle-olt: True
           pipeline-script: 'voltha/master/voltha-tt-physical-functional-tests.groovy'
           test-repo: 'voltha-system-tests'
           profile: 'TP'
@@ -189,6 +192,7 @@
           name-extension: '_TT'
           work-flow: 'TT'
           power-switch: True
+          power-cycle-olt: True
           pipeline-script: 'voltha/master/voltha-tt-physical-functional-tests.groovy'
           test-repo: 'voltha-system-tests'
           profile: 'TP'
@@ -198,6 +202,7 @@
       - 'build_voltha_pod_release_timer':
           build-node: 'menlo-demo-pod'
           config-pod: 'onf-demo-pod'
+          'disable-job': true
           profile: '1T4GEM'
           num-of-onos: '3'
           num-of-atomix: '3'
@@ -211,16 +216,19 @@
           timeout: 300
           build-node: 'menlo-demo-pod'
           config-pod: 'onf-demo-pod'
+          'disable-job': true
           release: 'master'
           branch: 'master'
           test-repo: 'voltha-system-tests'
           profile: '1T4GEM'
           power-switch: True
+          power-cycle-olt: True
 
       # Menlo pod with olt/onu - master branch,  Default tech profile and timer based job
       - 'build_voltha_pod_release_timer':
           build-node: 'menlo-demo-pod'
           config-pod: 'onf-demo-pod'
+          'disable-job': true
           name-extension: '_DT'
           work-flow: 'DT'
           profile: '1T8GEM'
@@ -236,6 +244,7 @@
           timeout: 330
           build-node: 'menlo-demo-pod'
           config-pod: 'onf-demo-pod'
+          'disable-job': true
           release: 'master'
           branch: 'master'
           name-extension: '_DT'
@@ -244,6 +253,7 @@
           profile: '1T8GEM'
           pipeline-script: 'voltha/master/voltha-dt-physical-functional-tests.groovy'
           power-switch: True
+          power-cycle-olt: True
 
       # Menlo pod with olt/onu - released branch,  Default tech profile and timer based job
       - 'build_voltha_pod_release_timer':
@@ -281,6 +291,7 @@
       - 'build_voltha_pod_release_timer':
           build-node: 'menlo-demo-pod'
           config-pod: 'onf-demo-pod'
+          'disable-job': true
           release: '2.9'
           branch: 'voltha-2.9'
           profile: '1T4GEM'
@@ -297,6 +308,7 @@
           timeout: 300
           build-node: 'menlo-demo-pod'
           config-pod: 'onf-demo-pod'
+          'disable-job': true
           release: '2.9'
           branch: 'voltha-2.9'
           test-repo: 'voltha-system-tests'
@@ -583,7 +595,8 @@
           release: 'master'
           branch: 'master'
           profile: 'Default'
-          installVoltha: false
+          installVolthaInfra: true
+          installVolthaStack: false
           reinstall-olt: false
           restart-olt: false
           extraHelmFlags: " -f /home/community/SDX_Device_Manager_21.4/helm/values-onf.yaml "
diff --git a/vars/volthaDeploy.groovy b/vars/volthaDeploy.groovy
index 7936e5a..aad754b 100644
--- a/vars/volthaDeploy.groovy
+++ b/vars/volthaDeploy.groovy
@@ -19,6 +19,8 @@
       localCharts: false, // wether to use locally cloned charts or upstream one (for local we assume they are stored in $WORKSPACE/voltha-helm-charts)
       dockerRegistry: "", // use a different docker registry for all images, eg: "mirror.registry.opennetworking.org"
       kubeconfig: null, // location of the kubernetes config file, if null we assume it's stored in the $KUBECONFIG environment variable
+      withVolthaInfra: true,
+      withVolthaStack: true,
     ]
 
     if (!config) {
@@ -50,7 +52,11 @@
 
     println "Deploying VOLTHA with the following parameters: ${cfg}."
 
-    volthaInfraDeploy(cfg)
+    if (cfg.withVolthaInfra) {
+      volthaInfraDeploy(cfg)
+    }
 
-    volthaStackDeploy(cfg)
+    if (cfg.withVolthaStack) {
+      volthaStackDeploy(cfg)
+    }
 }