VOL-5155 - triage failure in periodic-voltha-test-bbsim-2.12

jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
--------------------------------------------------
  o Added a missing script block, String iam= was in limbo.

makefiles/lint/groovy/include.mk
-----------------------------------------------------
  o Add lint BYSRC= so npm-groovy-lint can be run on individual files.

Change-Id: I33269893780c7cb116d87dae5f8ac6cbc01ff3e6
diff --git a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
index f273eb5..e8c2181 100644
--- a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
+++ b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
@@ -412,7 +412,10 @@
 // -----------------------------------------------------------------------
 // -----------------------------------------------------------------------
 def collectArtifacts(exitStatus) {
-    String iam = getIam('collectArtifacts')
+    script {
+	String iam = getIam('collectArtifacts')
+	println("${iam}: ENTER (exitStatus=${exitStatus})")
+    }
 
     echo '''
 
@@ -420,7 +423,6 @@
 ** collectArtifacts
 ** -----------------------------------------------------------------------
 '''
-    println("${iam}: ENTER (exitStatus=${exitStatus})")
 
     getPodsInfo("$WORKSPACE/${exitStatus}")
 
@@ -570,8 +572,6 @@
     // -----------------------------------------------------------------------
     // -----------------------------------------------------------------------
     stage('Replace voltctl') {
-        String iam = getIam('Replace voltctl')
-	    
         // if the project is voltctl, override the downloaded one with the built one
         when {
             expression { return gerritProject == 'voltctl' }
@@ -580,11 +580,15 @@
         // Hmmmm(?) where did the voltctl download happen ?
         // Likely Makefile but would be helpful to document here.
         steps {
-            println("${iam} Running: installVoltctl($branch)")
-	    println("${iam}: ENTER")
-            installVoltctl("$branch")
-	    println("${iam}: LEAVE")
-        } // steps
+		script {
+		    String iam = getIam('Replace voltctl')
+
+		    println("${iam} Running: installVoltctl($branch)")
+		    println("${iam}: ENTER")
+		    installVoltctl("$branch")
+		    println("${iam}: LEAVE")
+		} // script
+	    } // steps
     } // stage
 
     // -----------------------------------------------------------------------