Merge "[ONOS-7502] Run SRRouting tests with routers"
diff --git a/TestON/JenkinsFile/JenkinsCommonFuncs.groovy b/TestON/JenkinsFile/JenkinsCommonFuncs.groovy
index 906c05d..3a2eddd 100644
--- a/TestON/JenkinsFile/JenkinsCommonFuncs.groovy
+++ b/TestON/JenkinsFile/JenkinsCommonFuncs.groovy
@@ -48,6 +48,7 @@
   testList.tokenize("\n;, ")
 }
 def getCurrentTime(){
+  TimeZone.setDefault( TimeZone.getTimeZone('PST') )
   return new Date();
 }
 def getTotalTime( start, end ){
@@ -76,7 +77,8 @@
         shopt -s expand_aliases # expand alias in non-interactive mode
         export PYTHONUNBUFFERED=1
         ifconfig
-        ''' + borrowCell( testName ) + '''
+        ''' //+ borrowCell( testName )
+        + '''
         echo "ONOS Branch is: $ONOSBranch"
         echo "TestON Branch is: $TestONBranch"
         echo "Test date: "
@@ -182,7 +184,7 @@
         slackSend( channel:getSlackChannel(), color:"FF0000", message: "[" + prop[ "ONOSBranch" ] + "]"
                                             + otherTestName + " : Failed!\n" + resultContents[ 1 ] + "\n"
                                             + "[TestON log] : \n"
-                                            + "https://onos-jenkins.onlab.us/blue/organizations/jenkins/${env.JOB_NAME}/detail/${env.JOB_NAME}/${env.BUILD_NUMBER}/pipeline"
+                                            + "https://jenkins.onosproject.org/blue/organizations/jenkins/${env.JOB_NAME}/detail/${env.JOB_NAME}/${env.BUILD_NUMBER}/pipeline"
                                             + ( isSCPF ? "" : ( "\n[Result on Wiki] : \n" + "https://wiki.onosproject.org/display/ONOS/" + wikiLink.replaceAll( "\\s","+" ) ) )
                                             + ( resultURL != "" ? ( "\n[Karaf log] : \n" + resultURL + "artifact/" ) : "" ),
                    teamDomain: 'onosproject' )
diff --git a/TestON/JenkinsFile/JenkinsfileTrigger b/TestON/JenkinsFile/JenkinsfileTrigger
index 6106351..6b205f5 100644
--- a/TestON/JenkinsFile/JenkinsfileTrigger
+++ b/TestON/JenkinsFile/JenkinsfileTrigger
@@ -66,7 +66,8 @@
             "VPLSfailsafe" :                [ "basic":true, "extra_A":false, "extra_B":false, "new_Test":false, "day":"" ]
     ],
     "SR":[
-            "SRBridging":                   [ "basic":true, "extra_A":false, "extra_B":false, "new_Test":false, "day":"" ]
+            "SRBridging":                   [ "basic":true, "extra_A":false, "extra_B":false, "new_Test":false, "day":"" ],
+            "SRRouting":                   [ "basic":true, "extra_A":false, "extra_B":false, "new_Test":false, "day":"" ]
     ]
 ]
 testcases = [
@@ -92,8 +93,8 @@
 onos_tag = params.ONOSTag
 isOldFlow = true
 // Set tests based on day of week
-def now = new Date()
-echo( now.toString() )
+def now = funcs.getCurrentTime()
+print now.toString()
 today = now[ Calendar.DAY_OF_WEEK ]
 day = ""
 SCPF_choices = ""
@@ -367,7 +368,7 @@
             trigger( "1.11", "SRBridging", nodeName, jobOn, manuallyRun, onosTag )
             trigger( "1.12", "SRBridging", nodeName, jobOn, manuallyRun, onosTag )
             trigger( "master", "SRBridging", nodeName, jobOn, manuallyRun, onosTag )
-            returnCell( nodeName )
+            // returnCell( nodeName )
             }else{
             trigger( branch, tests, nodeName, jobOn, manuallyRun, onosTag )
         }
@@ -398,7 +399,8 @@
         set +e
         . ~/.bashrc
         env
-        ''' + borrow_mn( jobOn ) + '''
+        ''' //+ borrow_mn( jobOn )
+        + '''
         ''' + preSetup( onos_branch, test_branch, onos_tag, manuallyRun ) + '''
         ''' + oldFlowCheck( jobOn, onos_branch ) + '''
         ''' + postSetup( onos_branch, test_branch, onos_tag, manuallyRun )
diff --git a/TestON/JenkinsFile/SRJenkinsFile b/TestON/JenkinsFile/SRJenkinsFile
new file mode 100644
index 0000000..b3e2c0f
--- /dev/null
+++ b/TestON/JenkinsFile/SRJenkinsFile
@@ -0,0 +1,31 @@
+#!groovy
+funcs = evaluate readTrusted( 'JenkinsCommonFuncs.groovy' )
+funcs.initialize( "SR" );
+// This is a Jenkinsfile for a scripted pipeline for the SR tests
+def prop = null
+prop = funcs.getProperties()
+SR = [
+"SRBridging" :  [ wiki_link:prop[ "WikiPrefix" ] + "-" + "SR Bridging", wiki_file:"SRBridgingWiki.txt" ],
+"SRRouting" :  [ wiki_link:prop[ "WikiPrefix" ] + "-" + "SR Routing", wiki_file:"SRRoutingWiki.txt" ]
+]
+graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R"
+graph_saved_directory = "/var/jenkins/workspace/postjob-VM/"
+echo( "Testcases:" )
+def testsToRun = null
+testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
+funcs.printTestToRun( testsToRun )
+
+def tests = [:]
+for( String test : SR.keySet() ){
+    toBeRun = testsToRun.contains( test )
+    def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
+    tests[stepName] = funcs.runTest( test, toBeRun, prop, test, false, SR, graph_generator_file, graph_saved_directory )
+}
+
+start = funcs.getCurrentTime()
+// run the tests
+for ( test in tests.keySet() ){
+    tests[ test ].call()
+}
+//funcs.generateOverallGraph( prop, SR, graph_saved_directory )
+funcs.sendResultToSlack( start,  prop[ "manualRun" ], prop[ "WikiPrefix" ] )
\ No newline at end of file
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params
index e7bb813..29b381d 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params
@@ -12,9 +12,11 @@
     </SCALE>
 
     <DEPENDENCY>
+        <useCommonConf>False</useCommonConf>
+        <useCommonTopo>True</useCommonTopo>
         <topology>trellis_fabric.py</topology>
         <lib>routinglib.py,trellislib.py</lib>
-        <testConf>dhcpd.conf,dhcpd6.conf,bgpdr1.conf,bgpdr2.conf,bgpdbgp1.conf,zebradbgp1.conf,bgpdbgp2.conf,zebradbgp2.conf</testConf>
+        <conf>dhcpd.conf,dhcpd6.conf,bgpdr1.conf,bgpdr2.conf,bgpdbgp1.conf,zebradbgp1.conf,bgpdbgp2.conf,zebradbgp2.conf</conf>
     </DEPENDENCY>
 
     <ENV>
diff --git a/TestON/tests/dependencies/ONOSSetup.py b/TestON/tests/dependencies/ONOSSetup.py
index bcecf45..ca10d3a 100644
--- a/TestON/tests/dependencies/ONOSSetup.py
+++ b/TestON/tests/dependencies/ONOSSetup.py
@@ -147,7 +147,7 @@
 
         return '<ac:structured-macro ac:name="html">\n' + \
                 '<ac:plain-text-body><![CDATA[\n' + \
-                '<img src="https://onos-jenkins.onlab.us/job/Pipeline_postjob_' + \
+                '<img src="https://jenkins.onosproject.org/view/QA/job/postjob-' + \
                 nodeCluster + \
                 '/lastSuccessfulBuild/artifact/' + \
                 testname + \