Avoid errors from empty variables
- Make sure vairables are initialized as empty maps instead of None
- Fix some style issues
Change-Id: I39d3bea85af25e264ee560f7ceba492adc364887
diff --git a/TestON/JenkinsFile/CommonJenkinsFile.groovy b/TestON/JenkinsFile/CommonJenkinsFile.groovy
index 763f8d9..54cec80 100644
--- a/TestON/JenkinsFile/CommonJenkinsFile.groovy
+++ b/TestON/JenkinsFile/CommonJenkinsFile.groovy
@@ -29,7 +29,6 @@
category = null
prop = null
-testsToRun = null
testsToRunStrList = null
branch = null
branchWithPrefix = null
@@ -41,6 +40,7 @@
isSCPF = false
pipelineTimeout = null
+testsToRun = [:]
testsFromList = [:]
graphPaths = [:]
pipeline = [:]
@@ -141,7 +141,7 @@
toBeRun = testsToRun.keySet().contains( JenkinsLabel )
stepName = ( toBeRun ? "" : "Not " ) + "Running $JenkinsLabel"
- TestONTest = testsToRun[ JenkinsLabel ].keySet().contains( "test" ) ? testsToRun[ JenkinsLabel ][ "test" ] : JenkinsLabel
+ TestONTest = ( toBeRun && testsToRun[ JenkinsLabel ].keySet().contains( "test" ) ) ? testsToRun[ JenkinsLabel ][ "test" ] : JenkinsLabel
pipeline[ stepName ] = runTest( JenkinsLabel,
toBeRun,
diff --git a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
index d5f6e1f..1937b8a 100644
--- a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
+++ b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
@@ -113,7 +113,6 @@
onpass="Nodes check successful.",
onfail="Nodes check failed.")
-
def CASE19( self, main ):
"""
Copy the karaf.log files after each testcase cycle
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index 87e1bec..d4a7b7e 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -1609,7 +1609,6 @@
buildOutput += handle.before
main.log.debug( buildOutput )
-
confDir = "/tmp/mn_conf/"
# Try to ensure the destination exists
main.log.info( "Create folder for network config files" )
diff --git a/TestON/tests/dependencies/ONOSSetup.py b/TestON/tests/dependencies/ONOSSetup.py
index af113f7..fabfe9a 100644
--- a/TestON/tests/dependencies/ONOSSetup.py
+++ b/TestON/tests/dependencies/ONOSSetup.py
@@ -442,7 +442,8 @@
for ctrl in main.Cluster.active():
main.log.debug( "{} components not ACTIVE: \n{}".format(
ctrl.name,
- ctrl.CLI.sendline( "onos:scr-list | grep -v ACTIVE" ) ) ) #FIXME: This output has changed a lot
+ # FIXME: This output has changed a lot
+ ctrl.CLI.sendline( "onos:scr-list | grep -v ACTIVE" ) ) )
main.log.error( "Failed to start ONOS, stopping test" )
main.cleanAndExit( msg="Failed to start ONOS: not all nodes are in READY state" )
return main.TRUE