[ONOS-7507] Adjust the timezone to PST and add SRRouting to the nightly test

Change-Id: I150c245112906eadd89e79b390f6bfafac989ee5
diff --git a/TestON/JenkinsFile/JenkinsCommonFuncs.groovy b/TestON/JenkinsFile/JenkinsCommonFuncs.groovy
index 906c05d..e15c8a7 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,7 @@
         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 +183,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..b9f2f2f 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,7 @@
         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