Refactor testName and pureTestName

- Renamed testName to JenkinsLabel
- Rename pureTestName to TestONTest
- Added arguments field to tests.json for runtime test arguemnts
- Refactored exisiting tests that use parameters or where JenkinsLabel !=
  TestONTest
- This should fix a bug in some post build steps as well as clarify some
  variables

Change-Id: I1f653fa072b623fa7e1de01331322dee1a804bae
diff --git a/TestON/JenkinsFile/dependencies/JenkinsGraphs.groovy b/TestON/JenkinsFile/dependencies/JenkinsGraphs.groovy
index b39c2b4..c2c03f4 100644
--- a/TestON/JenkinsFile/dependencies/JenkinsGraphs.groovy
+++ b/TestON/JenkinsFile/dependencies/JenkinsGraphs.groovy
@@ -76,12 +76,12 @@
     return pass + "|psql --host=" + host + " --port=" + port + " --username=" + user + " --password --dbname onostest -c "
 }
 
-def databaseAndGraph( prop, testName, pureTestName, graphOnly, graph_generator_file, graph_saved_directory ){
+def databaseAndGraph( prop, JenkinsLabel, TestONTest, graphOnly, graph_generator_file, graph_saved_directory ){
     // part where it insert the data into the database.
     // It will use the predefined encrypted variables from the Jenkins.
     // prop : property dictionary that was read from the machine
-    // testName : Jenkins name for the test
-    // pureTestName : TestON name for the test
+    // JenkinsLabel : Jenkins name for the test
+    // TestONTest : TestON name for the test
     // graphOnly : boolean whether it is graph only or not
     // graph_generator_file : Rscript file with the full path.
     // graph_saved_directory : where the generated graph will be saved to.
@@ -93,16 +93,16 @@
                 string( credentialsId: 'db_host', variable: 'host' ),
                 string( credentialsId: 'db_port', variable: 'port' ) ] ) {
             def database_command = database_command_create( pass, host, port, user ) +
-                                   ( !isSCPF ? sqlCommand( testName ) : SCPFfunc.sqlCommand( testName ) )
+                                   ( !isSCPF ? sqlCommand( JenkinsLabel ) : SCPFfunc.sqlCommand( JenkinsLabel ) )
             sh script: '''#!/bin/bash
               export DATE=\$(date +%F_%T)
               cd ~
               pwd ''' + ( graphOnly ? "" :
-                          ( !isSCPF ? databasePart( prop[ "WikiPrefix" ], pureTestName, database_command ) :
-                            SCPFfunc.databasePart( testName, database_command ) ) ), label: "Database"
-            sh script: ( !isSCPF ? graphGenerating( host, port, user, pass, testName, prop, graph_saved_directory,
+                          ( !isSCPF ? databasePart( prop[ "WikiPrefix" ], TestONTest, database_command ) :
+                            SCPFfunc.databasePart( JenkinsLabel, database_command ) ) ), label: "Database"
+            sh script: ( !isSCPF ? graphGenerating( host, port, user, pass, JenkinsLabel, prop, graph_saved_directory,
                                                  graph_generator_file ) :
-                      SCPFfunc.getGraphGeneratingCommand( host, port, user, pass, testName, prop ) ), label: "Generate Test Graph"
+                      SCPFfunc.getGraphGeneratingCommand( host, port, user, pass, JenkinsLabel, prop ) ), label: "Generate Test Graph"
         }
     }
 }
@@ -179,6 +179,8 @@
 
 def sqlCommand( testName ){
     // get the inserting sqlCommand for non-SCPF tests.
+    // testName : the name the the test results are stored under in the db.
+    //            This is usually the same as the Jenkins Test name
     table_name = "executed_test_tests"
     result_name = "executed_test_results"
 
@@ -193,19 +195,19 @@
                                         prop[ "ONOSBranch" ] ) + " 20 " + graph_saved_directory
 }
 
-def databasePart( wikiPrefix, testName, database_command ){
+def databasePart( wikiPrefix, TestONTest, database_command ){
     // to read and insert the data from .csv to the database
 
     return '''
-    sed 1d ''' + workSpace + "/" + wikiPrefix + "-" + testName + '''.csv | while read line
+    sed 1d ''' + workSpace + "/" + wikiPrefix + "-" + TestONTest + '''.csv | while read line
     do
     echo \$line
     echo ''' + database_command + '''
     done '''
 }
 
-def generateStatGraph( testMachineOn, onos_branch, stat_graph_generator_file, pie_graph_generator_file,
-                       graph_saved_directory, nodeLabel ){
+def generateStatGraph( testMachineOn, onos_branch, stat_graph_generator_file,
+                       pie_graph_generator_file, graph_saved_directory, nodeLabel ){
 
     table_name = "executed_test_tests"
     result_name = "executed_test_results"
diff --git a/TestON/JenkinsFile/dependencies/tests.json b/TestON/JenkinsFile/dependencies/tests.json
index a73f72d..215a3e1 100644
--- a/TestON/JenkinsFile/dependencies/tests.json
+++ b/TestON/JenkinsFile/dependencies/tests.json
@@ -516,6 +516,8 @@
         "supportedBranches": [ "all" ]
     },
     "SCPFintentInstallWithdrawLatWithFlowObj": {
+        "test": "SCPFintentInstallWithdrawLat",
+        "arguments": "--params TEST/flowObj=True",
         "schedules": [
             {
                 "branch": "master",
@@ -558,6 +560,8 @@
         "supportedBranches": [ "all" ]
     },
     "SCPFintentRerouteLatWithFlowObj": {
+        "test": "SCPFintentRerouteLat",
+        "arguments": "--params TEST/flowObj=True",
         "schedules": [
             {
                 "branch": "master",
@@ -600,6 +604,8 @@
         "supportedBranches": [ "all" ]
     },
     "SCPFintentEventTpWithFlowObj": {
+        "test": "SCPFintentEventTp",
+        "arguments": "--params TEST/flowObj=True",
         "schedules": [
             {
                 "branch": "master",
@@ -663,6 +669,8 @@
         "supportedBranches": [ "all" ]
     },
     "SCPFflowTp1gWithFlowObj": {
+        "test": "SCPFflowTp1g",
+        "arguments": "--params TEST/flowObj=True",
         "schedules": [
             {
                 "branch": "master",
@@ -711,6 +719,8 @@
         "supportedBranches": [ "all" ]
     },
     "SCPFscalingMaxIntentsWithFlowObj": {
+        "test": "SCPFscalingMaxIntents",
+        "arguments": "--params TEST/flowObj=True",
         "schedules": [
         ],
         "category": "SCPF",
@@ -1056,7 +1066,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRHAsanity": {
-        "test": "HAsanity --params-file HAsanity.params.fabric",
+        "test": "HAsanity",
+        "arguments": "--params-file HAsanity.params.fabric",
         "wikiName": "SR HA Sanity",
         "wikiFile": "HAsanityWiki.txt",
         "schedules": [
@@ -1080,7 +1091,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRHAclusterRestart": {
-        "test": "HAclusterRestart --params-file HAclusterRestart.params.fabric",
+        "test": "HAclusterRestart",
+        "arguments": "--params-file HAclusterRestart.params.fabric",
         "wikiName": "SR HA Cluster Restart",
         "schedules": [
             {
@@ -1103,7 +1115,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRHAsingleInstanceRestart": {
-        "test": "HAsingleInstanceRestart --params-file HAsingleInstanceRestart.params.fabric",
+        "test": "HAsingleInstanceRestart",
+        "arguments": "--params-file HAsingleInstanceRestart.params.fabric",
         "wikiName": "SR HA Single Instance Restart",
         "wikiFile": "HAsingleInstanceRestartWiki.txt",
         "schedules": [
@@ -1127,7 +1140,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRHAstopNodes": {
-        "test": "HAstopNodes --params-file HAstopNodes.params.fabric",
+        "test": "HAstopNodes",
+        "arguments": "--params-file HAstopNodes.params.fabric",
         "wikiName": "SR HA Stop Nodes",
         "wikiFile": "HAstopNodes.txt",
         "schedules": [
@@ -1151,7 +1165,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRHAfullNetPartition": {
-        "test": "HAfullNetPartition --params-file HAfullNetPartition.params.fabric",
+        "test": "HAfullNetPartition",
+        "arguments": "--params-file HAfullNetPartition.params.fabric",
         "wikiName": "SR HA Full Network Partition",
         "wikiFile": "HAfullNetPartitionWiki.txt",
         "schedules": [
@@ -1175,7 +1190,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRHAswapNodes": {
-        "test": "HAswapNodes --params-file HAswapNodes.params.fabric",
+        "test": "HAswapNodes",
+        "arguments": "--params-file HAswapNodes.params.fabric",
         "wikiName": "SR HA Swap Nodes",
         "wikiFile": "HAswapNodesWiki.txt",
         "schedules": [
@@ -1199,7 +1215,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRHAscaling": {
-        "test": "HAscaling --params-file HAscaling.params.fabric",
+        "test": "HAscaling",
+        "arguments": "--params-file HAscaling.params.fabric",
         "wikiName": "SR HA Scaling",
         "wikiFile": "HAscalingWiki.txt",
         "schedules": [
@@ -1223,7 +1240,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRHAkillNodes": {
-        "test": "HAkillNodes --params-file HAkillNodes.params.fabric",
+        "test": "HAkillNodes",
+        "arguments": "--params-file HAkillNodes.params.fabric",
         "wikiName": "SR HA Kill Nodes",
         "wikiFile": "HAkillNodes.txt",
         "schedules": [
@@ -1247,7 +1265,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRHAbackupRecover": {
-        "test": "HAbackupRecover --params-file HAbackupRecover.params.fabric",
+        "test": "HAbackupRecover",
+        "arguments": "--params-file HAbackupRecover.params.fabric",
         "wikiName": "SR HA Backup Recover",
         "wikiFile": "HAbackupRecoverWiki.txt",
         "schedules": [
@@ -1271,7 +1290,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRHAupgrade": {
-        "test": "HAupgrade --params-file HAupgrade.params.fabric",
+        "test": "HAupgrade",
+        "arguments": "--params-file HAupgrade.params.fabric",
         "wikiName": "SR HA Upgrade",
         "wikiFile": "HAupgradeWiki.txt",
         "schedules": [
@@ -1280,7 +1300,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRHAupgradeRollback": {
-        "test": "HAupgradeRollback --params-file HAupgradeRollback.params.fabric",
+        "test": "HAupgradeRollback",
+        "arguments": "--params-file HAupgradeRollback.params.fabric",
         "wikiName": "SR HA Upgrade Rollback",
         "wikiFile": "HAupgradeRollbackWiki.txt",
         "schedule": [
@@ -1289,7 +1310,8 @@
         "supportedBranches": [ "all" ]
     },
     "SRDhcprelay-stratum": {
-        "test": "SRDhcprelay --params-file SRDhcprelay.params.stratum",
+        "test": "SRDhcprelay",
+        "arguments": "--params-file SRDhcprelay.params.stratum",
         "wikiName": "SR Dhcp Relay with Stratum BMv2 switches",
         "wikiFile": "SRDhcprelayWiki.txt",
         "schedules": [
@@ -1308,7 +1330,8 @@
         "supportedBranches": [ "onos-2.x", "master" ]
     },
     "SRRouting-stratum": {
-        "test": "SRRouting --params-file SRRouting.params.stratum",
+        "test": "SRRouting",
+        "arguments": "--params-file SRRouting.params.stratum",
         "wikiName": "SR Routing with Stratum BMv2 switches",
         "wikiFile": "SRRoutingWiki.txt",
         "schedules": [
@@ -1327,7 +1350,8 @@
         "supportedBranches": [ "onos-2.x", "master" ]
     },
     "SRBridging-stratum": {
-        "test": "SRBridging --params-file SRBridging.params.stratum",
+        "test": "SRBridging",
+        "arguments": "--params-file SRBridging.params.stratum",
         "wikiName": "SR Bridging with Stratum BMv2 switches",
         "wikiFile": "SRBridgingWiki.txt",
         "schedules": [
@@ -1346,7 +1370,8 @@
         "supportedBranches": [ "onos-2.x", "master" ]
     },
     "SRBridging-tofino": {
-        "test": "SRBridging --params-file SRBridging.params.tofino --topo-file SRBridging.topo.0x1.physical",
+        "test": "SRBridging",
+        "arguments": "--params-file SRBridging.params.tofino --topo-file SRBridging.topo.0x1.physical",
         "wikiName": "SR Bridging with Tofino switches",
         "wikiFile": "SRBridgingWiki.txt",
         "schedules": [