Fix SRRouting test cases with static routes

Change-Id: I7011c3c589e71010532d3d11cf37265647d2e94b
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
index ff85620..05fc856 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
@@ -48,6 +48,8 @@
         <internalIpv6Hosts>h1v6,h2v6,h3v6,h4v6,h5v6,h6v6,h7v6,h8v6,h9v6,h10v6,h11v6,h12v6,h13v6</internalIpv6Hosts>
         <externalIpv4Hosts>rh1v4,rh2v4</externalIpv4Hosts>
         <externalIpv6Hosts>rh1v6,rh11v6,rh2v6,rh22v6</externalIpv6Hosts>
+        <staticIpv4Hosts>rh5v4</staticIpv4Hosts>
+        <staticIpv6Hosts>rh5v6</staticIpv6Hosts>
         <switchNum>10</switchNum>
         <linkNum>48</linkNum>
     </TOPO>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py
index b9e2b8e..1f09dfe 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py
@@ -79,7 +79,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Ping between from ipv4 hosts to external host configured with route-add command" )
-        setupTest( main, test_idx=7, onosNodes=3, ipv6=False, external=False )
+        setupTest( main, test_idx=7, onosNodes=3, ipv6=False, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, ipv6=False, internal=False, disconnected=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
 
@@ -92,7 +94,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Ping between from ipv6 hosts to external host configured with route-add command" )
-        setupTest( main, test_idx=8, onosNodes=3, ipv4=False, external=False )
+        setupTest( main, test_idx=8, onosNodes=3, ipv4=False, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, ipv4=False, internal=False, disconnected=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
 
@@ -105,7 +109,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Ping between from ipv4 and ipv6 hosts to external host configured with route-add command" )
-        setupTest( main, test_idx=9, onosNodes=3, external=False )
+        setupTest( main, test_idx=9, onosNodes=3, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, internal=False, disconnected=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
 
@@ -196,7 +202,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Test link failures with IPv4 hosts including external hosts configured with route-add command" )
-        setupTest( main, test_idx=107, onosNodes=3, ipv6=False, external=False )
+        setupTest( main, test_idx=107, onosNodes=3, ipv6=False, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, ipv6=False, disconnected=False )
         verifyLinkFailure( main, ipv6=False, internal=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
@@ -210,7 +218,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Test link failures with IPv6 hosts including external hosts configured with route-add command" )
-        setupTest( main, test_idx=108, onosNodes=3, ipv4=False, external=False )
+        setupTest( main, test_idx=108, onosNodes=3, ipv4=False, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, ipv4=False, disconnected=False )
         verifyLinkFailure( main, ipv4=False, internal=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
@@ -224,7 +234,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Test link failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" )
-        setupTest( main, test_idx=109, onosNodes=3, external=False )
+        setupTest( main, test_idx=109, onosNodes=3, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, disconnected=False )
         verifyLinkFailure( main, internal=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
@@ -316,7 +328,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Test switch failures with IPv4 hosts including external hosts configured with route-add command" )
-        setupTest( main, test_idx=207, onosNodes=3, ipv6=False, external=False )
+        setupTest( main, test_idx=207, onosNodes=3, ipv6=False, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, ipv6=False, disconnected=False )
         verifySwitchFailure( main, ipv6=False, internal=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
@@ -330,7 +344,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Test switch failures with IPv6 hosts including external hosts configured with route-add command" )
-        setupTest( main, test_idx=208, onosNodes=3, ipv4=False, external=False )
+        setupTest( main, test_idx=208, onosNodes=3, ipv4=False, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, ipv4=False, disconnected=False )
         verifySwitchFailure( main, ipv4=False, internal=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
@@ -344,7 +360,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Test switch failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" )
-        setupTest( main, test_idx=209, onosNodes=3, external=False )
+        setupTest( main, test_idx=209, onosNodes=3, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, disconnected=False )
         verifySwitchFailure( main, internal=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
@@ -436,7 +454,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Test onos failures with IPv4 hosts including external hosts configured with route-add command" )
-        setupTest( main, test_idx=307, onosNodes=3, ipv6=False, external=False )
+        setupTest( main, test_idx=307, onosNodes=3, ipv6=False, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, ipv6=False, disconnected=False )
         verifyOnosFailure( main, ipv6=False, internal=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
@@ -450,7 +470,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Test onos failures with IPv6 hosts including external hosts configured with route-add command" )
-        setupTest( main, test_idx=308, onosNodes=3, ipv4=False, external=False )
+        setupTest( main, test_idx=308, onosNodes=3, ipv4=False, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, ipv4=False, disconnected=False )
         verifyOnosFailure( main, ipv4=False, internal=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
@@ -464,7 +486,9 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
         main.case( "Test onos failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" )
-        setupTest( main, test_idx=309, onosNodes=3, external=False )
+        setupTest( main, test_idx=309, onosNodes=3, external=False, static=True )
+        main.externalIpv4Hosts = main.staticIpv4Hosts
+        main.externalIpv6Hosts = main.staticIpv6Hosts
         verify( main, disconnected=False )
         verifyOnosFailure( main, internal=False )
         lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
index ed96a23..09b45ba 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
@@ -42,10 +42,14 @@
     main.internalIpv6Hosts = main.params[ 'TOPO' ][ 'internalIpv6Hosts' ].split( ',' )
     main.externalIpv4Hosts = main.params[ 'TOPO' ][ 'externalIpv4Hosts' ].split( ',' )
     main.externalIpv6Hosts = main.params[ 'TOPO' ][ 'externalIpv6Hosts' ].split( ',' )
+    main.staticIpv4Hosts = main.params[ 'TOPO' ][ 'staticIpv4Hosts' ].split( ',' )
+    main.staticIpv6Hosts = main.params[ 'TOPO' ][ 'staticIpv6Hosts' ].split( ',' )
     main.disconnectedIpv4Hosts = []
     main.disconnectedIpv6Hosts = []
-    main.disconnectedExternalIpv4Hosts = [ ]
-    main.disconnectedExternalIpv6Hosts = [ ]
+    main.disconnectedExternalIpv4Hosts = []
+    main.disconnectedExternalIpv6Hosts = []
+    main.disconnectedStaticIpv4Hosts = []
+    main.disconnectedStaticIpv6Hosts = []
     main.resultFileName = 'CASE%03d' % test_idx
     main.Cluster.setRunningNode( onosNodes )