[VOL-5177] - verify_voltha-openolt-adapter_sanity-test failure
More debugging added for voltha-adapter-sanity-test.
https://jenkins.opencord.org/job/verify_voltha-openolt-adapter_sanity-test-voltha-2.12/17/console
vars/volthaStackDeploy.groovy
-----------------------------
o Last job failure was quiet, due to a timeout waiting for ONOS loading.
o ERR: Cancelling nested steps due to timeout
o Debugging added: display "kubectl get pods" early for error messages
and to see what is in the stream. We may need to split the 'wc -l'
one liner into separate commands to detect problems in the pipeline.
o Change getIam() return type from def to String so type cast problems
will become visible.
vars/waitForAdapter.groovy
--------------------------
o Replace several raw iam=getIam() calls with enter(msg), leave(msg).
o Replace raw pgrep/pkill with central debug library pkill_port_forward.groovy.
o Library logic can be replaced if/when we have port forwarding handled
by system services.
Change-Id: I5b07000c20e0bf2b9a12e87d39f384dbcc542a37
diff --git a/vars/waitForAdapters.groovy b/vars/waitForAdapters.groovy
index 92edf0d..5c9c5ce 100644
--- a/vars/waitForAdapters.groovy
+++ b/vars/waitForAdapters.groovy
@@ -47,7 +47,6 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
def getAdapters() {
- String iam = getIam('getAdapters')
String adapters = ''
try {
@@ -66,7 +65,7 @@
adapters = 'SKIP' // why not just retry a few times (?)
}
- print("** ${iam}: returned $adapters")
+ leave("returned $adapters")
return adapters
}
@@ -149,8 +148,9 @@
: 'CONTINUE'
}
+
if (debug) {
- println("** ${iam} return: [$ans]")
+ leave("return: [$ans]")
}
return ans
} // getAdaptersState
@@ -229,14 +229,15 @@
}
println("** ${iam}: Tearing down port forwarding")
- // pgrep_port_forward-212
+ Map pkpfArgs =\
+ [
+ 'banner' : true, // display banner for logging
+ 'show_procs' : true, // display procs under consideration
+ 'filler' : true // fix conditional trailing comma
+ ]
- sh(label : 'waitForAdapters: Tear down port forwarding',
- script : """
-if [[ \$(pgrep --count 'port-forw') -gt 0 ]]; then
- pkill --uid "\$(id -u)" --echo --full 'port-forw'
-fi
-""")
+ // [TODO] 'kubectl.*port-forward'
+ pkill_port_forward('port-forward', pkpfArgs)
leave('process')
return
@@ -246,13 +247,12 @@
// -----------------------------------------------------------------------
def call(Map config=[:])
{
- String iam = getIam('main')
-
try {
enter('main')
process(config)
}
catch (Exception err) { // groovylint-disable-line CatchException
+ String iam = getIam('process')
println("** ${iam}: EXCEPTION ${err}")
throw err
}