[VOL-5094] -  Fix periodic-voltha-memory-leak-test-bbsim

jjb/pipeline/voltha/master/bbsim-tests.groovy
jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
--------------------------------------------------
  o Changed install target from venv-activate-script to
    venv-activate-patched to better support installation
    of the v3.10+ python interpreter.
  o bbsim-tests is a central script used by multiple repo jobs.
    There is a chance some external repos/jobs may fail if they are not using
    the latest version of makefiles/virtualenv.mk.  Fix for that problem
    (if it even surfaces) is update to the latest version in repo:onf-make.
  o repo:voltha-system-tests is using the latest virtualenv.mk so update
    target name.
  o Insert stage banners to improve log readability.
  o make lint / whitespace clenaup in the master/bbsim script.

Change-Id: I845a700e080b61ea27ad1884f391b49bdbe12e9c
diff --git a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
index dd92425..ddb9708 100644
--- a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
+++ b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
@@ -256,18 +256,32 @@
         } // if (teardown)
     } // stage('Deploy Voltha')
 
+    // -----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     stage("Run test ${testTarget} on workflow ${workflow}")
     {
         sh """
-        echo -e "\n** Monitor using mem_consumption.py ?"
+        echo -e '** Monitor memory consumption: ENTER'
+
     if [ ${withMonitoring} = true ] ; then
+      cat <<EOM
+
+** -----------------------------------------------------------------------
+** Monitoring memory usage with mem_consumption.py
+** -----------------------------------------------------------------------
+EOM
       mkdir -p "$WORKSPACE/voltha-pods-mem-consumption-${workflow}"
       cd "$WORKSPACE/voltha-system-tests"
-      make venv-activate-script
+
+      echo '** Installing python virtualenv'
+      make venv-activate-patched
+
       set +u && source .venv/bin/activate && set -u
       # Collect initial memory consumption
       python scripts/mem_consumption.py -o $WORKSPACE/voltha-pods-mem-consumption-${workflow} -a 0.0.0.0:31301 -n ${volthaNamespace}
     fi
+
+    echo -e '** Monitor memory consumption: LEAVE\n'
     """
 
         sh """
@@ -293,11 +307,22 @@
       echo -e '** Gather robot Framework logs: LEAVE\n'
     """
 
+    // -----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     sh """
     echo -e '** Monitor pod-mem-consumption: ENTER'
     if [ ${withMonitoring} = true ] ; then
+      cat <<EOM
+
+** -----------------------------------------------------------------------
+** Monitoring pod-memory-consumption using mem_consumption.py
+** -----------------------------------------------------------------------
+EOM
       cd "$WORKSPACE/voltha-system-tests"
-      make venv-activate-script
+
+      echo '** Installing python virtualenv'
+      make venv-activate-patched
+
       set +u && source .venv/bin/activate && set -u
       # Collect memory consumption of voltha pods once all the tests are complete
       python scripts/mem_consumption.py -o $WORKSPACE/voltha-pods-mem-consumption-${workflow} -a 0.0.0.0:31301 -n ${volthaNamespace}
@@ -321,15 +346,15 @@
 ** -----------------------------------------------------------------------
 '''
     println("${iam}: ENTER (exitStatus=${exitStatus})")
-    
+
     getPodsInfo("$WORKSPACE/${exitStatus}")
-    
+
     sh """
   kubectl logs -n voltha -l app.kubernetes.io/part-of=voltha > $WORKSPACE/${exitStatus}/voltha.log
   """
-    
+
     archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.txt,**/*.html,**/voltha-pods-mem-consumption-att/*,**/voltha-pods-mem-consumption-dt/*,**/voltha-pods-mem-consumption-tt/*'
-    
+
     sh(returnStdout:true, script: '''
     sync
     echo '** Running: pgrep --list-full kail-startup (ENTER)'