Merge "VOL-4849 Test suite: status=UNSTABLE periodic-software-upgrade-test-bbsim"
diff --git a/jjb/onos-app-release.yaml b/jjb/onos-app-release.yaml
index dd22408..5247984 100644
--- a/jjb/onos-app-release.yaml
+++ b/jjb/onos-app-release.yaml
@@ -76,4 +76,4 @@
 
     dsl: !include-raw-escape: pipeline/onos-app-release.groovy
 
-# [EOF]
+# [EOF] .
diff --git a/jjb/pipeline/onos-app-release.groovy b/jjb/pipeline/onos-app-release.groovy
index 4cd3011..cc98783 100644
--- a/jjb/pipeline/onos-app-release.groovy
+++ b/jjb/pipeline/onos-app-release.groovy
@@ -1,4 +1,4 @@
-// Copyright 2019-2023 Open Networking Foundation (ONF) and the ONF Contributors
+// Copyright 2019-2024 Open Networking Foundation (ONF) and the ONF Contributors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -21,6 +21,79 @@
 def branch = '${branch}'
 def jdkDistro = '${jdkDistro}'
 
+// -----------------------------------------------------------------------
+// Intent: Identify running script.  callstack() cannot be used here,
+//   jenkins + serialization alters stack trace making display unreliable.
+// -----------------------------------------------------------------------
+String getIam(String func) {
+    // Cannot rely on a stack trace due to jenkins manipulation
+    String src = 'jjb/pipeline/onos-app-release.groovy'
+    String iam = [src, func].join('::')
+    return iam
+}
+
+// -----------------------------------------------------------------------
+// Intent: Log progress message
+// -----------------------------------------------------------------------
+void enter(String name) {
+    // Announce ourselves for log usability
+    String iam = getIam(name)
+    println("${iam}: ENTER")
+    return
+}
+
+// -----------------------------------------------------------------------
+// Intent: Log progress message
+// -----------------------------------------------------------------------
+void leave(String name) {
+    // Announce ourselves for log usability
+    String iam = getIam(name)
+    println("${iam}: LEAVE")
+    return
+}
+
+// -----------------------------------------------------------------------
+// https://jenkins.opencord.org/job/onos-app-release/285/consoleFull
+// -----------------------------------------------------------------------
+void git_debug(String name) {
+    enter(name)
+
+    println('''
+
+** -----------------------------------------------------------------------
+** git debugging: Commit-Id string MIA
+** -----------------------------------------------------------------------
+''')
+
+    sh 'echo "PWD: $(/bin/pwd)"'
+    sh '/bin/ls -l'
+    sh 'gitdir=$(git rev-parse --git-dir) && /bin/ls -ld ${gitdir}'
+    sh 'gitdir=$(git rev-parse --git-dir) && /bin/ls -l ${gitdir}/hooks/*'
+
+    println('''
+
+** -----------------------------------------------------------------------
+** git config --list
+** -----------------------------------------------------------------------
+''')
+    sh 'git config --list'
+
+    println('''
+
+** -----------------------------------------------------------------------
+** git config --global --list
+** -----------------------------------------------------------------------
+''')
+    sh 'git config --global --list'
+
+    println('\nWANTED: git config --bool --get gerrit.createChangeId')
+    sh '''git config --bool --get gerrit.createChangedId' && echo "gerrit.createChangedId=[$?]'''
+
+    leave(name)
+
+    return
+}
+
 // This pipeline updates the <version> tag in the root pom.xml for the
 // given app repo, and pushes two new Gerrit changes:
 //   1) With version the given ${version} (e.g., 1.0.0)
@@ -78,7 +151,7 @@
     sshagent (credentials: ['gerrit-jenkins-user']) {
       git branch: branch, url: 'ssh://jenkins@gerrit.opencord.org:29418/' + appRepo, credentialsId: 'gerrit-jenkins-user'
 
-      sh 'gitdir=$(git rev-parse --git-dir); scp -p -P 29418 jenkins@gerrit.opencord.org:hooks/commit-msg ${gitdir}/hooks/'
+      sh 'gitdir=$(git rev-parse --git-dir) && scp -p -P 29418 jenkins@gerrit.opencord.org:hooks/commit-msg ${gitdir}/hooks/'
     }
   }
 
@@ -93,6 +166,9 @@
        sh 'echo releasing api version' + '"' + apiVersion +'"'
        changeApiVersion(appName, apiVersion)
     }
+
+        git_debug("Move to release version")
+
     sh 'git add -A && git commit -m "Release app version ' + version + ' with API version ' + apiVersion + '"'
   }
 
@@ -126,7 +202,17 @@
        sh 'echo moving to next api version' + '"' + nextApiVersion +'"'
        changeApiVersion(appName, apiSnapshot)
     }
+
+    git_debug("Move to next SNAPSHOT version")
+
     sh 'git add -A && git commit -m "Starting snapshot ' + snapshot + ' with API version ' + apiSnapshot + '"'
+
+    println("\nSnapshot commit message: branch=HEAD")
+    sh """git log -1 --pretty=format:'%b' HEAD"""
+
+    println("\nSnapshot commit message: branch=" + branch)
+    sh """git log -1 --pretty=format:'%b' """ + branch
+
     sshagent (credentials: ['gerrit-jenkins-user']) {
       sh 'git push origin HEAD:refs/for/' + branch
     }
@@ -139,3 +225,4 @@
   }
 }
 
+// [EOF]
diff --git a/jjb/pipeline/voltha/bbsim-tests.groovy b/jjb/pipeline/voltha/bbsim-tests.groovy
index 991ff5b..84752c8 100644
--- a/jjb/pipeline/voltha/bbsim-tests.groovy
+++ b/jjb/pipeline/voltha/bbsim-tests.groovy
@@ -538,6 +538,7 @@
     stages {
         stage('Download Code') {
             steps {
+                enter('getVolthaCode')
                 getVolthaCode([
                     branch: "${branch}",
                     gerritProject: "${gerritProject}",
@@ -545,6 +546,7 @@
                     volthaSystemTestsChange: "${volthaSystemTestsChange}",
                     volthaHelmChartsChange: "${volthaHelmChartsChange}",
                 ])
+                leave('getVolthaCode')
             }
         }
 
@@ -555,9 +557,11 @@
             }
 
             steps {
+                enter('buildVolthaComponent')
                 // NOTE that the correct patch has already been checked out
                 // during the getVolthaCode step
                 buildVolthaComponent("${gerritProject}")
+                leave('buildVolthaComponent')
             }
         }
 
diff --git a/jjb/repos/voltha-helm-charts.yaml b/jjb/repos/voltha-helm-charts.yaml
index 54c9caf..23d53e7 100644
--- a/jjb/repos/voltha-helm-charts.yaml
+++ b/jjb/repos/voltha-helm-charts.yaml
@@ -43,7 +43,7 @@
     name: 'verify-voltha-helm-charts-jobs-voltha-2.12'
     jobs:
       - 'voltha-patch-test':
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
 
 - job-group:
diff --git a/jjb/software-upgrades.yaml b/jjb/software-upgrades.yaml
index 96d836a..1ee9f9f 100644
--- a/jjb/software-upgrades.yaml
+++ b/jjb/software-upgrades.yaml
@@ -158,7 +158,7 @@
     description: |
       <!-- Managed by Jenkins Job Builder -->
       Created by {id} job-template from ci-management/jjb/software-upgrades.yaml  <br /><br />
-      E2E Validation for Voltha 2.X
+      E2E Validation for Voltha master
     properties:
       - onf-infra-volthadevs-permissions
       - cord-infra-properties:
diff --git a/jjb/verify/bbsim-sadis-server.yaml b/jjb/verify/bbsim-sadis-server.yaml
index e38f410..cf7bd20 100644
--- a/jjb/verify/bbsim-sadis-server.yaml
+++ b/jjb/verify/bbsim-sadis-server.yaml
@@ -41,7 +41,7 @@
     name: 'verify-bbsim-sadis-server-jobs-voltha-2.12'
     jobs:
       - 'voltha-patch-test':
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
 
 - job-group:
diff --git a/jjb/verify/bbsim.yaml b/jjb/verify/bbsim.yaml
index 9ea49c0..89fbdb1 100644
--- a/jjb/verify/bbsim.yaml
+++ b/jjb/verify/bbsim.yaml
@@ -87,7 +87,7 @@
     name: 'verify-bbsim-jobs-voltha-2.12'
     jobs:
       - 'voltha-patch-test':
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master'
           testTargets: |
diff --git a/jjb/verify/ofagent-go.yaml b/jjb/verify/ofagent-go.yaml
index 4428e44..164b5de 100644
--- a/jjb/verify/ofagent-go.yaml
+++ b/jjb/verify/ofagent-go.yaml
@@ -55,7 +55,7 @@
     name: 'verify-ofagent-jobs-voltha-2.12'
     jobs:
       - 'voltha-patch-test':
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
 
 # - job-group:
diff --git a/jjb/verify/voltha-go.yaml b/jjb/verify/voltha-go.yaml
index 28984ac..58fbafa 100644
--- a/jjb/verify/voltha-go.yaml
+++ b/jjb/verify/voltha-go.yaml
@@ -50,7 +50,7 @@
     name: 'verify-voltha-go-jobs-voltha-2.12'
     jobs:
       - 'voltha-patch-test':
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
 
 - job-group:
diff --git a/jjb/verify/voltha-onos.yaml b/jjb/verify/voltha-onos.yaml
index c27705a..68c648b 100644
--- a/jjb/verify/voltha-onos.yaml
+++ b/jjb/verify/voltha-onos.yaml
@@ -32,7 +32,7 @@
     name: 'verify-voltha-onos-jobs-voltha-2.12'
     jobs:
       - 'voltha-patch-test':
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
 
 - job-group:
diff --git a/jjb/verify/voltha-openolt-adapter.yaml b/jjb/verify/voltha-openolt-adapter.yaml
index e7aae9f..6cee045 100644
--- a/jjb/verify/voltha-openolt-adapter.yaml
+++ b/jjb/verify/voltha-openolt-adapter.yaml
@@ -54,7 +54,7 @@
       - 'voltha-patch-test':
           pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'master'
-          # pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          # pipeline-script: 'voltha/bbsim-tests.groovy'
           # pipeline-branch: 'voltha-2.12'
 
 - job-group:
diff --git a/jjb/verify/voltha-openonu-adapter-go.yaml b/jjb/verify/voltha-openonu-adapter-go.yaml
index 2761bb9..eec0420 100644
--- a/jjb/verify/voltha-openonu-adapter-go.yaml
+++ b/jjb/verify/voltha-openonu-adapter-go.yaml
@@ -49,7 +49,7 @@
     name: 'verify-voltha-openonu-adapter-go-jobs-voltha-2.12'
     jobs:
       - 'voltha-patch-test':
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
 
 - job-group:
diff --git a/jjb/verify/voltha-system-tests.yaml b/jjb/verify/voltha-system-tests.yaml
index 1395136..dbbda40 100644
--- a/jjb/verify/voltha-system-tests.yaml
+++ b/jjb/verify/voltha-system-tests.yaml
@@ -43,7 +43,7 @@
     name: 'verify-voltha-system-tests-jobs-voltha-2.12'
     jobs:
       - 'voltha-patch-test':
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
 
 - job-group:
diff --git a/jjb/voltha-e2e.yaml b/jjb/voltha-e2e.yaml
index 3051db8..150ad32 100755
--- a/jjb/voltha-e2e.yaml
+++ b/jjb/voltha-e2e.yaml
@@ -116,7 +116,7 @@
 
       - 'voltha-periodic-test':
           name: 'periodic-voltha-multiple-olts-test-bbsim-2.12'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           olts: 2
@@ -219,7 +219,7 @@
 
       - 'voltha-periodic-test':
           name: 'periodic-voltha-multi-uni-test-bbsim-2.12'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           extraHelmFlags: '--set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF'
@@ -320,7 +320,7 @@
 
       - 'voltha-periodic-test':
           name: 'periodic-voltha-multi-uni-multiple-olts-test-bbsim-2.12'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           olts: 2
@@ -638,7 +638,7 @@
 
       - 'voltha-periodic-test':
           name: 'periodic-voltha-openonu-go-test-bbsim-2.12'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           time-trigger: "H H/23 * * *"
@@ -1024,7 +1024,7 @@
       - 'voltha-periodic-test':
           name: 'patchset-voltha-2.12-openonu-go-test-bbsim'
           trigger-comment: "voltha 2.12 test openonu singleolt"
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: '$GERRIT_BRANCH'
           gerritProject: '$GERRIT_PROJECT'
@@ -1324,7 +1324,7 @@
 
       - 'voltha-periodic-test':
           name: 'periodic-voltha-multiple-olts-openonu-go-test-bbsim-2.12'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           extraHelmFlags: '--set onu=2,pon=2'
@@ -1602,7 +1602,7 @@
       - 'voltha-periodic-test':
           name: 'patchset-voltha-2.12-multiple-olts-openonu-go-test-bbsim'
           trigger-comment: "voltha 2.12 test openonu multiolt"
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: '$GERRIT_BRANCH'
           gerritProject: '$GERRIT_PROJECT'
@@ -1773,7 +1773,7 @@
 
       - 'voltha-periodic-test':
           name: 'periodic-voltha-test-DMI-2.12'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           time-trigger: "H H/23 * * *"
@@ -1830,7 +1830,7 @@
 
       - 'voltha-periodic-test':
           name: 'periodic-voltha-etcd-test-2.12'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           build-node: 'ubuntu18.04-basebuild-4c-8g'
           code-branch: 'voltha-2.12'
@@ -1873,7 +1873,7 @@
       # -----------------------------------------------------------------------
       - 'voltha-periodic-test':
           name: 'periodic-voltha-unitag-subscriber-tt-test-bbsim-2.12'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           extraHelmFlags: '--set onos-classic.replicas=3,onos-classic.atomix.replicas=3 --set voltha.onos_classic.replicas=3 '
@@ -1961,7 +1961,7 @@
       - 'voltha-periodic-test':
           name: 'periodic-voltha-memory-leak-test-bbsim-2.12'
           build-node: 'ubuntu18.04-basebuild-4c-8g'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           time-trigger: "H H/23 * * *"
diff --git a/jjb/voltha-e2e/voltha-2.12.yaml b/jjb/voltha-e2e/voltha-2.12.yaml
index 0e43b55..28e1771 100644
--- a/jjb/voltha-e2e/voltha-2.12.yaml
+++ b/jjb/voltha-e2e/voltha-2.12.yaml
@@ -26,7 +26,7 @@
     jobs:
       - 'voltha-periodic-test':
           name: 'periodic-voltha-pm-data-test-bbsim-2.12'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           extraHelmFlags: '--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1'
@@ -52,7 +52,7 @@
 
       - 'voltha-periodic-test':
           name: 'periodic-voltha-multiple-olts-pm-data-test-bbsim-2.12'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           extraHelmFlags: '--set onu=2,pon=2 --set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1'
@@ -84,7 +84,7 @@
           name: 'periodic-voltha-test-bbsim-2.12'
           code-branch: 'voltha-2.12'
           logLevel: 'DEBUG'                      # force job to regenerate
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           time-trigger: "H H/23 * * *"
           testTargets: |
@@ -116,7 +116,7 @@
 
       - 'voltha-periodic-test':
           name: 'periodic-voltha-sanity-test-multi-runs-2.12'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           time-trigger: "H H/23 * * *"
@@ -155,7 +155,7 @@
       - 'voltha-periodic-test':
           name: 'periodic-voltha-dt-test-bbsim-2.12'
           build-node: 'ubuntu18.04-basebuild-4c-8g'
-          pipeline-script: 'voltha/voltha-2.12/bbsim-tests.groovy'
+          pipeline-script: 'voltha/bbsim-tests.groovy'
           pipeline-branch: 'voltha-2.12'
           code-branch: 'voltha-2.12'
           time-trigger : '@daily'
diff --git a/vars/getVolthaCode.groovy b/vars/getVolthaCode.groovy
index fc4c722..23b373d 100644
--- a/vars/getVolthaCode.groovy
+++ b/vars/getVolthaCode.groovy
@@ -1,6 +1,6 @@
 #!/usr/bin/env groovy
 // -----------------------------------------------------------------------
-// Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
+// Copyright 2021-2024 Open Networking Foundation (ONF) and the ONF Contributors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -24,125 +24,176 @@
     return iam
 }
 
+// -----------------------------------------------------------------------
+// Intent: Log progress message
+// -----------------------------------------------------------------------
+void enter(String name) {
+    // Announce ourselves for log usability
+    String iam = getIam(name)
+    println("${iam}: ENTER")
+    return
+}
+
+// -----------------------------------------------------------------------
+// Intent: Log progress message
+// -----------------------------------------------------------------------
+void leave(String name) {
+    // Announce ourselves for log usability
+    String iam = getIam(name)
+    println("${iam}: LEAVE")
+    return
+}
+
 // TODO the 3 stages are very similar, most of the code can be shared
 
+// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
 def wrapped(Map config)
 {
     def defaultConfig = [
-	branch: "master",
-	gerritProject: "",
-	gerritRefspec: "",
-	volthaSystemTestsChange: "",
-	volthaHelmChartsChange: "",
+        branch: "master",
+        gerritProject: "",
+        gerritRefspec: "",
+        volthaSystemTestsChange: "",
+        volthaHelmChartsChange: "",
     ]
-    
+
     def cfg = defaultConfig + config
 
-    println "Downloading VOLTHA code with the following parameters: ${cfg}."
+    println("""
+
+** -----------------------------------------------------------------------
+** Downloading VOLTHA code with the following parameters:
+**   ${cfg}
+** -----------------------------------------------------------------------
+""")
 
     stage('Download Patch')
     {
-	frequent_repos = [
-	    '',
-	    'voltha-system-tests',
-	    'voltha-helm-charts',
-	]
+        frequent_repos = [
+            '',
+            'voltha-system-tests',
+            'voltha-helm-charts',
+        ]
 
-	// We are always downloading those repos, if the patch under test is in one of those
-	// just checkout the patch, no need to clone it again
-	if (cfg.gerritProject == '')
-	{
-	    // Revisit:
-	    // gerritProject should be defined.  Ignore when empty was likely
-	    // added to support manually re-running a job when repo values
-	    // may not be defined.
-	    // Unfortunately the conditional can also inadvertently bypass
-	    // checkout during an error condition.
-	    // Case: when cfg= is invalid due to a jenkins hiccup.
-	}
-	else if (!(cfg.gerritProject in frequent_repos))
-	{
-	    repo_project = "https://gerrit.opencord.org/${cfg.gerritProject}"
-		
-	    checkout([
-		$class: 'GitSCM',
-		userRemoteConfigs: [[ url:repo_project ]],
-		branches: [[ name: "${cfg.branch}", ]],
-		extensions: [
-		    [$class: 'WipeWorkspace'],
-		    [$class: 'RelativeTargetDirectory', relativeTargetDir: "${cfg.gerritProject}"],
-		    [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
-		],
-	    ])
+        // We are always downloading those repos, if the patch under test is in one of those
+        // just checkout the patch, no need to clone it again
+        if (cfg.gerritProject == '')
+        {
+            // Revisit:
+            // gerritProject should be defined.  Ignore when empty was likely
+            // added to support manually re-running a job when repo values
+            // may not be defined.
+            // Unfortunately the conditional can also inadvertently bypass
+            // checkout during an error condition.
+            // Case: when cfg= is invalid due to a jenkins hiccup.
+        }
+        else if (!(cfg.gerritProject in frequent_repos))
+        {
+            repo_project = "https://gerrit.opencord.org/${cfg.gerritProject}"
 
-	    sh """
+            checkout([
+                $class: 'GitSCM',
+                userRemoteConfigs: [[ url:repo_project ]],
+                branches: [[ name: "${cfg.branch}", ]],
+                extensions: [
+                    [$class: 'WipeWorkspace'],
+                    [$class: 'RelativeTargetDirectory', relativeTargetDir: "${cfg.gerritProject}"],
+                    [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
+                ],
+            ])
+
+            sh("""
         pushd $WORKSPACE/${cfg.gerritProject}
         git fetch "$repo_project" ${cfg.gerritRefspec} && git checkout FETCH_HEAD
 
         echo "Currently on commit: \n"
         git log -1 --oneline
         popd
-      """
-	}
+      """)
+        }
     }
 
+    // -----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     stage('Clone voltha-system-tests')
-    {	
-	repo_vst = 'https://gerrit.opencord.org/voltha-system-tests'
+    {
+        enter("Clone voltha-system-tests @ BRANCH=[${cfg.branch}]")
+        println("""
 
-	checkout([
-	    $class: 'GitSCM',
-	    userRemoteConfigs: [[ url:repo_vst ]],
-	    branches: [[ name: "${cfg.branch}", ]],
-	    extensions: [
-		[$class: 'WipeWorkspace'],
-		[$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
-		[$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
-	    ],
-	])
+** -----------------------------------------------------------------------
+** Clone voltha-system-tests
+** -----------------------------------------------------------------------
+""")
+        repo_vst = 'https://gerrit.opencord.org/voltha-system-tests'
 
-	if (cfg.volthaSystemTestsChange != '' && cfg.gerritProject != 'voltha-system-tests')
-	{
-	    sh """
+        checkout([
+            $class: 'GitSCM',
+            userRemoteConfigs: [[ url:repo_vst ]],
+            branches: [[ name: "${cfg.branch}", ]],
+            extensions: [
+                [$class: 'WipeWorkspace'],
+                [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
+                [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
+            ],
+        ])
+
+        if (cfg.volthaSystemTestsChange != '' && cfg.gerritProject != 'voltha-system-tests')
+            {
+            enter("git fetch repo_vst=[${repo_vst}]")
+
+            sh """
         cd "$WORKSPACE/voltha-system-tests"
         git fetch "${repo_vst}" ${cfg.volthaSystemTestsChange} && git checkout FETCH_HEAD
       """
-	}
-	else if (cfg.gerritProject == 'voltha-system-tests') {
-	    sh """
+            leave("git fetch repo_vst=[${repo_vst}]")
+        }
+        else if (cfg.gerritProject == 'voltha-system-tests') {
+            enter("git fetch https://${cfg.gerritProject}")
+
+            sh("""
         pushd "$WORKSPACE/${cfg.gerritProject}"
         git fetch https://gerrit.opencord.org/${cfg.gerritProject} ${cfg.gerritRefspec} && git checkout FETCH_HEAD
 
         echo "Currently on commit: \n"
         git log -1 --oneline
         popd
-      """
-	}
+      """)
+            leave("git fetch https://${cfg.gerritProject}")
+        }
+
+        leave("Clone voltha-system-tests @ BRANCH=[${cfg.branch}]")
     }
 
+    // -----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     stage('Clone voltha-helm-charts')
     {
-	repo_vhc = 'https://gerrit.opencord.org/voltha-helm-charts'
+        enter("Clone voltha-helm-charts @ BRANCH=[${cfg.branch}]")
+        repo_vhc = 'https://gerrit.opencord.org/voltha-helm-charts'
 
-	checkout([
-	    $class: 'GitSCM',
-	    userRemoteConfigs: [[ url:repo_vhc ]],
-	    branches: [[ name: "${cfg.branch}", ]],
-	    extensions: [
-		[$class: 'WipeWorkspace'],
-		[$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-helm-charts"],
-		[$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
-	    ],
-	])
+        checkout([
+            $class: 'GitSCM',
+            userRemoteConfigs: [[ url:repo_vhc ]],
+            branches: [[ name: "${cfg.branch}", ]],
+            extensions: [
+                [$class: 'WipeWorkspace'],
+                [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-helm-charts"],
+                [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
+            ],
+        ])
 
-	if (cfg.volthaHelmChartsChange != '' && cfg.gerritProject != 'voltha-helm-charts') {
-	    sh """
+        if (cfg.volthaHelmChartsChange != '' && cfg.gerritProject != 'voltha-helm-charts') {
+            enter("git fetch repo_vhc=[$repo_vhc]")
+            sh """
         cd "$WORKSPACE/voltha-helm-charts"
         git fetch "$repo_vhc" ${cfg.volthaHelmChartsChange} && git checkout FETCH_HEAD
-      """
-	}
-	else if (cfg.gerritProject == 'voltha-helm-charts') {
-	    sh """
+      """ 
+            leave("git fetch repo_vhc=[$repo_vhc]")
+        }
+        else if (cfg.gerritProject == 'voltha-helm-charts') {
+            enter('cfg.gerritProject == voltha-helm-charts')
+            sh """
         pushd "$WORKSPACE/${cfg.gerritProject}"
         git fetch "https://gerrit.opencord.org/${cfg.gerritProject}" ${cfg.gerritRefspec} && git checkout FETCH_HEAD
 
@@ -150,7 +201,10 @@
         git log -1 --oneline
         popd
       """
-	}
+            leave('cfg.gerritProject == voltha-helm-charts')
+        }
+
+        leave("Clone voltha-helm-charts @ BRANCH=[${cfg.branch}]")
     }
 }
 
@@ -159,32 +213,29 @@
 def call(Map config)
 {
     String iam = getIam('main')
-    Boolean debug = false
+    Boolean debug = true
 
-    if (debug)
-    {
-	println("** ${iam}: ENTER")
+    if (debug) {
+        println("** ${iam}: ENTER")
     }
 
-    if (!config) {
-        config = [:]
-    }
+    config ?: [:]
 
     try
     {
-	wrapped(config)
+        wrapped(config)
     }
     catch (Exception err)
     {
-	println("** ${iam}: EXCEPTION ${err}")
-	throw err
+        println("** ${iam}: EXCEPTION ${err}")
+        throw err
     }
     finally
     {
-	if (debug)
-	{
-	    println("** ${iam}: LEAVE")
-	}
+        if (debug)
+            {
+            println("** ${iam}: LEAVE")
+        }
     }
 
     return
diff --git a/vars/getVolthaImageFlags.groovy b/vars/getVolthaImageFlags.groovy
index 7543615..a4127f9 100644
--- a/vars/getVolthaImageFlags.groovy
+++ b/vars/getVolthaImageFlags.groovy
@@ -48,7 +48,7 @@
             break
         case 'voltha-onos':
             String ans = [
-                '--set nos-classic.image.repository=voltha/voltha-onos',
+                '--set onos-classic.image.repository=voltha/voltha-onos',
                 'onos-classic.image.tag=citest',
                 "onos-classic.image.pullPolicy=${pullPolicy}",
             ].join(',')