diff --git a/TestON/JenkinsFile/CommonJenkinsFile.groovy b/TestON/JenkinsFile/CommonJenkinsFile.groovy
new file mode 100644
index 0000000..eb7557c
--- /dev/null
+++ b/TestON/JenkinsFile/CommonJenkinsFile.groovy
@@ -0,0 +1,115 @@
+#!groovy
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// read the dependency files
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
+test_list = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
+SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy' )
+
+category = null
+prop = null
+testsToRun = null
+branch = null
+testsFromList = [:]
+graphPaths = [:]
+pipeline = [:]
+
+main()
+
+def main(){
+    init()
+    runTests()
+}
+
+def init(){
+    fileRelated.init()
+    test_list.init()
+    readParams()
+
+    if ( category == "SCPF" ){
+        SCPFfuncs.init()
+        isOldFlow = prop[ "isOldFlow" ] == "true"
+        SCPFfuncs.oldFlowRuleCheck( isOldFlow, prop[ "ONOSBranch" ]
+    } else if ( category == "SR" ){
+        // get the name of the Jenkins job.
+        jobName = env.JOB_NAME
+
+        // additional setup for Segment routing because it is running multiple branch concurrently on different machines.
+        funcs.additionalInitForSR( jobName )
+    }
+
+    funcs.initialize( category );
+
+    // Read the TestONOS.property from the VM
+    prop = funcs.getProperties( category, test_list.addPrefixToBranch( branch ) )
+
+    // get the list of the test and init branch to it.
+    testsFromList = test_list.getTestsFromCategory( category )
+
+    initGraphPaths()
+
+    testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
+}
+
+def readParams(){
+    category = params.Category // "FUNC", "HA", "USECASE", etc.
+    branch = params.Branch
+}
+
+def initGraphPaths(){
+    graphPaths.put( "trendIndividual", fileRelated.trendIndividual )
+    if ( catetgory == "SR" ){
+        graphPaths.put( "saveDirectory", fileRelated.jenkinsWorkspace + "postjob-Fabric" + funcs.fabricOn( prop[ "ONOSBranch" ] ) + "/" )
+    } else if ( category == "SRHA" ) {
+        graphPaths.put( "saveDirectory", fileRelated.jenkinsWorkspace + "postjob-Fabric" + "/" )
+    } else {
+        graphPaths.put( "saveDirectory", fileRelated.jenkinsWorkspace + "postjob-VM/" )
+    }
+}
+
+def runTests(){
+    // run the test sequentially and save the function into the dictionary.
+    for ( String test : testsToRun.keySet() ){
+        def toBeRun = testsToRun.contains( test )
+        def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
+        def pureTestName = ( testsToRun[ test ].containsKey( "test" ) ? testsToRun[ test ][ "test" ].split().head() : test )
+        pipeline[ stepName ] = funcs.runTest( test, toBeRun, prop, pureTestName, false,
+                                           testsToRun, graphPaths[ "trendIndividual" ], graphPaths[ "saveDirectory" ] )
+    }
+
+    // get the start time of the test.
+    start = funcs.getCurrentTime()
+
+    // run the tests sequentially.
+    for ( test in pipeline.keySet() ){
+        pipeline[ test ].call()
+    }
+}
+
+def generateGraphs(){
+    // generate the overall graph of the FUNC tests.
+    funcs.generateOverallGraph( prop, testsToRun, graphPaths[ "saveDirectory" ] )
+}
+
+def sendToSlack(){
+    // send the notification to Slack that running FUNC tests was ended.
+    funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )
+}
diff --git a/TestON/JenkinsFile/FUNCJenkinsFile b/TestON/JenkinsFile/FUNCJenkinsFile
deleted file mode 100644
index caa8669..0000000
--- a/TestON/JenkinsFile/FUNCJenkinsFile
+++ /dev/null
@@ -1,75 +0,0 @@
-#!groovy
-// Copyright 2017 Open Networking Foundation (ONF)
-//
-// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
-// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
-// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
-//
-//     TestON is free software: you can redistribute it and/or modify
-//     it under the terms of the GNU General Public License as published by
-//     the Free Software Foundation, either version 2 of the License, or
-//     (at your option) any later version.
-//
-//     TestON is distributed in the hope that it will be useful,
-//     but WITHOUT ANY WARRANTY; without even the implied warranty of
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//     GNU General Public License for more details.
-//
-//     You should have received a copy of the GNU General Public License
-//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
-
-// This is the Jenkins script for FUNC-pipeline-<branch>
-
-// read the dependency files
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
-test_list = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
-fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
-
-fileRelated.init()
-test_list.init()
-
-// initialize the funcs with category of FUNC
-funcs.initialize( "FUNC" );
-
-// This is a Jenkinsfile for a scripted pipeline for the FUNC tests
-def prop = null
-
-// Read the TestONOS.property from the VM
-prop = funcs.getProperties( "FUNC" )
-
-// get the list of the test and init branch to it.
-FUNC_tests = test_list.getTestsFromCategory( "FUNC" )
-
-// init some directories
-graph_generator_file = fileRelated.trendIndividual
-graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-VM/"
-
-// get the list of the test to run
-echo( "Testcases:" )
-def testsToRun = null
-testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
-funcs.printTestToRun( testsToRun )
-
-// run the test sequentially and save the function into the dictionary.
-def tests = [ : ]
-for ( String test : FUNC_tests.keySet() ){
-    def toBeRun = testsToRun.contains( test )
-    def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
-    def pureTestName = ( FUNC_tests[ test ].containsKey( "test" ) ? FUNC_tests[ test ][ "test" ].split().head() : test )
-    tests[ stepName ] = funcs.runTest( test, toBeRun, prop, pureTestName, false,
-                                       FUNC_tests, graph_generator_file, graph_saved_directory )
-}
-
-// get the start time of the test.
-start = funcs.getCurrentTime()
-
-// run the tests sequentially.
-for ( test in tests.keySet() ){
-    tests[ test ].call()
-}
-
-// generate the overall graph of the FUNC tests.
-funcs.generateOverallGraph( prop, FUNC_tests, graph_saved_directory )
-
-// send the notification to Slack that running FUNC tests was ended.
-funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )
diff --git a/TestON/JenkinsFile/FabricJenkinsfileTrigger b/TestON/JenkinsFile/FabricJenkinsfileTrigger
deleted file mode 100644
index 4c9c822..0000000
--- a/TestON/JenkinsFile/FabricJenkinsfileTrigger
+++ /dev/null
@@ -1,229 +0,0 @@
-#!groovy
-// Copyright 2017 Open Networking Foundation (ONF)
-//
-// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
-// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
-// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
-//
-//     TestON is free software: you can redistribute it and/or modify
-//     it under the terms of the GNU General Public License as published by
-//     the Free Software Foundation, either version 2 of the License, or
-//     (at your option) any later version.
-//
-//     TestON is distributed in the hope that it will be useful,
-//     but WITHOUT ANY WARRANTY; without even the implied warranty of
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//     GNU General Public License for more details.
-//
-//     You should have received a copy of the GNU General Public License
-//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
-
-// This is the Jenkins script for the fabric-pipeline-trigger
-
-// init dependencies functions
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
-test_list = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
-triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/TriggerFuncs.groovy' )
-fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
-
-fileRelated.init()
-test_list.init()
-
-// Function that will initialize the configuration of the Fabric.
-funcs.initializeTrend( "Fabric" )
-funcs.initialize( "Fabric" )
-triggerFuncs.init( funcs )
-
-// Wiki contents is the contents for https://wiki.onosproject.org/display/ONOS/Automated+Test+Schedule
-// It will only be used by the VM_BMJenkinsTrigger not in here.
-wikiContents = ""
-
-all_testcases = [:]
-
-// set some variables from the parameter
-manually_run = params.manual_run
-onos_tag = params.ONOSTag
-isOldFlow = true
-
-// Set tests based on day of week
-def now = funcs.getCurrentTime()
-print now.toString()
-today = now[ Calendar.DAY_OF_WEEK ]
-
-dayMap = [ ( Calendar.MONDAY )    : "mon",
-           ( Calendar.TUESDAY )   : "tue",
-           ( Calendar.WEDNESDAY ) : "wed",
-           ( Calendar.THURSDAY )  : "thu",
-           ( Calendar.FRIDAY )    : "fri",
-           ( Calendar.SATURDAY )  : "sat",
-           ( Calendar.SUNDAY )    : "sun" ]
-fullDayMap = [ ( Calendar.MONDAY )    : "Monday",
-               ( Calendar.TUESDAY )   : "Tuesday",
-               ( Calendar.WEDNESDAY ) : "Wednesday",
-               ( Calendar.THURSDAY )  : "Thursday",
-               ( Calendar.FRIDAY )    : "Friday",
-               ( Calendar.SATURDAY )  : "Saturday",
-               ( Calendar.SUNDAY )    : "Sunday" ]
-
-
-// if it is manually run, it will set the onos version to be what it was passed by.
-// Currently, SR-pipeline-manually is not supported due to the special way of it is executed.
-if ( manually_run ){
-    onos_branches = params.branches.tokenize( "\n;, " )
-} else {
-    onos_branches = test_list.getBranchesFromDay( today )
-}
-
-testcases_template = [
-        "FUNC": [ tests: "", nodeName: "VM", wikiContent: "" ],
-        "HA": [ tests: "", nodeName: "VM", wikiContent: "" ],
-        "SCPF": [ tests: "", nodeName: "BM", wikiContent: "" ],
-        "SR": [ tests: "", nodeName: "Fabric", wikiContent: "" ],
-        "SRHA": [ tests: "", nodeName: "Fabric", wikiContent: "" ],
-        "USECASE": [ tests: "", nodeName: "BM", wikiContent: "" ]
-]
-
-for ( String b in onos_branches ){
-    all_testcases.put( b, testcases_template )
-}
-
-day = ""
-
-// initialize the graph generating files.
-stat_graph_generator_file = fileRelated.histogramMultiple
-pie_graph_generator_file = fileRelated.pieMultiple
-graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-Fabric/"
-
-// get the post_result. This will be affected only for the manual runs.
-post_result = params.PostResult
-
-if ( manually_run ){
-    for ( String b in onos_branches ){
-        all_testcases[ b ] = triggerFuncs.organize_tests( params.Tests, all_testcases[ b ] )
-    }
-    isOldFlow = params.isOldFlow
-    println "Tests to be run manually : "
-} else {
-    for ( String b in onos_branches ){
-        // set the list of the tests to run.
-        all_testcases[ b ][ "SR" ][ "tests" ] += adder( "SR", dayMap[ today ], true, b )
-        all_testcases[ b ][ "SRHA" ][ "tests" ] += adder( "SRHA", dayMap[ today ], true, b )
-    }
-    println "Defaulting to " + day + " tests:"
-}
-
-// print out the list of the test to run on Jenkins
-for ( String b in onos_branches ){
-    triggerFuncs.print_tests( all_testcases[ b ] )
-}
-
-// This will hold the block of code to be run.
-def runTest = [
-
-]
-for ( String b in onos_branches ){
-    if ( manually_run ){
-        // for manual run situation.
-        for ( String test in all_testcases[ b ].keySet() ){
-            println test
-            // Unless the list of the tests on the test category is empty, it will save the block of code to run in dictionary.
-            if ( all_testcases[ b ][ test ][ "tests" ] != "" ){
-                runTest[ all_testcases[ b ][ test ][ "nodeName" ][ nodeOn( b ) ] ][ test ] = triggerFuncs.
-                        trigger_pipeline( b,
-                                          all_testcases[ b ][ test ][ "tests" ],
-                                          all_testcases[ b ][ test ][ "nodeName" ][ nodeOn( b ) ],
-                                          test,
-                                          manually_run,
-                                          onos_tag )
-            }
-        }
-    }
-    else {
-        // for automated situation, it will save current version to Fabric4, previous version to Fabric2 and before_previous_version to Fabric3.
-        runTest[ "Fabric4" ][ "SR" ] = triggerFuncs.trigger_pipeline( "master",
-                                                                      all_testcases[ b ][ "SR" ][ "tests" ],
-                                                                      all_testcases[ b ][ "SR" ][ "nodeName" ][ 2 ],
-                                                                      "SR",
-                                                                      manually_run, onos_tag )
-        runTest[ "Fabric2" ][ "SR" ] = triggerFuncs.trigger_pipeline( test_list.convertBranchCodeToBranch( "onos-2.x" ),
-                                                                      all_testcases[ b ][ "SR" ][ "tests" ],
-                                                                      all_testcases[ b ][ "SR" ][ "nodeName" ][ 0 ],
-                                                                      "SR",
-                                                                      manually_run, onos_tag )
-        runTest[ "Fabric3" ][ "SR" ] = triggerFuncs.trigger_pipeline( test_list.convertBranchCodeToBranch( "onos-1.x" ),
-                                                                      all_testcases[ b ][ "SR" ][ "tests" ],
-                                                                      all_testcases[ b ][ "SR" ][ "nodeName" ][ 1 ],
-                                                                      "SR",
-                                                                      manually_run, onos_tag )
-        runTest[ "Fabric" ][ "SRHA" ] = triggerFuncs.trigger_pipeline( "master",
-                                                                       all_testcases[ b ][ "SRHA" ][ "tests" ],
-                                                                       all_testcases[ b ][ "SRHA" ][ "nodeName" ],
-                                                                       "SRHA",
-                                                                       manually_run, onos_tag )
-    }
-}
-
-def finalList = [ : ]
-
-// It will run each category of test to run sequentially on each branch.
-finalList[ "Fabric" ] = triggerFuncs.runTestSeq( runTest[ "Fabric" ] )
-finalList[ "Fabric2" ] = triggerFuncs.runTestSeq( runTest[ "Fabric2" ] )
-finalList[ "Fabric3" ] = triggerFuncs.runTestSeq( runTest[ "Fabric3" ] )
-finalList[ "Fabric4" ] = triggerFuncs.runTestSeq( runTest[ "Fabric4" ] )
-
-// It will then run Fabric2, Fabric3 and Fabric4 concurrently.
-// In our case,
-//                      ----> Fabric4 : current_version
-// This pipeline -----> ----> Fabric2 : previous_version
-//                      ----> Fabric3 : before_previous_version
-parallel finalList
-
-// Way we are generating pie graphs. not supported in SegmentRouting yet.
-/*
-if ( !manually_run ){
-    funcs.generateStatGraph( "TestStation-Fabric4s",
-                             funcs.branchWithPrefix( current_version ),
-                             AllTheTests,
-                             stat_graph_generator_file,
-                             pie_graph_generator_file,
-                             graph_saved_directory )
-    funcs.generateStatGraph( "TestStation-Fabric2s",
-                             funcs.branchWithPrefix( previous_version ),
-                             AllTheTests,
-                             stat_graph_generator_file,
-                             pie_graph_generator_file,
-                             graph_saved_directory )
-    funcs.generateStatGraph( "TestStation-Fabric3s",
-                             funcs.branchWithPrefix( before_previous_version ),
-                             AllTheTests,
-                             stat_graph_generator_file,
-                             pie_graph_generator_file,
-                             graph_saved_directory )
-}*/
-
-// Way to add list of the tests with specific category to the result
-def adder( category, day, getResult, branch ){
-    // category : the category of the test which will be either FUNC,HA,SR...
-    // day : the day you are trying to add (m,t,w,th... )
-    // getResult : if want to get the list of the test to be run. False will return empty list.
-    //             And once the list is empty, it will not be run.
-    def result = ""
-    selectedTests = test_list.getTestsFromCategory( category, test_list.getTestsFromDay( day, branch ) )
-
-    for ( String test in selectedTests.keySet() ){
-        if ( getResult ){
-            result += test + ","
-        }
-    }
-    return result
-}
-
-// check which node is on.
-def nodeOn( branch ){
-    switch ( branch ){
-        case "master": return 2
-        case convertBranchCodeToBranch( "onos-2.x" ): return 0
-        case convertBranchCodeToBranch( "onos-1.x" ): return 1
-        default: return 3
-    }
-}
diff --git a/TestON/JenkinsFile/HAJenkinsFile b/TestON/JenkinsFile/HAJenkinsFile
deleted file mode 100644
index b5f1a7e..0000000
--- a/TestON/JenkinsFile/HAJenkinsFile
+++ /dev/null
@@ -1,74 +0,0 @@
-#!groovy
-// Copyright 2017 Open Networking Foundation (ONF)
-//
-// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
-// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
-// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
-//
-//     TestON is free software: you can redistribute it and/or modify
-//     it under the terms of the GNU General Public License as published by
-//     the Free Software Foundation, either version 2 of the License, or
-//     (at your option) any later version.
-//
-//     TestON is distributed in the hope that it will be useful,
-//     but WITHOUT ANY WARRANTY; without even the implied warranty of
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//     GNU General Public License for more details.
-//
-//     You should have received a copy of the GNU General Public License
-//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
-
-// This is the Jenkins script for HA-pipeline-<branch>
-
-// read the dependency files
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
-test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
-fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
-
-fileRelated.init()
-test_list.init()
-
-// initialize the funcs with category of HA
-funcs.initialize( "HA" );
-
-// This is a Jenkinsfile for a scripted pipeline for the FUNC tests
-def prop = null
-
-// Read the TestONOS.property from the VM
-prop = funcs.getProperties( "HA" )
-
-// get the list of the test and init branch to it.
-HA_tests = test_list.getTestsFromCategory( "HA" )
-
-// init some directories
-graph_generator_file = fileRelated.trendIndividual
-graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-VM/"
-
-// get the list of the test to run
-echo( "Testcases:" )
-def testsToRun = null
-testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
-funcs.printTestToRun( testsToRun )
-
-// run the test sequentially and save the function into the dictionary.
-def tests = [ : ]
-for ( String test : HA_tests.keySet() ){
-    toBeRun = testsToRun.contains( test )
-    def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
-    def pureTestName = ( HA_tests[ test ].containsKey( "test" ) ? HA_tests[ test ][ "test" ].split().head() : test )
-    tests[ stepName ] = funcs.runTest( test, toBeRun, prop, pureTestName, false,
-                                       HA_tests, graph_generator_file, graph_saved_directory )
-}
-
-// get the start time of the test.
-start = funcs.getCurrentTime()
-// run the tests sequentially.
-for ( test in tests.keySet() ){
-    tests[ test ].call()
-}
-
-// generate the overall graph of the HA tests.
-funcs.generateOverallGraph( prop, HA_tests, graph_saved_directory )
-
-// send the notification to Slack that running HA tests was ended.
-funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )
diff --git a/TestON/JenkinsFile/VM_BMJenkinsfileTrigger b/TestON/JenkinsFile/MasterTrigger.groovy
similarity index 97%
rename from TestON/JenkinsFile/VM_BMJenkinsfileTrigger
rename to TestON/JenkinsFile/MasterTrigger.groovy
index 8a140ef..8347add 100644
--- a/TestON/JenkinsFile/VM_BMJenkinsfileTrigger
+++ b/TestON/JenkinsFile/MasterTrigger.groovy
@@ -171,7 +171,6 @@
         println "Defaulting to " + day + " tests:"
     }
     for ( list in runList ){
-    //     triggerFuncs.print_tests( all_testcases[ b ] )
         echo "" + list
     }
 }
@@ -227,7 +226,7 @@
     if ( !manually_run ){
         for ( String b in onos_branches ){
             funcs.generateStatGraph( "TestStation-VMs",
-                                     funcs.branchWithPrefix( b ),
+                                     test_list.addPrefixToBranch( b ),
                                      graphPaths[ "histogramMultiple" ],
                                      graphPaths[ "pieMultiple" ],
                                      graphPaths[ "saveDirectory" ] )
diff --git a/TestON/JenkinsFile/SCPFJenkinsFile b/TestON/JenkinsFile/SCPFJenkinsFile
deleted file mode 100644
index b553af4..0000000
--- a/TestON/JenkinsFile/SCPFJenkinsFile
+++ /dev/null
@@ -1,63 +0,0 @@
-#!groovy
-// Copyright 2017 Open Networking Foundation (ONF)
-//
-// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
-// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
-// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
-//
-//     TestON is free software: you can redistribute it and/or modify
-//     it under the terms of the GNU General Public License as published by
-//     the Free Software Foundation, either version 2 of the License, or
-//     (at your option) any later version.
-//
-//     TestON is distributed in the hope that it will be useful,
-//     but WITHOUT ANY WARRANTY; without even the implied warranty of
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//     GNU General Public License for more details.
-//
-//     You should have received a copy of the GNU General Public License
-//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
-
-// This is the Jenkins script for SCPF-pipeline-<branch>
-
-// read the dependency files
-SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy' )
-SCPFfuncs.init()
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
-
-// init funcs with SCPF specification
-funcs.initialize( "SCPF", SCPFfuncs )
-
-// read the information from TestON.property on BM
-def prop = null
-prop = funcs.getProperties( "SCPF" )
-
-// get the list of the test to run.
-echo( "Testcases:" )
-def testsToRun = null
-testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
-funcs.printTestToRun( testsToRun )
-
-// check if it is using old flow.
-isOldFlow = prop[ "isOldFlow" ] == "true"
-SCPFfuncs.oldFlowRuleCheck( isOldFlow, prop[ "ONOSBranch" ] )
-
-// set test to run as a list of function
-def tests = [ : ]
-for ( String test : SCPFfuncs.SCPF.keySet() ){
-    toBeRun = testsToRun.contains( test )
-    def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
-
-    def pureTestName = test.replaceAll( "WithFlowObj", "" )
-    tests[ stepName ] = funcs.runTest( test, toBeRun, prop, pureTestName, false, SCPFfuncs.SCPF, "", "" )
-}
-
-// get start time
-start = funcs.getCurrentTime()
-// run the tests sequentially
-for ( test in tests.keySet() ){
-    tests[ test ].call()
-}
-
-// send result to slack after running test is done.
-funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )
diff --git a/TestON/JenkinsFile/SRHAJenkinsFile b/TestON/JenkinsFile/SRHAJenkinsFile
deleted file mode 100644
index 90c882c..0000000
--- a/TestON/JenkinsFile/SRHAJenkinsFile
+++ /dev/null
@@ -1,74 +0,0 @@
-#!groovy
-// Copyright 2018 Open Networking Foundation (ONF)
-//
-// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
-// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
-// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
-//
-//     TestON is free software: you can redistribute it and/or modify
-//     it under the terms of the GNU General Public License as published by
-//     the Free Software Foundation, either version 2 of the License, or
-//     (at your option) any later version.
-//
-//     TestON is distributed in the hope that it will be useful,
-//     but WITHOUT ANY WARRANTY; without even the implied warranty of
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//     GNU General Public License for more details.
-//
-//     You should have received a copy of the GNU General Public License
-//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
-
-// This is the Jenkins script for SRHA-pipeline-<branch>
-
-// read dependencies.
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
-test_list = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
-fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
-
-// init configuration to be SR
-fileRelated.init()
-test_list.init()
-funcs.initialize( "SR" )
-
-// Allow to run with --params-file argument
-hasArgs = true
-
-// get the name of the Jenkins job.
-jobName = env.JOB_NAME
-
-// read the TestON.property depends on which branch it is running.
-// ( currently master on Fabric4, 2.1 on Fabric3 and 1.15 on Fabric2 )
-def prop = null
-prop = funcs.getProperties( "SRHA" )
-SRHA_tests = test_list.getTestsFromCategory( "SRHA" )
-
-// set the file paths and directory
-graph_generator_file = fileRelated.trendIndividual
-graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-Fabric" + "/"
-
-// get the list of the tests.
-echo( "Testcases:" )
-def testsToRun = null
-testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
-funcs.printTestToRun( testsToRun )
-
-// save the functions to run test in the dictionary.
-def tests = [ : ]
-for ( String test : SRHA_tests.keySet() ){
-    toBeRun = testsToRun.contains( test )
-    def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
-    def pureTestName = ( SRHA_tests[ test ].containsKey( "test" ) ? SRHA_tests[ test ][ "test" ].split().head() : test )
-    tests[ stepName ] = funcs.runTest( test, toBeRun, prop, pureTestName, false,
-                                       SRHA_tests, graph_generator_file, graph_saved_directory )
-}
-
-// get start time
-start = funcs.getCurrentTime()
-
-// run the tests sequentially
-for ( test in tests.keySet() ){
-    tests[ test ].call()
-}
-//funcs.generateOverallGraph( prop, SR, graph_saved_directory )
-// send the notification of ending test after SRHA tests are done.
-funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )
diff --git a/TestON/JenkinsFile/SRJenkinsFile b/TestON/JenkinsFile/SRJenkinsFile
deleted file mode 100644
index c24a47b..0000000
--- a/TestON/JenkinsFile/SRJenkinsFile
+++ /dev/null
@@ -1,74 +0,0 @@
-#!groovy
-// Copyright 2017 Open Networking Foundation (ONF)
-//
-// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
-// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
-// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
-//
-//     TestON is free software: you can redistribute it and/or modify
-//     it under the terms of the GNU General Public License as published by
-//     the Free Software Foundation, either version 2 of the License, or
-//     (at your option) any later version.
-//
-//     TestON is distributed in the hope that it will be useful,
-//     but WITHOUT ANY WARRANTY; without even the implied warranty of
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//     GNU General Public License for more details.
-//
-//     You should have received a copy of the GNU General Public License
-//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
-
-// This is the Jenkins script for SR-pipeline-<branch>
-
-// read dependencies.
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
-test_list = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
-fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
-
-// init configuration to be SR
-fileRelated.init()
-test_list.init()
-funcs.initialize( "SR" )
-
-// get the name of the Jenkins job.
-jobName = env.JOB_NAME
-
-// additional setup for Segment routing because it is running multiple branch concurrently on different machines.
-funcs.additionalInitForSR( jobName )
-
-// read the TestON.property depends on which branch it is running.
-// ( currently master on Fabric4, 1.15 on Fabric2 and 2.1 on Fabric3 )
-def prop = null
-prop = funcs.getProperties( "SR" )
-SR_tests = test_list.getTestsFromCategory( "SR" )
-
-// set the file paths and directory
-graph_generator_file = fileRelated.trendIndividual
-graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-Fabric" + funcs.fabricOn( prop[ "ONOSBranch" ] ) + "/"
-
-// get the list of the tests.
-echo( "Testcases:" )
-def testsToRun = null
-testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
-funcs.printTestToRun( testsToRun )
-
-// save the functions to run test in the dictionary.
-def tests = [ : ]
-for ( String test : SR_tests.keySet() ){
-    toBeRun = testsToRun.contains( test )
-    def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
-    def pureTestName = ( SR_tests[ test ].containsKey( "test" ) ? SR_tests[ test ][ "test" ].split().head() : test )
-    tests[ stepName ] = funcs.runTest( test, toBeRun, prop, pureTestName, false,
-                                     SR_tests, graph_generator_file, graph_saved_directory )
-}
-
-// get start time
-start = funcs.getCurrentTime()
-
-// run the tests sequentially
-for ( test in tests.keySet() ){
-    tests[ test ].call()
-}
-//funcs.generateOverallGraph( prop, SR, graph_saved_directory )
-// send the notification of ending test after SR tests is done.
-funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )
diff --git a/TestON/JenkinsFile/USECASEJenkinsFile b/TestON/JenkinsFile/USECASEJenkinsFile
deleted file mode 100644
index 4200f9a..0000000
--- a/TestON/JenkinsFile/USECASEJenkinsFile
+++ /dev/null
@@ -1,69 +0,0 @@
-#!groovy
-// Copyright 2017 Open Networking Foundation (ONF)
-//
-// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
-// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
-// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
-//
-//     TestON is free software: you can redistribute it and/or modify
-//     it under the terms of the GNU General Public License as published by
-//     the Free Software Foundation, either version 2 of the License, or
-//     (at your option) any later version.
-//
-//     TestON is distributed in the hope that it will be useful,
-//     but WITHOUT ANY WARRANTY; without even the implied warranty of
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//     GNU General Public License for more details.
-//
-//     You should have received a copy of the GNU General Public License
-//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
-
-// This is the Jenkins script for USECASE-pipeline-<branch>
-
-// set the dependencies.
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
-test_list = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
-fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
-
-// init configuration of funcs to be USECASE
-fileRelated.init()
-test_list.init()
-funcs.initialize( "USECASE" );
-
-// read the TestON.property files and save it as a dictionary
-def prop = null
-prop = funcs.getProperties( "USECASE" )
-USECASE_tests = test_list.getTestsFromCategory( "USECASE" )
-
-// save directory and file.
-graph_generator_file = fileRelated.trendIndividual
-graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-BM/"
-
-// get tests to run.
-echo( "Testcases:" )
-def testsToRun = null
-testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
-funcs.printTestToRun( testsToRun )
-
-// save the function of the test running into the dictionary.
-def tests = [ : ]
-for ( String test : USECASE_tests.keySet() ){
-    toBeRun = testsToRun.contains( test )
-    def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
-    def pureTestName = ( USECASE_tests[ test ].containsKey( "test" ) ? USECASE_tests[ test ][ "test" ].split().head() : test )
-    tests[ stepName ] = funcs.runTest( test, toBeRun, prop, pureTestName, false,
-                                       USECASE_tests, graph_generator_file, graph_saved_directory )
-}
-
-// get start time of the test.
-start = funcs.getCurrentTime()
-// run the tests sequentially
-for ( test in tests.keySet() ){
-    tests[ test ].call()
-}
-
-// send the result to slack after USECASE test is done.
-funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )
-
-// generate the overall graph for USECASE.
-funcs.generateOverallGraph( prop, USECASE_tests, graph_saved_directory )
diff --git a/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy b/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
index f57fefb..be93b7f 100644
--- a/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
+++ b/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
@@ -114,18 +114,13 @@
     }
 }
 
-def printType(){
-    // print the test type and test machine that was initialized.
-
-    echo testType
-    echo testMachine
-}
-
-def getProperties( category ){
+def getProperties( category, branchWithPrefix ){
     // get the properties of the test by reading the TestONOS.property
 
+    filePath = '''/var/jenkins/TestONOS-''' + category + '''-''' + branchWithPrefix + '''.property'''
+
     node( testMachine ) {
-        return readProperties( file: '/var/jenkins/TestONOS-' + category + '.property' )
+        return readProperties( file: filePath )
     }
 }
 
@@ -142,20 +137,6 @@
     return new Date()
 }
 
-def getTotalTime( start, end ){
-    // get total time of the test using start and end time.
-
-    return TimeCategory.minus( end, start )
-}
-
-def printTestToRun( testList ){
-    // printout the list of the test in the list.
-
-    for ( String test : testList ){
-        println test
-    }
-}
-
 def sendResultToSlack( start, isManualRun, branch ){
     // send the result of the test to the slack when it is not manually running.
     // start : start time of the test
@@ -334,7 +315,6 @@
     node( testMachine ) {
         def alarmFile = workSpace + "/" + pureTestName + "Alarm.txt"
         if ( fileExists( alarmFile ) ) {
-            print "Abnormal test result logged"
             def alarmContents = readFile( alarmFile )
             slackSend( channel: getSlackChannel(),
                        color: "FF0000",
@@ -348,10 +328,10 @@
                                 ( resultURL != "" ? ( "\n[Karaf log] : \n" +
                                                       resultURL + "artifact/" ) : "" ),
                        teamDomain: 'onosproject' )
-            Failed
+            throw new Exception( "Abnormal test result." )
         }
         else {
-            print "Test results are normal"
+            print "Test results are normal."
         }
     }
 }
@@ -573,27 +553,4 @@
                                 "ALL", onos_branch, testListParam, graph_saved_directory, pieTestListParam )
 }
 
-def branchWithPrefix( branch ){
-    // get the branch with the prefix ( "onos-" )
-    return ( ( branch != "master" ) ? "onos-" : "" ) + branch
-}
-
-def testBranchWithPrefix( branch ){
-    // get TestON branch with the prefix ( "onos-" )
-    if ( branch == "1.12" )
-        return "onos-1.13"
-    else if ( branch == "1.13" )
-        return "onos-1.13"
-    else if ( branch == "1.14" )
-        return "onos-1.15"
-    else if ( branch == "1.15" )
-        return "onos-1.15"
-    else if ( branch == "2.0" )
-        return "onos-2.0"
-    else if ( branch == "2.1" )
-        return "onos-2.1"
-    else
-        return "master"
-}
-
 return this
diff --git a/TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy b/TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy
index a93fa1c..2a358df 100644
--- a/TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy
+++ b/TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy
@@ -23,6 +23,7 @@
 schedules = [:]
 branches = [:]
 
+// read all json files and save as maps
 def init(){
     def tests_buffer = readTrusted( "TestON/JenkinsFile/dependencies/tests.json" )
     def schedules_buffer = readTrusted( "TestON/JenkinsFile/dependencies/schedule.json" )
@@ -60,6 +61,7 @@
     return str_result[ 0..-2 ]
 }
 
+// given a list of tests as a string, returns the list of tests as a map, similar formatted to tests.json
 def getTestsFromStringList( list ){
     testsResult = [:]
     for ( item in list ){
@@ -85,14 +87,15 @@
     return schedulePropertyResult
 }
 
-def getAllBranches(){
-    return branches
-}
-
 // ********
 // Branches
 // ********
 
+// returns all branches from branches.json
+def getAllBranches(){
+    return branches
+}
+
 // given a day, returns all branches that are run on that day
 def getBranchesFromDay( day, tests=[:] ){
     branchesFromDayResult = []
@@ -125,6 +128,8 @@
     return branch_code
 }
 
+// given a branch, returns the corresponding branch code (hack)
+// Example: given "onos-1.15", returns "onos-1.x"
 def convertBranchToBranchCode( branch ){
     if ( branch == "master" ){
         return branch
@@ -135,6 +140,16 @@
     }
 }
 
+// given a branch without a prefix, returns the branch with the "onos-" prefix
+def addPrefixToBranch( branchNoPrefix ){
+    if ( branchNoPrefix == "master" ){
+        return "master"
+    } else {
+        return "onos-" + branchNoPrefix
+    }
+}
+
+// given a branch with the prefix "onos-", returns the branch without the prefix
 def removePrefixFromBranch( branchWithPrefix ){
     return branchWithPrefix.minus( "onos-" )
 }
@@ -157,6 +172,7 @@
     return testsFromCategoryResult
 }
 
+// given the test name, returns the category (FUNC, HA, etc.) of that test
 def getCategoryOfTest( test_name, tests=[:] ){
     if ( tests == [:] ){
         tests = allTests
@@ -164,6 +180,7 @@
     return tests[ test_name ][ "category" ]
 }
 
+// returns all categories of all tests, or the given test list
 def getAllTestCategories( tests=[:] ){
     testCategoriesResult = []
     if ( tests == [:] ){
@@ -232,7 +249,7 @@
 }
 
 // Given a test name and branch, return the node label associated.
-def getNodeLabel( test_name, branch, tests ){
+def getNodeLabel( test_name, branch, tests=[:] ){
     if ( tests == [:] ){
         tests = allTests
     }
@@ -244,7 +261,8 @@
     }
 }
 
-def getAllNodeLabels( branch, tests ){
+// given a branch, returns all nodeLabels from all tests, or a given test list
+def getAllNodeLabels( branch, tests=[:] ){
     nodeLabelResult = []
     if ( tests == [:] ){
         tests = allTests
diff --git a/TestON/JenkinsFile/dependencies/TriggerFuncs.groovy b/TestON/JenkinsFile/dependencies/TriggerFuncs.groovy
index 1795ba3..2aba5d2 100644
--- a/TestON/JenkinsFile/dependencies/TriggerFuncs.groovy
+++ b/TestON/JenkinsFile/dependencies/TriggerFuncs.groovy
@@ -30,15 +30,6 @@
     funcs = commonFuncs
 }
 
-def lastCommaRemover( str ){
-    // function that will remove the last comma from the string
-
-    if ( str.size() > 0 && str[ str.size() - 1 ] == ',' ){
-        str = str.substring( 0, str.size() - 1 )
-    }
-    return str
-}
-
 def printDaysForTest(){
     // Print the days for what test has.
     AllTheTests = test_list.getAllTests()
@@ -46,9 +37,9 @@
     result = ""
     for ( String test in AllTheTests.keySet() ){
         result += test + ": ["
-        test_schedule = test_list.getTestSchedule( test )
-        for ( String sch in test_schedule.keySet() ){
-            for ( String day in test_list.convertScheduleKeyToDays( sch ) ){
+        test_schedule = AllTheTests[ test ][ "schedules" ]
+        for ( String sch_dict in test_schedule ){
+            for ( String day in test_list.convertScheduleKeyToDays( sch_dict[ "branch" ] ) ){
                 result += day + " "
             }
         }
@@ -57,58 +48,13 @@
     return result
 }
 
-def runTestSeq( testList ){
-    // Running the test sequentially
-    return {
-        for ( test in testList.keySet() ){
-            testList[ test ].call()
-        }
-    }
-}
-
-def print_tests( tests ){
-    // print the list of the tsets to be run
-
-    for ( String test in tests.keySet() ){
-        if ( tests[ test ][ "tests" ] != "" ){
-            println test + ":"
-            println tests[ test ][ "tests" ]
-        }
-    }
-}
-
-def organize_tests( tests, testcases ){
-    // organize the test to its category using its name.
-    // most of the time it will use the first two character of the test name
-    // but there are some exceptions like FUNCbgpls or FUNCvirNetNB since they are now under USECASE
-
-    // depends on the first two letters of the test name, it will decide which category to put the test into.
-    def prefixes = [
-            "FU": "FUNC",
-            "HA": "HA",
-            "PL": "USECASE",
-            "SA": "USECASE",
-            "SC": "SCPF",
-            "SR": "SR",
-            "US": "USECASE",
-            "VP": "USECASE"
-    ]
-
-    def testList = tests.tokenize( "\n;, " )
-    for ( String test in testList ){
-        String prefix = ( test == "FUNCbgpls" || test == "FUNCvirNetNB" ) ? "US" : ( test[ 0..1 ] )
-        testcases[ prefixes[ prefix ] ][ "tests" ] += test + ","
-    }
-    return testcases
-}
-
 def trigger( branch, tests, nodeName, jobOn, manuallyRun, onosTag ){
     // triggering function that will setup the environment and determine which pipeline to trigger
 
     println "Job name: " + jobOn + "-pipeline-" + ( manuallyRun ? "manually" : branch )
     def wiki = branch
-    def onos_branch = funcs.branchWithPrefix( branch )
-    def test_branch = funcs.testBranchWithPrefix( branch )
+    def onos_branch = test_list.addPrefixToBranch( branch )
+    def test_branch = test_list.addPrefixToBranch( branch )
     println "onos_branch with prefix: " + onos_branch
     println "test_branch with prefix: " + test_branch
     node( "TestStation-" + nodeName + "s" ) {
@@ -117,7 +63,7 @@
     }
 
     jobToRun = jobOn + "-pipeline-" + ( manuallyRun ? "manually" : wiki )
-    build job: jobToRun, propagate: false
+    build job: jobToRun, propagate: false, parameters: [ [ $class: 'StringParameterValue', name: 'Category', value: jobOn ], [ $class: 'StringParameterValue', name: 'Branch', value: branch ] ]
 }
 
 def trigger_pipeline( branch, tests, nodeName, jobOn, manuallyRun, onosTag ){
@@ -134,7 +80,7 @@
 def exportEnvProperty( onos_branch, test_branch, jobOn, wiki, tests, postResult, manually_run, onosTag, isOldFlow ){
     // export environment properties to the machine.
 
-    filePath = "/var/jenkins/TestONOS-" + jobOn + ".property"
+    filePath = "/var/jenkins/TestONOS-" + jobOn + "-" + onos_branch + ".property"
 
     stage( "export Property" ) {
         sh '''
