Merge "debug: disable all periodic/nightly jobs for the berlin community pods"
diff --git a/jjb/voltha-e2e/voltha-2.8.yaml b/jjb/voltha-e2e/voltha-2.8.yaml
index b5e8ac2..4713a1a 100644
--- a/jjb/voltha-e2e/voltha-2.8.yaml
+++ b/jjb/voltha-e2e/voltha-2.8.yaml
@@ -1,5 +1,6 @@
 ---
 # voltha 2.0 tests
+# Force regeneration: ee6c143b23ae6acbade0ddcb6965bff3c757dd5a
 
 - project:
     name: voltha-e2e-2.8
@@ -20,7 +21,7 @@
     make-target-reconciledttest: reconcile-openonu-go-adapter-test-dt
     make-target-reconciletttest: reconcile-openonu-go-adapter-test-tt
 
-# source: voltha-e2e.yaml
+    # source: voltha-e2e.yaml
     jobs:
       - 'voltha-periodic-test':
           name: 'periodic-voltha-pm-data-test-bbsim-2.8-playground'
@@ -56,7 +57,7 @@
           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'
           olts: 2
           timeout: 180
-          logLevel: 'DEBUG'
+          logLevel: 'INFO'
           testTargets: |
             - target: voltha-pm-data-multiolt-kind-att
               workflow: att
@@ -136,5 +137,4 @@
               teardown: false
               logging: true
 
-
-# [EOF]          
+# [EOF]
diff --git a/vars/installVoltctl.groovy b/vars/installVoltctl.groovy
index fb90ebc..cfc525d 100644
--- a/vars/installVoltctl.groovy
+++ b/vars/installVoltctl.groovy
@@ -19,8 +19,7 @@
 
 // -----------------------------------------------------------------------
 // -----------------------------------------------------------------------
-def getIam(String func)
-{
+String getIam(String func) {
     // Cannot rely on a stack trace due to jenkins manipulation
     String src = 'vars/installVoltctl.groovy'
     String iam = [src, func].join('::')
@@ -28,22 +27,68 @@
 }
 
 // -----------------------------------------------------------------------
+// Intent: Log progress message
 // -----------------------------------------------------------------------
-def process(String branch) {
+void enter(String name) {
+    // Announce ourselves for log usability
+    String iam = getIam(name)
+    println("${iam}: ENTER")
+    return
+}
 
-    String iam = 'vars/installVoltctl.groovy'
-    println("** ${iam}: ENTER")
+// -----------------------------------------------------------------------
+// Intent: Log progress message
+// -----------------------------------------------------------------------
+void leave(String name) {
+    // Announce ourselves for log usability
+    String iam = getIam(name)
+    println("${iam}: LEAVE")
+    return
+}
+
+// -----------------------------------------------------------------------
+// Intent: Assign perms to fix access problems
+// . /bin/sh: 1: /home/jenkins/.volt/config: Permission denied
+// -----------------------------------------------------------------------
+void fixPerms() {
+    enter('fixPerms')
+
+    sh(label  : 'fixperms',
+       script : """
+
+      umask 022
+
+      declare volt_dir='~/.volt'
+      declare volt_cfg='~/.volt/config'
+
+      echo
+      echo "** Fixing perms: \$volt_cfg"
+      mkdir -p "\$volt_dir"
+      chmod -R u+w,go-rwx "\$volt_dir"
+      chmod u=rwx "\$volt_dir"
+      touch "\$volt_cfg"
+      /bin/ls -l "\$volt_dir"
+""")
+    leave('fixPerms')
+    return
+}
+
+// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
+Boolean process(String branch) {
+    Boolean ans = true
+    enter('process')
 
     // This logic seems odd given we branch & tag repositories
     // for release so hilight non-frozen until we know for sure.
-    def released=[
-	// v1.9.1 - https://github.com/opencord/voltctl/releases/tag/untagged-cd611c39178f25b95a87
-	'voltha-2.12' : '1.8.45',
-	'voltha-2.11' : '1.8.45',
-	// https://github.com/opencord/voltctl/releases/tag/v1.7.6
-	'voltha-2.10' : '1.7.6',
-	'voltha-2.9'  : '1.7.4',
-	'voltha-2.8'  : '1.6.11',
+    def released = [
+        // v1.9.1 - https://github.com/opencord/voltctl/releases/tag/untagged-cd611c39178f25b95a87
+        'voltha-2.12' : '1.8.45',
+        'voltha-2.11' : '1.8.45',
+        // https://github.com/opencord/voltctl/releases/tag/v1.7.6
+        'voltha-2.10' : '1.7.6',
+        'voltha-2.9'  : '1.7.4',
+        'voltha-2.8'  : '1.6.11',
     ]
 
     boolean have_released = released.containsKey(branch)
@@ -61,40 +106,40 @@
     // Sanity check: released version must be frozen
     // ---------------------------------------------
     if (is_release && ! released.containsKey(branch)) {
-	// Fingers crossed: jenkins may rewrite the callstack.
-	def myname = this.class.getName()
+        // Fingers crossed: jenkins may rewrite the callstack.
+        String myname = this.class.getName()
 
-	String url = [
-	    'https://docs.voltha.org/master',
-	    'howto/release/installVoltctl.html',
-	].join('/')
+        String url = [
+            'https://docs.voltha.org/master',
+            'howto/release/installVoltctl.html',
+        ].join('/')
 
-	String error = [
-	    myname, "ERROR:",
-	    "Detected release version=[$branch]",
-	    "but voltctl is not frozen.",
-	    '',
-	    "See Also:", url,
-	].join(' ')
-	throw new Exception(error)
+        String error = [
+            myname, 'ERROR:',
+            "Detected release version=[$branch]",
+            'but voltctl is not frozen.',
+            '',
+            'See Also:', url,
+        ].join(' ')
+        throw new Exception(error) // groovylint-disable-line ThrowException
     }
 
     // --------------------------------
     // General answer: latest available
     // --------------------------------
     if (! have_released) {
-	url = 'https://api.github.com/repos/opencord/voltctl/releases/latest'
-	get_version = [
-	    "curl -sSL ${url}",
-	    "jq -r .tag_name",
-	    "sed -e 's/^v//g'",
-	].join(' | ')
-	
-	print(" ** RUNNING: ${get_version}")
-	released[branch] = sh (
-	    script: get_version,
-	    returnStdout: true
-	).trim()
+        url = 'https://api.github.com/repos/opencord/voltctl/releases/latest'
+        get_version = [
+            "curl -sSL ${url}",
+            'jq -r .tag_name',
+            "sed -e 's/^v//g'",
+        ].join(' | ')
+
+        print(" ** RUNNING: ${get_version}")
+        released[branch] = sh(
+            script: get_version,
+            returnStdout: true
+        ).trim()
     }
 
     voltctlVersion = released[branch]
@@ -104,9 +149,12 @@
     // groovy expansion: ${var}
     // shell  expansion: \${var}
     // -----------------------------------------------------------------------
-    sh returnStdout: false, script: """#!/bin/bash
+    sh(
+        label : 'Install Voltctl',
+        returnStdout: false,
+        script: """#!/bin/bash
 
-#    set -eu -o pipefail
+    # set -eu -o pipefail
 
     bin_voltctl="$WORKSPACE/bin/voltctl"
 
@@ -133,36 +181,27 @@
     # ---------------------------------------------------------
     "\${bin_voltctl}" version --clientonly
     voltctl version --clientonly
-  """
+""")
 
-    println("** ${iam}: LEAVE")
+    enter('process')
+    return(ans)
 }
 
 // -----------------------------------------------------------------------
 // -----------------------------------------------------------------------
-def call(String branch)
-{
-    String iam = getIam('main')
-    println("** ${iam}: ENTER")
-
-	/* - unused, string passed as argument
-    if (!config) {
-        config = [:]
+def call(String branch) {
+    try {
+        enter('main')
+        fixPerms()
+        process(branch)
     }
-	 */
-
-    try
-    {
-	process(branch)
+    catch (Exception err) {  // groovylint-disable-line CatchException
+        String iam = getIam('main')
+        println("** ${iam}: EXCEPTION ${err}")
+        throw err
     }
-    catch (Exception err)
-    {
-	println("** ${iam}: EXCEPTION ${err}")
-	throw err
-    }
-    finally
-    {
-	println("** ${iam}: LEAVE")
+    finally {
+        leave('main')
     }
     return
 }
diff --git a/vars/pkill_port_forward.groovy b/vars/pkill_port_forward.groovy
index 8b2be6f..2acd90d 100644
--- a/vars/pkill_port_forward.groovy
+++ b/vars/pkill_port_forward.groovy
@@ -88,7 +88,7 @@
         label  : 'Display port forwarding',
         // script : ${cmd}.toString(),  -> Exception
         script : """
-echo -e "\n** ${iam} [DEBUG]: pgrep-pkill check"
+echo -e "\n** vars/pkill_port_forward.groovy [DEBUG]: pgrep-pkill check"
 if [[ \$(pgrep --count 'port-forw') -gt 0 ]]; then
     pkill --uid \$(uid -u) --echo --list-full --full 'port-forw'
 fi
@@ -113,7 +113,7 @@
         enter('main')
 
         // Assign defaults
-        ['banner', 'show_procs'].each{ key->
+        ['banner', 'show_procs'].each { key ->
             if (!args.containsKey(key)) {
                 args[key] = true
             }