Fix for SCPF Jenkins Automation

Change-Id: I7ebe882a7e4e1711f4da4525d60333a2205d1078
diff --git a/TestON/JenkinsFile/CommonJenkinsFile.groovy b/TestON/JenkinsFile/CommonJenkinsFile.groovy
index b7e1f63..da75d4d 100644
--- a/TestON/JenkinsFile/CommonJenkinsFile.groovy
+++ b/TestON/JenkinsFile/CommonJenkinsFile.groovy
@@ -50,17 +50,16 @@
 
     if ( category == "SCPF" ){
         // SCPF needs to obtain properties earlier
-        funcs.initialize( "SCPF", SCPFfuncs )
+        funcs.initialize( category, SCPFfuncs );
         prop = funcs.getProperties( category, test_list.addPrefixToBranch( branch ) )
 
         SCPFfuncs.init()
         isOldFlow = prop[ "isOldFlow" ] == "true"
         SCPFfuncs.oldFlowRuleCheck( isOldFlow, prop[ "ONOSBranch" ] )
     } else if ( category == "SR" ){
+        funcs.initialize( category );
         // get the name of the Jenkins job.
         jobName = env.JOB_NAME
-        funcs.initialize( category );
-
         // additional setup for Segment routing because it is running multiple branch concurrently on different machines.
         funcs.additionalInitForSR( jobName )
         prop = funcs.getProperties( category, test_list.addPrefixToBranch( branch ) )
diff --git a/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy b/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
index be93b7f..43a06b2 100644
--- a/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
+++ b/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
@@ -40,34 +40,21 @@
     testMachine = "TestStation-" + machine + "s"
     this.machine = machine
     isSCPF = false
-    hasArgs = false
     isTrend = true
 }
 
-def initialize( type, SCPFfuncs ){
-    // Initializing for SCPF tests
-    // type : type of the test ( SR,FUNC,SCPF... )
-    // Passing the SCPFfunction which will be PerformanceFuncs.groovy
-
-    init( type )
-    SCPFfunc = SCPFfuncs
-    isSCPF = true
-    hasArgs = true // Has TestON cli arguments to be added when running the test
-    machine = machineType[ type ]
-}
-
-def initialize( type ){
+def initialize( type, SCPFfuncs=null ){
     // initializing for FUNC,HA,SR, and USECASE
     // type : type of the test ( SR,FUNC,SCPF... )
 
     init( type )
-    SCPFfunc = null
+    isSCPF = ( category == "SCPF" )
+    SCPFfunc = SCPFfuncs
+
     table_name = "executed_test_tests"
     result_name = "executed_test_results"
     trend_generator_file = fileRelated.trendMultiple
     build_stats_generator_file = fileRelated.histogramMultiple
-    isSCPF = false
-    hasArgs = false
 }
 
 def init( type ){
@@ -184,7 +171,7 @@
         git log | head
         ./cleanup.sh -f
         ''' + "./cli.py run " +
-           ( !hasArgs ? testName : testCategory[ testName ][ 'test' ] ) +
+          testName +
            " --params GRAPH/nodeCluster=" + machineType[ testType ] + '''
         ./cleanup.sh -f
         # cleanup config changes