[ONOS-7475] Refactoring SR tests

Change-Id: I10e51fcb8b416167e6a338e9030933162640af89
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params
index 0fbda47..9ca0543 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params
@@ -13,6 +13,8 @@
     </SCALE>
 
     <DEPENDENCY>
+        <useCommonConf>False</useCommonConf>
+        <useCommonTopo>True</useCommonTopo>
         <topology>trellis_fabric.py</topology>
         <lib>routinglib.py,trellislib.py</lib>
     </DEPENDENCY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.py b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.py
index d587f69..3586b0b 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.py
@@ -11,12 +11,20 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 1,
-                                topology = '0x1',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts on vlan-untagged port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=1,
+                            topology='0x1',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts on vlan-untagged port" )
 
     def CASE2( self, main ):
         """
@@ -27,12 +35,20 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 2,
-                                topology = '0x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts on vlan-untagged port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=2,
+                            topology='0x2',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts on vlan-untagged port" )
 
     def CASE3( self, main ):
         """
@@ -43,12 +59,20 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 3,
-                                topology = '2x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts on vlan-untagged port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=3,
+                            topology='2x2',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts on vlan-untagged port" )
 
     def CASE4( self, main ):
         """
@@ -59,12 +83,20 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 4,
-                                topology = '2x4',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts on vlan-untagged port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=4,
+                            topology='2x4',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts on vlan-untagged port" )
 
     def CASE5( self, main ):
         """
@@ -75,12 +107,20 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 5,
-                                topology = '0x1',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts on vlan-untagged port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                                test_idx=5,
+                                topology='0x1',
+                                onosNodes=3,
+                                description="Bridging test between two untagged hosts on vlan-untagged port" )
 
     def CASE6( self, main ):
         """
@@ -91,12 +131,20 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 6,
-                                topology = '0x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts on vlan-untagged port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=6,
+                            topology='0x2',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts on vlan-untagged port" )
 
     def CASE7( self, main ):
         """
@@ -107,12 +155,20 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 7,
-                                topology = '2x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts on vlan-untagged port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=7,
+                            topology='2x2',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts on vlan-untagged port" )
 
     def CASE8( self, main ):
         """
@@ -123,12 +179,20 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 8,
-                                topology = '2x4',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts on vlan-untagged port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=8,
+                            topology='2x4',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts on vlan-untagged port" )
 
     def CASE11( self, main ):
         """
@@ -139,13 +203,21 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 11,
-                                topology = '0x1',
-                                onosNodes = 1,
-                                description = "Bridging test between two tagged hosts",
-                                vlan = [ 10, 10 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=11,
+                            topology='0x1',
+                            onosNodes=1,
+                            description="Bridging test between two tagged hosts",
+                            vlan=[ 10, 10 ] )
 
     def CASE12( self, main ):
         """
@@ -156,13 +228,21 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 12,
-                                topology = '0x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two tagged hosts",
-                                vlan = [ 10, 10 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=12,
+                            topology='0x2',
+                            onosNodes=1,
+                            description="Bridging test between two tagged hosts",
+                            vlan=[ 10, 10 ] )
 
     def CASE13( self, main ):
         """
@@ -173,13 +253,21 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 13,
-                                topology = '2x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two tagged hosts",
-                                vlan = [ 10, 10, 20, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=13,
+                            topology='2x2',
+                            onosNodes=1,
+                            description="Bridging test between two tagged hosts",
+                            vlan=[ 10, 10, 20, 20 ] )
 
     def CASE14( self, main ):
         """
@@ -190,13 +278,21 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 14,
-                                topology = '2x4',
-                                onosNodes = 1,
-                                description = "Bridging test between two tagged hosts",
-                                vlan = [ 10, 10, 20, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=14,
+                            topology='2x4',
+                            onosNodes=1,
+                            description="Bridging test between two tagged hosts",
+                            vlan=[ 10, 10, 20, 20 ] )
 
     def CASE15( self, main ):
         """
@@ -207,13 +303,21 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 15,
-                                topology = '0x1',
-                                onosNodes = 3,
-                                description = "Bridging test between two tagged hosts",
-                                vlan = [ 10, 10 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=15,
+                            topology='0x1',
+                            onosNodes=3,
+                            description="Bridging test between two tagged hosts",
+                            vlan=[ 10, 10 ] )
 
     def CASE16( self, main ):
         """
@@ -224,13 +328,21 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 16,
-                                topology = '0x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two tagged hosts",
-                                vlan = [ 10, 10 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=16,
+                            topology='0x2',
+                            onosNodes=3,
+                            description="Bridging test between two tagged hosts",
+                            vlan=[ 10, 10 ] )
 
     def CASE17( self, main ):
         """
@@ -241,13 +353,21 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 17,
-                                topology = '2x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two tagged hosts",
-                                vlan = [ 10, 10, 20, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=17,
+                            topology='2x2',
+                            onosNodes=3,
+                            description="Bridging test between two tagged hosts",
+                            vlan=[ 10, 10, 20, 20 ] )
 
     def CASE18( self, main ):
         """
@@ -258,13 +378,21 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 18,
-                                topology = '2x4',
-                                onosNodes = 3,
-                                description = "Bridging test between two tagged hosts",
-                                vlan = [ 10, 10, 20, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=18,
+                            topology='2x4',
+                            onosNodes=3,
+                            description="Bridging test between two tagged hosts",
+                            vlan=[ 10, 10, 20, 20 ] )
 
     def CASE21( self, main ):
         """
@@ -275,12 +403,20 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 21,
-                                topology = '0x1',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=21,
+                            topology='0x1',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts on vlan-native port" )
 
     def CASE22( self, main ):
         """
@@ -291,12 +427,20 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 22,
-                                topology = '0x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=22,
+                            topology='0x2',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts on vlan-native port" )
 
     def CASE23( self, main ):
         """
@@ -307,12 +451,20 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 23,
-                                topology = '2x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=23,
+                            topology='2x2',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts on vlan-native port" )
 
     def CASE24( self, main ):
         """
@@ -323,12 +475,20 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 24,
-                                topology = '2x4',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=24,
+                            topology='2x4',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts on vlan-native port" )
 
     def CASE25( self, main ):
         """
@@ -339,12 +499,20 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 25,
-                                topology = '0x1',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=25,
+                            topology='0x1',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts on vlan-native port" )
 
     def CASE26( self, main ):
         """
@@ -355,12 +523,20 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 26,
-                                topology = '0x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=26,
+                            topology='0x2',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts on vlan-native port" )
 
     def CASE27( self, main ):
         """
@@ -371,12 +547,20 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 27,
-                                topology = '2x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=27,
+                            topology='2x2',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts on vlan-native port" )
 
     def CASE28( self, main ):
         """
@@ -387,12 +571,20 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 28,
-                                topology = '2x4',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=28,
+                            topology='2x4',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts on vlan-native port" )
 
     def CASE31( self, main ):
         """
@@ -404,13 +596,21 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 31,
-                                topology = '0x1',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts, "
-                                "one on vlan-untagged port and the other on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=31,
+                            topology='0x1',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts, "
+                            "one on vlan-untagged port and the other on vlan-native port" )
 
     def CASE32( self, main ):
         """
@@ -422,13 +622,21 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 32,
-                                topology = '0x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts, "
-                                "one on vlan-untagged port and the other on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=32,
+                            topology='0x2',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts, "
+                            "one on vlan-untagged port and the other on vlan-native port" )
 
     def CASE33( self, main ):
         """
@@ -440,13 +648,21 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 33,
-                                topology = '2x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts, "
-                                "one on vlan-untagged port and the other on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=33,
+                            topology='2x2',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts, "
+                            "one on vlan-untagged port and the other on vlan-native port" )
 
     def CASE34( self, main ):
         """
@@ -458,13 +674,21 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 34,
-                                topology = '2x4',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts, "
-                                "one on vlan-untagged port and the other on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=34,
+                            topology='2x4',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts, "
+                            "one on vlan-untagged port and the other on vlan-native port" )
 
     def CASE35( self, main ):
         """
@@ -476,13 +700,21 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 35,
-                                topology = '0x1',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts, "
-                                "one on vlan-untagged port and the other on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=35,
+                            topology='0x1',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts, "
+                            "one on vlan-untagged port and the other on vlan-native port" )
 
     def CASE36( self, main ):
         """
@@ -494,13 +726,21 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 36,
-                                topology = '0x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts, "
-                                "one on vlan-untagged port and the other on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=36,
+                            topology='0x2',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts, "
+                            "one on vlan-untagged port and the other on vlan-native port" )
 
     def CASE37( self, main ):
         """
@@ -512,13 +752,21 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 37,
-                                topology = '2x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts, "
-                                "one on vlan-untagged port and the other on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=37,
+                            topology='2x2',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts, "
+                            "one on vlan-untagged port and the other on vlan-native port" )
 
     def CASE38( self, main ):
         """
@@ -530,13 +778,21 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest(main,
-                               test_idx = 38,
-                               topology = '2x4',
-                               onosNodes = 3,
-                               description = "Bridging test between two untagged hosts, "
-                                           "one on vlan-untagged port and the other on vlan-native port" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest(main,
+                           test_idx=38,
+                           topology='2x4',
+                           onosNodes=3,
+                           description="Bridging test between two untagged hosts, "
+                                       "one on vlan-untagged port and the other on vlan-native port" )
 
     def CASE41( self, main ):
         """
@@ -548,13 +804,21 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 41,
-                                topology = '0x1',
-                                onosNodes = 1,
-                                description = "Bridging test between untagged host and tagged host",
-                                vlan = [ 0, 10 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=41,
+                            topology='0x1',
+                            onosNodes=1,
+                            description="Bridging test between untagged host and tagged host",
+                            vlan=[ 0, 10 ] )
 
     def CASE42( self, main ):
         """
@@ -566,13 +830,21 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 42,
-                                topology = '0x2',
-                                onosNodes = 1,
-                                description = "Bridging test between untagged host and tagged host",
-                                vlan = [ 0, 10 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=42,
+                            topology='0x2',
+                            onosNodes=1,
+                            description="Bridging test between untagged host and tagged host",
+                            vlan=[ 0, 10 ] )
 
     def CASE43( self, main ):
         """
@@ -584,13 +856,21 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 43,
-                                topology = '2x2',
-                                onosNodes = 1,
-                                description = "Bridging test between untagged host and tagged host",
-                                vlan = [ 0, 10, 0, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=43,
+                            topology='2x2',
+                            onosNodes=1,
+                            description="Bridging test between untagged host and tagged host",
+                            vlan=[ 0, 10, 0, 20 ] )
 
     def CASE44( self, main ):
         """
@@ -602,13 +882,21 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 44,
-                                topology = '2x4',
-                                onosNodes = 1,
-                                description = "Bridging test between untagged host and tagged host",
-                                vlan = [ 0, 10, 0, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=44,
+                            topology='2x4',
+                            onosNodes=1,
+                            description="Bridging test between untagged host and tagged host",
+                            vlan=[ 0, 10, 0, 20 ] )
 
     def CASE45( self, main ):
         """
@@ -620,13 +908,21 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 45,
-                                topology = '0x1',
-                                onosNodes = 3,
-                                description = "Bridging test between untagged host and tagged host",
-                                vlan = [ 0, 10 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=45,
+                            topology='0x1',
+                            onosNodes=3,
+                            description="Bridging test between untagged host and tagged host",
+                            vlan=[ 0, 10 ] )
 
     def CASE46( self, main ):
         """
@@ -638,13 +934,21 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 46,
-                                topology = '0x2',
-                                onosNodes = 3,
-                                description = "Bridging test between untagged host and tagged host",
-                                vlan = [ 0, 10 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=46,
+                            topology='0x2',
+                            onosNodes=3,
+                            description="Bridging test between untagged host and tagged host",
+                            vlan=[ 0, 10 ] )
 
     def CASE47( self, main ):
         """
@@ -656,13 +960,21 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 47,
-                                topology = '2x2',
-                                onosNodes = 3,
-                                description = "Bridging test between untagged host and tagged host",
-                                vlan = [ 0, 10, 0, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=47,
+                            topology='2x2',
+                            onosNodes=3,
+                            description="Bridging test between untagged host and tagged host",
+                            vlan=[ 0, 10, 0, 20 ] )
 
     def CASE48( self, main ):
         """
@@ -674,13 +986,21 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 48,
-                                topology = '2x4',
-                                onosNodes = 3,
-                                description = "Bridging test between untagged host and tagged host",
-                                vlan = [ 0, 10, 0, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=48,
+                            topology='2x4',
+                            onosNodes=3,
+                            description="Bridging test between untagged host and tagged host",
+                            vlan=[ 0, 10, 0, 20 ] )
 
     def CASE51( self, main ):
         """
@@ -691,12 +1011,20 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 51,
-                                topology = '0x1',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts with different vlan id" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=51,
+                            topology='0x1',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts with different vlan id" )
 
     def CASE52( self, main ):
         """
@@ -707,12 +1035,20 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 52,
-                                topology = '0x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts with different vlan id" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=52,
+                            topology='0x2',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts with different vlan id" )
 
     def CASE53( self, main ):
         """
@@ -723,12 +1059,20 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 53,
-                                topology = '2x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts with different vlan id" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=53,
+                            topology='2x2',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts with different vlan id" )
 
     def CASE54( self, main ):
         """
@@ -739,12 +1083,20 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 54,
-                                topology = '2x4',
-                                onosNodes = 1,
-                                description = "Bridging test between two untagged hosts with different vlan id" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=54,
+                            topology='2x4',
+                            onosNodes=1,
+                            description="Bridging test between two untagged hosts with different vlan id" )
 
     def CASE55( self, main ):
         """
@@ -755,12 +1107,20 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 55,
-                                topology = '0x1',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts with different vlan id" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=55,
+                            topology='0x1',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts with different vlan id" )
 
     def CASE56( self, main ):
         """
@@ -771,12 +1131,20 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 56,
-                                topology = '0x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts with different vlan id" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=56,
+                            topology='0x2',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts with different vlan id" )
 
     def CASE57( self, main ):
         """
@@ -787,12 +1155,20 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 57,
-                                topology = '2x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts with different vlan id" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=57,
+                            topology='2x2',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts with different vlan id" )
 
     def CASE58( self, main ):
         """
@@ -803,12 +1179,20 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 58,
-                                topology = '2x4',
-                                onosNodes = 3,
-                                description = "Bridging test between two untagged hosts with different vlan id" )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=58,
+                            topology='2x4',
+                            onosNodes=3,
+                            description="Bridging test between two untagged hosts with different vlan id" )
 
     def CASE61( self, main ):
         """
@@ -819,13 +1203,21 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 61,
-                                topology = '0x1',
-                                onosNodes = 1,
-                                description = "Bridging test between two tagged hosts with different vlan id",
-                                vlan = [ 10, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=61,
+                            topology='0x1',
+                            onosNodes=1,
+                            description="Bridging test between two tagged hosts with different vlan id",
+                            vlan=[ 10, 20 ] )
 
     def CASE62( self, main ):
         """
@@ -836,13 +1228,21 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 62,
-                                topology = '0x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two tagged hosts with different vlan id",
-                                vlan = [ 10, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=62,
+                            topology='0x2',
+                            onosNodes=1,
+                            description="Bridging test between two tagged hosts with different vlan id",
+                            vlan=[ 10, 20 ] )
 
     def CASE63( self, main ):
         """
@@ -853,13 +1253,21 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 63,
-                                topology = '2x2',
-                                onosNodes = 1,
-                                description = "Bridging test between two tagged hosts with different vlan id",
-                                vlan = [ 10, 20, 30, 40 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=63,
+                            topology='2x2',
+                            onosNodes=1,
+                            description="Bridging test between two tagged hosts with different vlan id",
+                            vlan=[ 10, 20, 30, 40 ] )
 
     def CASE64( self, main ):
         """
@@ -870,13 +1278,21 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 64,
-                                topology = '2x4',
-                                onosNodes = 1,
-                                description = "Bridging test between two tagged hosts with different vlan id",
-                                vlan = [ 10, 20, 30, 40 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=64,
+                            topology='2x4',
+                            onosNodes=1,
+                            description="Bridging test between two tagged hosts with different vlan id",
+                            vlan=[ 10, 20, 30, 40 ] )
 
     def CASE65( self, main ):
         """
@@ -887,13 +1303,21 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 65,
-                                topology = '0x1',
-                                onosNodes = 3,
-                                description = "Bridging test between two tagged hosts with different vlan id",
-                                vlan = [ 10, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=65,
+                            topology='0x1',
+                            onosNodes=3,
+                            description="Bridging test between two tagged hosts with different vlan id",
+                            vlan=[ 10, 20 ] )
 
     def CASE66( self, main ):
         """
@@ -904,13 +1328,21 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 66,
-                                topology = '0x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two tagged hosts with different vlan id",
-                                vlan = [ 10, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=66,
+                            topology='0x2',
+                            onosNodes=3,
+                            description="Bridging test between two tagged hosts with different vlan id",
+                            vlan=[ 10, 20 ] )
 
     def CASE67( self, main ):
         """
@@ -921,13 +1353,21 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 67,
-                                topology = '2x2',
-                                onosNodes = 3,
-                                description = "Bridging test between two tagged hosts with different vlan id",
-                                vlan = [ 10, 20, 30, 40 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=67,
+                            topology='2x2',
+                            onosNodes=3,
+                            description="Bridging test between two tagged hosts with different vlan id",
+                            vlan=[ 10, 20, 30, 40 ] )
 
     def CASE68( self, main ):
         """
@@ -938,13 +1378,21 @@
         Start 2x4 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 68,
-                                topology = '2x4',
-                                onosNodes = 3,
-                                description = "Bridging test between two tagged hosts with different vlan id",
-                                vlan = [ 10, 20, 30, 40 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=68,
+                            topology='2x4',
+                            onosNodes=3,
+                            description="Bridging test between two tagged hosts with different vlan id",
+                            vlan=[ 10, 20, 30, 40 ] )
 
     def CASE71( self, main ):
         """
@@ -955,13 +1403,21 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 71,
-                                topology = '0x1',
-                                onosNodes = 1,
-                                description = "Bridging test between untagged and tagged hosts with different vlan id",
-                                vlan = [ 0, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=71,
+                            topology='0x1',
+                            onosNodes=1,
+                            description="Bridging test between untagged and tagged hosts with different vlan id",
+                            vlan=[ 0, 20 ] )
 
     def CASE72( self, main ):
         """
@@ -972,13 +1428,21 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 72,
-                                topology = '0x2',
-                                onosNodes = 1,
-                                description = "Bridging test between untagged and tagged hosts with different vlan id",
-                                vlan = [ 0, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=72,
+                            topology='0x2',
+                            onosNodes=1,
+                            description="Bridging test between untagged and tagged hosts with different vlan id",
+                            vlan=[ 0, 20 ] )
 
     def CASE73( self, main ):
         """
@@ -989,13 +1453,21 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 73,
-                                topology = '2x2',
-                                onosNodes = 1,
-                                description = "Bridging test between untagged and tagged hosts with different vlan id",
-                                vlan = [ 0, 20, 0, 40 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=73,
+                            topology='2x2',
+                            onosNodes=1,
+                            description="Bridging test between untagged and tagged hosts with different vlan id",
+                            vlan=[ 0, 20, 0, 40 ] )
 
     def CASE74( self, main ):
         """
@@ -1006,13 +1478,21 @@
         Start 2x2 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 74,
-                                topology = '2x4',
-                                onosNodes = 1,
-                                description = "Bridging test between untagged and tagged hosts with different vlan id",
-                                vlan = [ 0, 20, 0, 40 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=74,
+                            topology='2x4',
+                            onosNodes=1,
+                            description="Bridging test between untagged and tagged hosts with different vlan id",
+                            vlan=[ 0, 20, 0, 40 ] )
 
     def CASE75( self, main ):
         """
@@ -1023,13 +1503,21 @@
         Start 0x1 single ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 75,
-                                topology = '0x1',
-                                onosNodes = 3,
-                                description = "Bridging test between untagged and tagged hosts with different vlan id",
-                                vlan = [ 0, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=75,
+                            topology='0x1',
+                            onosNodes=3,
+                            description="Bridging test between untagged and tagged hosts with different vlan id",
+                            vlan=[ 0, 20 ] )
 
     def CASE76( self, main ):
         """
@@ -1040,13 +1528,21 @@
         Start 0x2 dual-homed ToR topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 76,
-                                topology = '0x2',
-                                onosNodes = 3,
-                                description = "Bridging test between untagged and tagged hosts with different vlan id",
-                                vlan = [ 0, 20 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=76,
+                            topology='0x2',
+                            onosNodes=3,
+                            description="Bridging test between untagged and tagged hosts with different vlan id",
+                            vlan=[ 0, 20 ] )
 
     def CASE77( self, main ):
         """
@@ -1057,13 +1553,21 @@
         Start 2x2 leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 77,
-                                topology = '2x2',
-                                onosNodes = 3,
-                                description = "Bridging test between untagged and tagged hosts with different vlan id",
-                                vlan = [ 0, 20, 0, 40 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=77,
+                            topology='2x2',
+                            onosNodes=3,
+                            description="Bridging test between untagged and tagged hosts with different vlan id",
+                            vlan=[ 0, 20, 0, 40 ] )
 
     def CASE78( self, main ):
         """
@@ -1074,10 +1578,18 @@
         Start 2x2 dual-homed leaf-spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
-        SRBridgingTest.runTest( main,
-                                test_idx = 78,
-                                topology = '2x4',
-                                onosNodes = 3,
-                                description = "Bridging test between untagged and tagged hosts with different vlan id",
-                                vlan = [ 0, 20, 0, 40 ] )
+        try:
+            from tests.USECASE.SegmentRouting.SRBridging.dependencies.SRBridgingTest import SRBridgingTest
+        except ImportError:
+            main.log.error( "SRBridgingTest not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRBridgingTest()
+        main.funcs.runTest( main,
+                            test_idx=78,
+                            topology='2x4',
+                            onosNodes=3,
+                            description="Bridging test between untagged and tagged hosts with different vlan id",
+                            vlan=[ 0, 20, 0, 40 ] )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py
index fa496dd..d1a8ee3 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py
@@ -25,20 +25,18 @@
 
     def __init__( self ):
         self.default = ''
-
-    @staticmethod
-    def runTest( main, test_idx, topology, onosNodes, description, vlan = [] ):
-        topo = dict()
+        self.topo = dict()
         # (number of spine switch, number of leaf switch, dual-homed, description, minFlowCount - leaf)
-        topo[ '0x1' ] = ( 0, 1, False, 'single ToR', 28 )
-        topo[ '0x2' ] = ( 0, 2, True, 'dual-homed ToR', 37 )
-        topo[ '2x2' ] = ( 2, 2, False, '2x2 leaf-spine topology', 37 )
+        self.topo[ '0x1' ] = ( 0, 1, False, 'single ToR', 28 )
+        self.topo[ '0x2' ] = ( 0, 2, True, 'dual-homed ToR', 37 )
+        self.topo[ '2x2' ] = ( 2, 2, False, '2x2 leaf-spine topology', 37 )
         # TODO: Implement 2x3 topology
         # topo[ '2x3' ] = ( 2, 3, True, '2x3 leaf-spine topology with dual ToR and single ToR', 28 )
-        topo[ '2x4' ] = ( 2, 4, True, '2x4 dual-homed leaf-spine topology', 53 )
-        switchNames = {}
-        switchNames[ '2x2' ] = [ "leaf1", "leaf2", "spine101", "spine102" ]
+        self.topo[ '2x4' ] = ( 2, 4, True, '2x4 dual-homed leaf-spine topology', 53 )
+        self.switchNames = {}
+        self.switchNames[ '2x2' ] = [ "leaf1", "leaf2", "spine101", "spine102" ]
 
+    def runTest( self, main, test_idx, topology, onosNodes, description, vlan = [] ):
         skipPackage = False
         init = False
         if not hasattr( main, 'apps' ):
@@ -49,16 +47,17 @@
             skipPackage = True
 
         main.case( '%s, with %s and %d ONOS instance%s' %
-                   ( description, topo[ topology ][ 3 ], onosNodes, 's' if onosNodes > 1 else '' ) )
+                   ( description, self.topo[ topology ][ 3 ], onosNodes, 's' if onosNodes > 1 else '' ) )
 
         main.cfgName = 'CASE%01d%01d' % ( test_idx / 10, ( ( test_idx - 1 ) % 10 ) % 4 + 1 )
-        main.configPath = main.path + "/dependencies/"
         main.Cluster.setRunningNode( onosNodes )
         run.installOnos( main, skipPackage=skipPackage, cliSleep=5 )
+        run.loadJson( main )
+        run.loadChart( main )
         if hasattr( main, 'Mininet1' ):
             # Run the test with Mininet
-            mininet_args = ' --spine=%d --leaf=%d' % ( topo[ topology ][ 0 ], topo[ topology ][ 1 ] )
-            if topo[ topology ][ 2 ]:
+            mininet_args = ' --spine=%d --leaf=%d' % ( self.topo[ topology ][ 0 ], self.topo[ topology ][ 1 ] )
+            if self.topo[ topology ][ 2 ]:
                 mininet_args += ' --dual-homed'
             if len( vlan ) > 0 :
                 mininet_args += ' --vlan=%s' % ( ','.join( ['%d' % vlanId for vlanId in vlan ] ) )
@@ -66,12 +65,12 @@
             run.startMininet( main, 'trellis_fabric.py', args=mininet_args )
         else:
             # Run the test with physical devices
-            run.connectToPhysicalNetwork( main, switchNames[ topology ] )
+            run.connectToPhysicalNetwork( main, self.switchNames[ topology ] )
 
-        run.checkFlows( main, minFlowCount=topo[ topology ][ 4 ] * topo[ topology ][ 1 ], sleep=5 )
-        leaf_dpid = [ "of:%016d" % ( ls + 1 ) for ls in range( topo[ topology ][ 1 ] ) ]
+        run.checkFlows( main, minFlowCount=self.topo[ topology ][ 4 ] * self.topo[ topology ][ 1 ], sleep=5 )
+        leaf_dpid = [ "of:%016d" % ( ls + 1 ) for ls in range( self.topo[ topology ][ 1 ] ) ]
         for dpid in leaf_dpid:
-            run.checkFlowsByDpid( main, dpid, topo[ topology ][ 4 ], sleep=5 )
+            run.checkFlowsByDpid( main, dpid, self.topo[ topology ][ 4 ], sleep=5 )
         run.pingAll( main )
 
         if hasattr( main, 'Mininet1' ):
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE01.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE01.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE01.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE01.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE02.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE02.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE02.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE02.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE03.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE03.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE03.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE03.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE04.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE04.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE04.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE04.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE11.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE11.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE11.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE11.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE12.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE12.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE12.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE12.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE13.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE13.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE13.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE13.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE14.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE14.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE14.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE14.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE21.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE21.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE21.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE21.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE22.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE22.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE22.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE22.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE23.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE23.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE23.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE23.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE24.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE24.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE24.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE24.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE31.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE31.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE31.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE31.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE32.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE32.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE32.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE32.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE33.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE33.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE33.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE33.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE34.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE34.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE34.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE34.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE41.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE41.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE41.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE41.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE42.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE42.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE42.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE42.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE43.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE43.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE43.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE43.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE44.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE44.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE44.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE44.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE51.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE51.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE51.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE51.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE52.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE52.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE52.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE52.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE53.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE53.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE53.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE53.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE54.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE54.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE54.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE54.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE61.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE61.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE61.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE61.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE62.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE62.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE62.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE62.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE63.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE63.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE63.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE63.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE64.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE64.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE64.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE64.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE71.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE71.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE71.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE71.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE72.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE72.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE72.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE72.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE73.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE73.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE73.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE73.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE74.chart b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE74.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/CASE74.chart
rename to TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE74.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdbgp1.conf b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdbgp1.conf
new file mode 100644
index 0000000..8870fb4
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdbgp1.conf
@@ -0,0 +1,81 @@
+log file /var/log/quagga/bgpdbgp1.log
+hostname bgp1
+password quagga
+!
+! Different next hop for IPv4
+!
+ip prefix-list 1 seq 10 permit 10.0.2.0/24
+ip prefix-list 1 seq 20 permit 10.1.2.0/24
+ip prefix-list 1 seq 30 permit 10.0.3.0/24
+ip prefix-list 1 seq 40 permit 10.0.4.0/24
+!
+route-map NEXTHOP41 permit 10
+match ip address prefix-list 1
+set ip next-hop 10.0.1.254
+!
+!
+route-map NEXTHOP47 permit 10
+match ip address prefix-list 1
+set ip next-hop 10.0.7.254
+!
+! Different next hop for IPv6
+!
+ipv6 prefix-list 2 seq 10 permit 2000::200/120
+ipv6 prefix-list 2 seq 20 permit 2000::300/120
+!
+route-map NEXTHOP61 permit 10
+match ipv6 address prefix-list 2
+set ipv6 next-hop global 2000::1ff
+set ipv6 next-hop local 2000::1ff
+!
+!
+route-map NEXTHOP67 permit 10
+match ipv6 address prefix-list 2
+set ipv6 next-hop global 2000::7ff
+set ipv6 next-hop local 2000::7ff
+!
+! Basic router config
+!
+router bgp 65003
+bgp router-id 172.16.0.3
+timers bgp 3 9
+!
+! IPv4
+!
+neighbor 10.0.1.1 remote-as 65001
+neighbor 10.0.1.1 ebgp-multihop
+neighbor 10.0.1.1 timers connect 5
+neighbor 10.0.1.1 advertisement-interval 5
+neighbor 10.0.1.1 route-map NEXTHOP41 out
+!
+neighbor 2000::101 remote-as 65001
+neighbor 2000::101 timers connect 5
+neighbor 2000::101 advertisement-interval 1
+no neighbor 2000::101 activate
+!
+neighbor 10.0.7.1 remote-as 65002
+neighbor 10.0.7.1 ebgp-multihop
+neighbor 10.0.7.1 timers connect 5
+neighbor 10.0.7.1 advertisement-interval 5
+neighbor 10.0.7.1 route-map NEXTHOP47 out
+!
+neighbor 2000::701 remote-as 65002
+neighbor 2000::701 timers connect 5
+neighbor 2000::701 advertisement-interval 1
+no neighbor 2000::701 activate
+!
+network 10.0.2.0/24
+network 10.1.2.0/24
+network 10.0.3.0/24
+network 10.0.4.0/24
+!
+! IPv6
+!
+address-family ipv6
+network 2000::200/120
+network 2000::300/120
+neighbor 2000::101 activate
+neighbor 2000::101 route-map NEXTHOP61 out
+neighbor 2000::701 activate
+neighbor 2000::701 route-map NEXTHOP67 out
+exit-address-family
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdbgp2.conf b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdbgp2.conf
new file mode 100644
index 0000000..e554de4
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdbgp2.conf
@@ -0,0 +1,81 @@
+log file /var/log/quagga/bgpdbgp2.log
+hostname bgp2
+password quagga
+!
+! Different next hop for IPv4
+!
+ip prefix-list 1 seq 10 permit 10.0.2.0/24
+ip prefix-list 1 seq 20 permit 10.1.2.0/24
+ip prefix-list 1 seq 30 permit 10.0.3.0/24
+ip prefix-list 1 seq 40 permit 10.0.4.0/24
+!
+route-map NEXTHOP45 permit 10
+match ip address prefix-list 1
+set ip next-hop 10.0.5.254
+!
+!
+route-map NEXTHOP46 permit 10
+match ip address prefix-list 1
+set ip next-hop 10.0.6.254
+!
+! Different next hop for IPv6
+!
+ipv6 prefix-list 2 seq 10 permit 2000::200/120
+ipv6 prefix-list 2 seq 20 permit 2000::300/120
+!
+route-map NEXTHOP65 permit 10
+match ipv6 address prefix-list 2
+set ipv6 next-hop global 2000::5ff
+set ipv6 next-hop local 2000::5ff
+!
+!
+route-map NEXTHOP66 permit 10
+match ipv6 address prefix-list 2
+set ipv6 next-hop global 2000::6ff
+set ipv6 next-hop local 2000::6ff
+!
+! Basic router config
+!
+router bgp 65003
+bgp router-id 172.16.0.4
+timers bgp 3 9
+!
+! IPv4
+!
+neighbor 10.0.5.1 remote-as 65001
+neighbor 10.0.5.1 ebgp-multihop
+neighbor 10.0.5.1 timers connect 5
+neighbor 10.0.5.1 advertisement-interval 5
+neighbor 10.0.5.1 route-map NEXTHOP45 out
+!
+neighbor 2000::501 remote-as 65001
+neighbor 2000::501 timers connect 5
+neighbor 2000::501 advertisement-interval 1
+no neighbor 2000::501 activate
+!
+neighbor 10.0.6.1 remote-as 65002
+neighbor 10.0.6.1 ebgp-multihop
+neighbor 10.0.6.1 timers connect 5
+neighbor 10.0.6.1 advertisement-interval 5
+neighbor 10.0.6.1 route-map NEXTHOP46 out
+!
+neighbor 2000::601 remote-as 65002
+neighbor 2000::601 timers connect 5
+neighbor 2000::601 advertisement-interval 1
+no neighbor 2000::601 activate
+!
+network 10.0.2.0/24
+network 10.1.2.0/24
+network 10.0.3.0/24
+network 10.0.4.0/24
+!
+! IPv6
+!
+address-family ipv6
+network 2000::200/120
+network 2000::300/120
+neighbor 2000::501 activate
+neighbor 2000::501 route-map NEXTHOP65 out
+neighbor 2000::601 activate
+neighbor 2000::601 route-map NEXTHOP66 out
+exit-address-family
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdr1.conf b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdr1.conf
new file mode 100644
index 0000000..9e526b8
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdr1.conf
@@ -0,0 +1,42 @@
+log file /var/log/quagga/bgpdr1.log
+hostname r1
+password quagga
+!
+! Basic router config
+!
+router bgp 65001
+bgp router-id 10.0.1.1
+timers bgp 3 9
+!
+! IPv4
+!
+neighbor 10.0.1.2 remote-as 65003
+neighbor 10.0.1.2 ebgp-multihop
+neighbor 10.0.1.2 timers connect 5
+neighbor 10.0.1.2 advertisement-interval 5
+!
+neighbor 2000::102 remote-as 65003
+neighbor 2000::102 timers connect 5
+neighbor 2000::102 advertisement-interval 1
+no neighbor 2000::102 activate
+!
+neighbor 10.0.5.2 remote-as 65003
+neighbor 10.0.5.2 ebgp-multihop
+neighbor 10.0.5.2 timers connect 5
+neighbor 10.0.5.2 advertisement-interval 5
+!
+neighbor 2000::502 remote-as 65003
+neighbor 2000::502 timers connect 5
+neighbor 2000::502 advertisement-interval 1
+no neighbor 2000::502 activate
+!
+network 10.0.99.0/24
+!
+! IPv6
+!
+address-family ipv6
+network 2000::7700/120
+network 2000::9900/120
+neighbor 2000::102 activate
+neighbor 2000::502 activate
+exit-address-family
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdr2.conf b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdr2.conf
new file mode 100644
index 0000000..49553e2
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/bgpdr2.conf
@@ -0,0 +1,42 @@
+log file /var/log/quagga/bgpdr2.log
+hostname r2
+password quagga
+!
+! Basic router config
+!
+router bgp 65002
+bgp router-id 10.0.6.1
+timers bgp 3 9
+!
+! IPv4
+!
+neighbor 10.0.6.2 remote-as 65003
+neighbor 10.0.6.2 ebgp-multihop
+neighbor 10.0.6.2 timers connect 5
+neighbor 10.0.6.2 advertisement-interval 5
+!
+neighbor 2000::602 remote-as 65003
+neighbor 2000::602 timers connect 5
+neighbor 2000::602 advertisement-interval 1
+no neighbor 2000::602 activate
+!
+neighbor 10.0.7.2 remote-as 65003
+neighbor 10.0.7.2 ebgp-multihop
+neighbor 10.0.7.2 timers connect 5
+neighbor 10.0.7.2 advertisement-interval 5
+!
+neighbor 2000::702 remote-as 65003
+neighbor 2000::702 timers connect 5
+neighbor 2000::702 advertisement-interval 1
+no neighbor 2000::702 activate
+!
+network 10.0.99.0/24
+!
+! IPv6
+!
+address-family ipv6
+network 2000::8800/120
+network 2000::9900/120
+neighbor 2000::602 activate
+neighbor 2000::702 activate
+exit-address-family
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/dhcpd.conf b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/dhcpd.conf
new file mode 100644
index 0000000..aa559d2
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/dhcpd.conf
@@ -0,0 +1,55 @@
+ddns-update-style none;
+
+default-lease-time 600;
+max-lease-time 7200;
+
+option domain-name-servers 8.8.8.8, 8.8.4.4;
+option domain-name "trellis.local";
+
+subnet 10.0.2.0 netmask 255.255.255.0 {
+  range 10.0.2.100 10.0.2.240;
+  option routers 10.0.2.254;
+}
+
+subnet 10.1.2.0 netmask 255.255.255.0 {
+  range 10.1.2.100 10.1.2.240;
+  option routers 10.1.2.254;
+}
+
+subnet 10.0.3.0 netmask 255.255.255.0 {
+  range 10.0.3.100 10.0.3.240;
+  option routers 10.0.3.254;
+}
+
+subnet 10.0.4.0 netmask 255.255.255.0 {
+  range 10.0.4.100 10.0.4.240;
+  option routers 10.0.4.254;
+}
+
+subnet 10.0.99.3 netmask 255.255.255.255 {
+}
+
+host h1 {
+  hardware ethernet 00:aa:00:00:00:01;
+  fixed-address 10.0.2.1;
+}
+
+host h2 {
+  hardware ethernet 00:aa:00:00:00:02;
+  fixed-address 10.0.2.2;
+}
+
+host h3 {
+  hardware ethernet 00:aa:00:00:00:03;
+  fixed-address 10.0.3.1;
+}
+
+host h4 {
+  hardware ethernet 00:aa:00:00:00:04;
+  fixed-address 10.0.3.2;
+}
+
+host dh1 {
+  hardware ethernet 00:cc:00:00:00:01;
+  fixed-address 10.1.2.1;
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/dhcpd6.conf b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/dhcpd6.conf
new file mode 100644
index 0000000..526de85
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/dhcpd6.conf
@@ -0,0 +1,37 @@
+default-lease-time 600;
+max-lease-time 7200;
+
+option dhcp6.next-hop code 242 = ip6-address;
+
+subnet6 2000::200/120 {
+  range6 2000::260 2000::2fe;
+  option dhcp6.next-hop 2000::02ff;
+}
+
+subnet6 2000::300/120 {
+  range6 2000::360 2000::3fe;
+  option dhcp6.next-hop 2000::03ff;
+}
+
+subnet6 2000::9903/128 {
+}
+
+host h1v6 {
+  hardware ethernet 00:bb:00:00:00:01;
+  fixed-address6 2000::201;
+}
+
+host h2v6 {
+  hardware ethernet 00:bb:00:00:00:02;
+  fixed-address6 2000::202;
+}
+
+host h3v6 {
+  hardware ethernet 00:bb:00:00:00:03;
+  fixed-address6 2000::301;
+}
+
+host h4v6 {
+  hardware ethernet 00:bb:00:00:00:04;
+  fixed-address6 2000::302;
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/zebradbgp1.conf b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/zebradbgp1.conf
new file mode 100644
index 0000000..51991a4
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/zebradbgp1.conf
@@ -0,0 +1,9 @@
+log file /var/log/quagga/zebradbgp1.log
+hostname zebra-bgp1
+password quagga
+!
+! Default route via virtual management switch
+!
+ip route 0.0.0.0/0 172.16.0.1
+!
+fpm connection ip 192.168.56.11 port 2620
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/zebradbgp2.conf b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/zebradbgp2.conf
new file mode 100644
index 0000000..dce218d
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/conf/zebradbgp2.conf
@@ -0,0 +1,9 @@
+log file /var/log/quagga/zebradbgp2.log
+hostname zebra-bgp2
+password quagga
+!
+! Default route via virtual management switch
+!
+ip route 0.0.0.0/0 172.16.0.1
+!
+fpm connection ip 192.168.56.11 port 2620
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/extra.json b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/extra.json
new file mode 100644
index 0000000..e3544bf
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/json/extra.json
@@ -0,0 +1,16 @@
+{
+    "hosts" : {
+        "00:00:00:00:00:09/-1" : {
+            "basic": {
+                "ips": ["10.0.1.9"],
+                "locations": ["of:0000000000000001/3"]
+            }
+        },
+        "00:00:00:00:09:01/-1" : {
+            "basic": {
+                "ips": ["10.0.9.1"],
+                "locations": ["of:0000000000000001/4"]
+            }
+        }
+    }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.params b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.params
index abe305e..05222f0 100755
--- a/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.params
@@ -13,6 +13,8 @@
     </SCALE>
 
     <DEPENDENCY>
+        <useCommonConf>True</useCommonConf>
+        <useCommonTopo>True</useCommonTopo>
         <topology>cord_fabric.py</topology>
     </DEPENDENCY>
 
diff --git a/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.py b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.py
index 0e8844a..035d386 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.py
@@ -36,30 +36,17 @@
         Induce CLUSTER restart
         Pingall
         """
-        description = "Cluster Restart test with 2x2 Leaf-spine "
-        main.case( description )
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        main.cfgName = '2x2'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        run.killOnos( main, [ 0, 1, 2 ], '4', '8', '0' )
-        run.pingAll( main, 'CASE1_Failure', dumpflows=False )
-        run.recoverOnos( main, [ 0, 1, 2 ], '4', '8', '3' )
-        run.checkFlows( main, minFlowCount=116, tag='CASE1_Failure' )
-        run.pingAll( main, 'CASE1_Failure' )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRClusterRestart.dependencies.SRClusterRestartFuncs import SRClusterRestartFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRClusterRestartFuncs()
+        main.funcs.runTest( main, 1, 3,
+                            '2x2', 116, 'Failure' )
 
     def CASE2( self, main ):
         """
@@ -69,30 +56,17 @@
         Induce Cluster Restart
         Pingall
         """
-        description = "Cluster Restart test with 4x4 Leaf-spine "
-        main.case( description )
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        main.cfgName = '4x4'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main )
-        run.killOnos( main, [ 0, 1, 2 ], '8', '32', '0' )
-        run.pingAll( main, 'CASE2_Failure', dumpflows=False )
-        run.recoverOnos( main, [ 0, 1, 2 ], '8', '32', '3' )
-        run.checkFlows( main, minFlowCount=350, tag='CASE2_Failure' )
-        run.pingAll( main, 'CASE3_Recovery' )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRClusterRestart.dependencies.SRClusterRestartFuncs import SRClusterRestartFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRClusterRestartFuncs()
+        main.funcs.runTest( main, 2, 3,
+                            '4x4', 350, 'Failure' )
 
     def CASE3( self, main ):
         """
@@ -102,27 +76,15 @@
         Induce Cluster Restart
         Pingall
         """
-        description = "Cluster Restart test with single switch "
-        main.case( description )
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        main.cfgName = '0x1'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=15 )
-        run.pingAll( main )
-        run.killOnos( main, [ 0, 1, 2 ], '1', '0', '0' )
-        run.pingAll( main, 'CASE3_Failure', dumpflows=False )
-        run.recoverOnos( main, [ 0, 1, 2 ], '1', '0', '3' )
-        run.checkFlows( main, minFlowCount=15, tag='CASE3_Failure' )
-        run.pingAll( main, 'CASE3_Failure' )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRClusterRestart.dependencies.SRClusterRestartFuncs import SRClusterRestartFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRClusterRestartFuncs()
+        main.funcs.runTest( main, 3, 3,
+                            '0x1', 15, 'Failure' )
+
diff --git a/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/dependencies/SRClusterRestartFuncs.py b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/dependencies/SRClusterRestartFuncs.py
new file mode 100644
index 0000000..f36719f
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/dependencies/SRClusterRestartFuncs.py
@@ -0,0 +1,69 @@
+"""
+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/>.
+"""
+
+from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run
+
+class SRClusterRestartFuncs():
+
+    def __init__( self ):
+        self.default = ''
+        self.topo = dict()
+        self.topo[ '0x1' ] = ( 0, 1, '--leaf=1 --spine=0', 'single switch' )
+        self.topo[ '2x2' ] = ( 2, 2, '', '2x2 Leaf-spine' )
+        self.topo[ '4x4' ] = ( 4, 4, '--leaf=4 --spine=4', '4x4 Leaf-spine' )
+
+    def runTest( self, main, caseNum, numNodes, Topo, minFlow, testing, killList=[ 0, 1, 2 ] ):
+        description = "Cluster Restart test with " + self.topo[ Topo ][ 3 ]
+        caseTitle = 'CASE{}_'.format( caseNum ) + testing
+        main.case( description )
+        if not hasattr( main, 'apps' ):
+            run.initTest( main )
+        main.cfgName = Topo
+        main.Cluster.setRunningNode( numNodes )
+        run.installOnos( main )
+        run.loadJson( main )
+        run.loadChart( main )
+        if hasattr( main, 'Mininet1' ):
+            run.startMininet( main, 'cord_fabric.py', args=self.topo[ Topo ][ 2 ] )
+        else:
+            # Run the test with physical devices
+            # TODO: connect TestON to the physical network
+            pass
+        # pre-configured routing and bridging test
+        run.checkFlows( main, minFlowCount=minFlow )
+        run.pingAll( main )
+        switch = '{}'.format( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] )
+        link = '{}'.format( ( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] ) * self.topo[ Topo ][ 0 ] )
+        run.killOnos( main, killList, switch, link, '0' )
+        run.pingAll( main, caseTitle, dumpflows=False )
+        run.recoverOnos( main, killList, switch, link, '{}'.format( numNodes ) )
+        run.checkFlows( main, minFlowCount=minFlow, tag=caseTitle )
+        run.pingAll( main, caseTitle )
+        # TODO Dynamic config of hosts in subnet
+        # TODO Dynamic config of host not in subnet
+        # TODO Dynamic config of vlan xconnect
+        # TODO Vrouter integration
+        # TODO Mcast integration
+        if hasattr( main, 'Mininet1' ):
+            run.cleanup( main )
+        else:
+            # TODO: disconnect TestON from the physical network
+            pass
diff --git a/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/dependencies/__init__.py b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/dependencies/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/dependencies/__init__.py
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/SRDhcprelayTest.py b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/SRDhcprelayTest.py
index 1ac4f7a..1bbb0f9 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/SRDhcprelayTest.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/SRDhcprelayTest.py
@@ -41,13 +41,11 @@
                    ( description, onosNodes, 's' if onosNodes > 1 else '' ) )
 
         main.cfgName = 'CASE%02d' % testIndex
-        main.configPath = main.path + "/dependencies/"
         main.resultFileName = 'CASE%02d' % testIndex
         main.Cluster.setRunningNode( onosNodes )
         run.installOnos( main, skipPackage=skipPackage, cliSleep=5 )
-        import json
-        with open( "%s/json/%s.host" % ( main.configPath, main.cfgName ) ) as host:
-            main.expectedHosts = json.load( host )
+        run.loadJson( main )
+        run.loadHost( main )
         if hasattr( main, 'Mininet1' ):
             # Run the test with Mininet
             if dualHomed:
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE01.host b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE01.host
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE01.host
rename to TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE01.host
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE02.host b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE02.host
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE02.host
rename to TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE02.host
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE11.host b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE11.host
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE11.host
rename to TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE11.host
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE12.host b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE12.host
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE12.host
rename to TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE12.host
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE21.host b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE21.host
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE21.host
rename to TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE21.host
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE22.host b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE22.host
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE22.host
rename to TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE22.host
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE31.host b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE31.host
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE31.host
rename to TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE31.host
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE41.host b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE41.host
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE41.host
rename to TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE41.host
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE51.host b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE51.host
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE51.host
rename to TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE51.host
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE61.host b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE61.host
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE61.host
rename to TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE61.host
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE71.host b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE71.host
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/CASE71.host
rename to TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/host/CASE71.host
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/extra.json b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/extra.json
new file mode 100644
index 0000000..e3544bf
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/dependencies/json/extra.json
@@ -0,0 +1,16 @@
+{
+    "hosts" : {
+        "00:00:00:00:00:09/-1" : {
+            "basic": {
+                "ips": ["10.0.1.9"],
+                "locations": ["of:0000000000000001/3"]
+            }
+        },
+        "00:00:00:00:09:01/-1" : {
+            "basic": {
+                "ips": ["10.0.9.1"],
+                "locations": ["of:0000000000000001/4"]
+            }
+        }
+    }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.params b/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.params
index fceb91a..d32d1a6 100755
--- a/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.params
@@ -13,6 +13,8 @@
     </SCALE>
 
     <DEPENDENCY>
+        <useCommonConf>True</useCommonConf>
+        <useCommonTopo>True</useCommonTopo>
         <topology>cord_fabric.py</topology>
     </DEPENDENCY>
 
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.py b/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.py
index 6a228f3..d0cc985 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.py
@@ -37,25 +37,17 @@
         Start 2x2 Leaf-Spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRDynamic.dependencies.SRDynamicFuncs import SRDynamicFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRDynamicFuncs()
 
-        description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
-        main.case( description )
-
-        main.cfgName = '2x2'
-        main.Cluster.setRunningNode( 1 )
-        run.installOnos( main, vlanCfg=False )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main, dumpflows=False, )
-        run.addHostCfg( main )
-        run.checkFlows( main, minFlowCount=140, dumpflows=False )
-        run.pingAll( main )
-        run.cleanup( main )
+        main.funcs.runTest( main, 1, 1, '2x2', 116, 140, False )
 
     def CASE2( self, main ):
         """
@@ -63,24 +55,17 @@
         Start 4x4 Leaf-Spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
-        main.case( description )
-        main.cfgName = '4x4'
-        main.Cluster.setRunningNode( 1 )
-        run.installOnos( main, vlanCfg=False )
-        run.startMininet( main, 'cord_fabric.py',
-                          args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main, dumpflows=False )
-        run.addHostCfg( main )
-        run.checkFlows( main, minFlowCount=380, dumpflows=False )
-        run.pingAll( main )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRDynamic.dependencies.SRDynamicFuncs import SRDynamicFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRDynamicFuncs()
+
+        main.funcs.runTest( main, 2, 1, '4x4', 350, 380, False )
 
     def CASE3( self, main ):
         """
@@ -88,24 +73,17 @@
         Start single switch topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with single switch "
-        main.case( description )
-        main.cfgName = '0x1'
-        main.Cluster.setRunningNode( 1 )
-        run.installOnos( main, vlanCfg=False )
-        run.startMininet( main, 'cord_fabric.py',
-                          args="--leaf=1 --spine=0" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=15 )
-        run.pingAll( main, dumpflows=False )
-        run.addHostCfg( main )
-        run.checkFlows( main, minFlowCount=18, dumpflows=False )
-        run.pingAll( main )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRDynamic.dependencies.SRDynamicFuncs import SRDynamicFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRDynamicFuncs()
+
+        main.funcs.runTest( main, 3, 1, '0x1', 15, 18, False )
 
     def CASE4( self, main ):
         """
@@ -113,28 +91,17 @@
         Start 2x2 Leaf-Spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
-        main.case( description )
+        try:
+            from tests.USECASE.SegmentRouting.SRDynamic.dependencies.SRDynamicFuncs import SRDynamicFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRDynamicFuncs()
 
-        main.cfgName = '2x2'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main, vlanCfg=False )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main, dumpflows=False )
-        run.addHostCfg( main )
-        run.checkFlows( main, minFlowCount=140, dumpflows=False )
-        run.pingAll( main )
-        run.killOnos( main, [ 0 ], '4', '8', '2' )
-        run.delHostCfg( main )
-        run.checkFlows( main, minFlowCount=116, dumpflows=False )
-        run.pingAll( main, "CASE4_after" )
-        run.cleanup( main )
+        main.funcs.runTest( main, 4, 3, '2x2', 116, 140, True )
 
     def CASE5( self, main ):
         """
@@ -142,28 +109,17 @@
         Start 4x4 Leaf-Spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
-        main.case( description )
-        main.cfgName = '4x4'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main, vlanCfg=False )
-        run.startMininet( main, 'cord_fabric.py',
-                          args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main, dumpflows=False )
-        run.addHostCfg( main )
-        run.checkFlows( main, minFlowCount=380, dumpflows=False )
-        run.pingAll( main )
-        run.killOnos( main, [ 0 ], '8', '32', '2' )
-        run.delHostCfg( main )
-        run.checkFlows( main, minFlowCount=350, dumpflows=False )
-        run.pingAll( main, "CASE5_After" )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRDynamic.dependencies.SRDynamicFuncs import SRDynamicFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRDynamicFuncs()
+
+        main.funcs.runTest( main, 5, 3, '4x4', 350, 380, True )
 
     def CASE6( self, main ):
         """
@@ -171,25 +127,14 @@
         Start single switch topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with single switch "
-        main.case( description )
-        main.cfgName = '0x1'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main, vlanCfg=False )
-        run.startMininet( main, 'cord_fabric.py',
-                          args="--leaf=1 --spine=0" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=15 )
-        run.pingAll( main, dumpflows=False )
-        run.addHostCfg( main )
-        run.checkFlows( main, minFlowCount=20, dumpflows=False )
-        run.pingAll( main )
-        run.killOnos( main, [ 0 ], '1', '0', '2' )
-        run.delHostCfg( main )
-        run.checkFlows( main, minFlowCount=15, dumpflows=False )
-        run.pingAll( main, "CASE6_After" )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRDynamic.dependencies.SRDynamicFuncs import SRDynamicFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRDynamicFuncs()
+
+        main.funcs.runTest( main, 6, 3, '0x1', 15, 20, True )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDynamic/dependencies/SRDynamicFuncs.py b/TestON/tests/USECASE/SegmentRouting/SRDynamic/dependencies/SRDynamicFuncs.py
new file mode 100644
index 0000000..e4390de
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRDynamic/dependencies/SRDynamicFuncs.py
@@ -0,0 +1,78 @@
+"""
+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/>.
+"""
+
+from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run
+import random
+from random import randint
+from datetime import datetime
+
+class SRDynamicFuncs():
+
+    def __init__( self ):
+        self.default = ''
+        self.topo = dict()
+        self.topo[ '0x1' ] = ( 0, 1, '--leaf=1 --spine=0', 'single switch' )
+        self.topo[ '2x2' ] = ( 2, 2, '', '2x2 Leaf-spine' )
+        self.topo[ '4x4' ] = ( 4, 4, '--leaf=4 --spine=4', '4x4 Leaf-spine' )
+
+    def runTest( self, main, caseNum, numNodes, Topo, minBeforeFlow, minAfterFlow, killOnosAndDeleteCfg ):
+        if not hasattr( main, 'apps' ):
+            run.initTest( main )
+
+        description = "Bridging and Routing sanity test with " + \
+                      self.topo[ Topo ][ 3 ] + \
+                      "and {} nodes.".format( numNodes ) + \
+                      ( "\nAlso, killing the first Onos and removing the host cfg." if killOnosAndDeleteCfg else "" )
+        main.case( description )
+
+        main.cfgName = Topo
+        main.Cluster.setRunningNode( numNodes )
+        run.installOnos( main )
+        run.loadJson( main )
+        run.loadChart( main )
+        run.startMininet( main, 'cord_fabric.py',
+                          args=self.topo[ Topo ][ 2 ] )
+        # pre-configured routing and bridging test
+        run.checkFlows( main, minFlowCount=minBeforeFlow )
+        run.pingAll( main, dumpflows=False )
+        run.addHostCfg( main )
+        run.checkFlows( main, minFlowCount=minAfterFlow, dumpflows=False )
+        run.pingAll( main )
+        if killOnosAndDeleteCfg:
+            switch = self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ]
+            link = ( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] ) * self.topo[ Topo ][ 0 ]
+            self.killAndDelete( main, caseNum, numNodes, minBeforeFlow, switch, link )
+        # TODO Dynamic config of hosts in subnet
+        # TODO Dynamic config of host not in subnet
+        # TODO Dynamic config of vlan xconnect
+        # TODO Vrouter integration
+        # TODO Mcast integration
+        if hasattr( main, 'Mininet1' ):
+            run.cleanup( main )
+        else:
+            # TODO: disconnect TestON from the physical network
+            pass
+
+    def killAndDelete( self, main, caseNum, numNodes, minBeforeFlow, switch, link ):
+        run.killOnos( main, [ 0 ], '{}'.format( switch ), '{}'.format( link ), '{}'.format( numNodes - 1 ) )
+        run.delHostCfg( main )
+        run.checkFlows( main, minFlowCount=minBeforeFlow, dumpflows=False )
+        run.pingAll( main, "CASE{}_After".format( caseNum ) )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDynamic/dependencies/__init__.py b/TestON/tests/USECASE/SegmentRouting/SRDynamic/dependencies/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRDynamic/dependencies/__init__.py
diff --git a/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.params b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.params
index dfee950..517e8f0 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.params
@@ -13,6 +13,8 @@
     </SCALE>
 
     <DEPENDENCY>
+        <useCommonConf>True</useCommonConf>
+        <useCommonTopo>True</useCommonTopo>
         <topology>cord_fabric.py</topology>
     </DEPENDENCY>
 
diff --git a/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.py b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.py
index 91757f0..1970033 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.py
@@ -43,27 +43,17 @@
         5 ) Pingall
         6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-
-        description = "High Availability tests - ONOS failures with 2x2 Leaf-spine "
-        main.case( description )
-        run.config( main, '2x2' )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        for i in range( 0, main.failures ):
-            toKill = i % main.Cluster.numCtrls
-            run.killOnos( main, [ toKill ], '4', '8', '2' )
-            run.pingAll( main, 'CASE1_Failure%d' % ( i + 1 ) )
-            run.recoverOnos( main, [ toKill ], '4', '8', '3' )
-            run.checkFlows( main, minFlowCount=116, tag='CASE1_Recovery%d' % ( i + 1 ) )
-            run.pingAll( main, 'CASE1_Recovery%d' % ( i + 1 ) )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
+        except ImportError:
+            main.log.error( "SRHAFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRHAFuncs()
+        main.funcs.runTest( main, 1, 3, '2x2',
+                            116, False, False )
 
     def CASE2( self, main ):
         """
@@ -74,31 +64,17 @@
         5 ) Pingall
         6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        import random
-        from random import randint
-        from datetime import datetime
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-
-        description = "High Availability tests - ONOS random failures with 2x2 Leaf-spine "
-        main.case( description )
-        run.config( main, '2x2' )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        random.seed( datetime.now() )
-        for i in range( 0, main.failures ):
-            toKill = randint( 0, ( main.Cluster.numCtrls - 1 ) )
-            run.killOnos( main, [ toKill ], '4', '8', '2' )
-            run.pingAll( main, 'CASE2_Failure%d' % ( i + 1 ) )
-            run.recoverOnos( main, [ toKill ], '4', '8', '3' )
-            run.checkFlows( main, minFlowCount=116, tag='CASE2_Recovery%d' % ( i + 1 ) )
-            run.pingAll( main, 'CASE2_Recovery%d' % ( i + 1 ) )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
+        except ImportError:
+            main.log.error( "SRHAFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRHAFuncs()
+        main.funcs.runTest( main, 2, 3, '2x2',
+                            116, True, False )
 
     def CASE3( self, main ):
         """
@@ -109,27 +85,17 @@
         5 ) Pingall
         6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-
-        description = "High Availability tests - ONOS failures with 4x4 Leaf-spine "
-        main.case( description )
-        run.config( main, '4x4' )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main )
-        for i in range( 0, main.failures ):
-            toKill = i % main.Cluster.numCtrls
-            run.killOnos( main, [ toKill ], '8', '32', '2' )
-            run.pingAll( main, 'CASE3_Failure%d' % ( i + 1 ) )
-            run.recoverOnos( main, [ toKill ], '8', '32', '3' )
-            run.checkFlows( main, minFlowCount=350, tag='CASE3_Recovery%d' % ( i + 1 ) )
-            run.pingAll( main, 'CASE3_Recovery%d' % ( i + 1 ) )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
+        except ImportError:
+            main.log.error( "SRHAFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRHAFuncs()
+        main.funcs.runTest( main, 3, 3, '4x4',
+                            350, False, False )
 
     def CASE4( self, main ):
         """
@@ -140,31 +106,17 @@
         5 ) Pingall
         6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        import random
-        from random import randint
-        from datetime import datetime
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-
-        description = "High Availability tests - ONOS random failures with 4x4 Leaf-spine "
-        main.case( description )
-        run.config( main, '4x4' )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main )
-        random.seed( datetime.now() )
-        for i in range( 0, main.failures ):
-            toKill = randint( 0, ( main.Cluster.numCtrls - 1 ) )
-            run.killOnos( main, [ toKill ], '8', '32', '2' )
-            run.pingAll( main, 'CASE4_Failure%d' % ( i + 1 ) )
-            run.recoverOnos( main, [ toKill ], '8', '32', '3' )
-            run.checkFlows( main, minFlowCount=350, tag='CASE4_Recovery%d' % ( i + 1 ) )
-            run.pingAll( main, 'CASE4_Recovery%d' % ( i + 1 ) )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
+        except ImportError:
+            main.log.error( "SRHAFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRHAFuncs()
+        main.funcs.runTest( main, 4, 3, '4x4',
+                            350, True, False )
 
     def CASE5( self, main ):
         """
@@ -177,35 +129,17 @@
         7 ) Pingall
         8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        import time
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-
-        description = "High Availability tests - ONOS failures and Switch failures with 2x2 Leaf-spine "
-        main.case( description )
-        run.config( main, '2x2' )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        for i in range( 0, main.failures ):
-            onosToKill = i % main.Cluster.numCtrls
-            switchToKill = i % len( main.spines )
-            run.killOnos( main, [ onosToKill ], '4', '8', '2' )
-            run.pingAll( main, 'CASE5_ONOS_Failure%d' % ( i + 1 ) )
-            run.killSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='3', links='4' )
-            time.sleep( main.switchSleep )
-            run.pingAll( main, "CASE5_SWITCH_Failure%d" % ( i + 1 ) )
-            run.recoverSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='4', links='8' )
-            run.checkFlows( main, minFlowCount=116, tag="CASE5_SWITCH_Recovery%d" % ( i + 1 ) )
-            run.pingAll( main, "CASE5_SWITCH_Recovery%d" % ( i + 1 ) )
-            run.recoverOnos( main, [ onosToKill ], '4', '8', '3' )
-            run.checkFlows( main, minFlowCount=116, tag='CASE5_ONOS_Recovery%d' % ( i + 1 ) )
-            run.pingAll( main, 'CASE5_ONOS_Recovery%d' % ( i + 1 ) )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
+        except ImportError:
+            main.log.error( "SRHAFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRHAFuncs()
+        main.funcs.runTest( main, 5, 3, '2x2',
+                            116, False, True )
 
     def CASE6( self, main ):
         """
@@ -218,38 +152,17 @@
         7 ) Pingall
         8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ) 'failures' times
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        import time
-        import random
-        from random import randint
-        from datetime import datetime
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-
-        description = "High Availability tests - ONOS random failures and Switch random failures with 2x2 Leaf-spine "
-        main.case( description )
-        run.config( main, '2x2' )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        for i in range( 0, main.failures ):
-            onosToKill = randint( 0, ( main.Cluster.numCtrls - 1 ) )
-            switchToKill = randint( 0, 1 )
-            run.killOnos( main, [ onosToKill ], '4', '8', '2' )
-            run.pingAll( main, 'CASE6_ONOS_Failure%d' % ( i + 1 ) )
-            run.killSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='3', links='4' )
-            time.sleep( main.switchSleep )
-            run.pingAll( main, "CASE6_SWITCH_Failure%d" % ( i + 1 ) )
-            run.recoverSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='4', links='8' )
-            run.checkFlows( main, minFlowCount=116, tag="CASE6_SWITCH_Recovery%d" % ( i + 1 ) )
-            run.pingAll( main, "CASE6_SWITCH_Recovery%d" % ( i + 1 ) )
-            run.recoverOnos( main, [ onosToKill ], '4', '8', '3' )
-            run.checkFlows( main, minFlowCount=116, tag='CASE6_ONOS_Recovery%d' % ( i + 1 ) )
-            run.pingAll( main, 'CASE6_ONOS_Recovery%d' % ( i + 1 ) )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
+        except ImportError:
+            main.log.error( "SRHAFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRHAFuncs()
+        main.funcs.runTest( main, 6, 3, '2x2',
+                            116, True, True )
 
     def CASE7( self, main ):
         """
@@ -262,35 +175,17 @@
         7 ) Pingall
         8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        import time
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-
-        description = "High Availability tests - ONOS failures and Switch failures with 4x4 Leaf-spine "
-        main.case( description )
-        run.config( main, '4x4' )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main )
-        for i in range( 0, main.failures ):
-            onosToKill = i % main.Cluster.numCtrls
-            switchToKill = i % len( main.spines )
-            run.killOnos( main, [ onosToKill ], '8', '32', '2' )
-            run.pingAll( main, 'CASE7_ONOS_Failure%d' % ( i + 1 ) )
-            run.killSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='7', links='24' )
-            time.sleep( main.switchSleep )
-            run.pingAll( main, "CASE7_SWITCH_Failure%d" % ( i + 1 ) )
-            run.recoverSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='8', links='32' )
-            run.checkFlows( main, minFlowCount=350, tag="CASE7_SWITCH_Recovery%d" % ( i + 1 ) )
-            run.pingAll( main, "CASE7_SWITCH_Recovery%d" % ( i + 1 ) )
-            run.recoverOnos( main, [ onosToKill ], '8', '32', '3' )
-            run.checkFlows( main, minFlowCount=350, tag='CASE7_ONOS_Recovery%d' % ( i + 1 ) )
-            run.pingAll( main, 'CASE7_ONOS_Recovery%d' % ( i + 1 ) )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
+        except ImportError:
+            main.log.error( "SRHAFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRHAFuncs()
+        main.funcs.runTest( main, 7, 3, '4x4',
+                            350, False, True )
 
     def CASE8( self, main ):
         """
@@ -303,35 +198,14 @@
         7 ) Pingall
         8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        import time
-        import random
-        from random import randint
-        from datetime import datetime
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-
-        description = "High Availability tests - ONOS random failures and Switch random failures with 4x4 Leaf-spine "
-        main.case( description )
-        run.config( main, '4x4' )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main )
-        for i in range( 0, main.failures ):
-            onosToKill = randint( 0, ( main.Cluster.numCtrls - 1 ) )
-            switchToKill = randint( 0, 3 )
-            run.killOnos( main, [ onosToKill ], '8', '32', '2' )
-            run.pingAll( main, 'CASE8_ONOS_Failure%d' % ( i + 1 ) )
-            run.killSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='7', links='24' )
-            time.sleep( main.switchSleep )
-            run.pingAll( main, "CASE8_SWITCH_Failure%d" % ( i + 1 ) )
-            run.recoverSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='8', links='32' )
-            run.checkFlows( main, minFlowCount=350, tag="CASE8_SWITCH_Recovery%d" % ( i + 1 ) )
-            run.pingAll( main, "CASE8_SWITCH_Recovery%d" % ( i + 1 ) )
-            run.recoverOnos( main, [ onosToKill ], '8', '32', '3' )
-            run.checkFlows( main, minFlowCount=350, tag='CASE8_ONOS_Recovery%d' % ( i + 1 ) )
-            run.pingAll( main, 'CASE8_ONOS_Recovery%d' % ( i + 1 ) )
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
+        except ImportError:
+            main.log.error( "SRHAFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRHAFuncs()
+        main.funcs.runTest( main, 8, 3, '4x4',
+                            350, True, True )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/dependencies/SRHAFuncs.py b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/dependencies/SRHAFuncs.py
new file mode 100644
index 0000000..5b1d137
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/dependencies/SRHAFuncs.py
@@ -0,0 +1,104 @@
+"""
+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/>.
+"""
+
+from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run
+import random
+from random import randint
+from datetime import datetime
+import time
+
+class SRHAFuncs():
+
+    def __init__( self ):
+        self.default = ''
+        self.topo = dict()
+        self.topo[ '2x2' ] = ( 2, 2, '', '2x2 Leaf-spine' )
+        self.topo[ '4x4' ] = ( 4, 4, '--leaf=4 --spine=4', '4x4 Leaf-spine' )
+
+    def runTest( self, main, caseNum, numNodes, Topo, minFlow, isRandom, isKillingSwitch ):
+        if not hasattr( main, 'apps' ):
+            run.initTest( main )
+
+        description = "High Availability tests - " + \
+                      self.generateDescription( isRandom, isKillingSwitch ) + \
+                      self.topo[ Topo ][ 3 ]
+        main.case( description )
+        run.config( main, Topo )
+        run.installOnos( main )
+        run.loadJson( main )
+        run.loadChart( main )
+        run.startMininet( main, 'cord_fabric.py', args=self.topo[ Topo ][ 2 ] )
+        # pre-configured routing and bridging test
+        run.checkFlows( main, minFlowCount=minFlow )
+        run.pingAll( main )
+        switch = self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ]
+        link = ( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] ) * self.topo[ Topo ][ 0 ]
+        self.generateRandom( isRandom )
+        for i in range( 0, main.failures ):
+            toKill = self.getNextNum( isRandom, main.Cluster.numCtrls, i )
+            run.killOnos( main, [ toKill ], '{}'.format( switch ),
+                          '{}'.format( link ), '{}'.format( numNodes - 1 ) )
+            run.pingAll( main, 'CASE{}_ONOS_Failure{}'.format( caseNum, i + 1 ) )
+            if isKillingSwitch:
+                self.killAndRecoverSwitch( main, caseNum, numNodes,
+                                           Topo, minFlow, isRandom,
+                                           i, switch, link )
+            run.recoverOnos( main, [ toKill ], '{}'.format( switch ),
+                             '{}'.format( link ), '{}'.format( numNodes ) )
+            run.checkFlows( main, minFlowCount=minFlow,
+                            tag='CASE{}_ONOS{}_Recovery'.format( caseNum, i + 1 ) )
+            run.pingAll( main, 'CASE{}_ONOS_Recovery{}'.format( caseNum, i + 1 ) )
+        # TODO Dynamic config of hosts in subnet
+        # TODO Dynamic config of host not in subnet
+        # TODO Dynamic config of vlan xconnect
+        # TODO Vrouter integration
+        # TODO Mcast integration
+        if hasattr( main, 'Mininet1' ):
+            run.cleanup( main )
+        else:
+            # TODO: disconnect TestON from the physical network
+            pass
+
+    def generateDescription( self, isRandom, isKillingSwitch ):
+        return "ONOS " + ( "random " if isRandom else "" ) + "failures" +\
+               ( " and Switch " + ( "random " if isRandom else "" ) + "failures "
+                 if isKillingSwitch else " " )
+
+    def generateRandom( self, isRandom ):
+        if isRandom:
+            random.seed( datetime.now() )
+
+    def getNextNum( self, isRandom, numCtrl, pos ):
+        return randint( 0, ( numCtrl - 1 ) ) if isRandom else pos % numCtrl
+
+    def killAndRecoverSwitch( self, main, caseNum, numNodes, Topo, minFlow, isRandom, pos, numSwitch, numLink ):
+        switchToKill = self.getNextNum( isRandom, self.topo[ Topo ][ 0 ], pos )
+        run.killSwitch( main, main.spines[ switchToKill ][ 'name' ],
+                        switches='{}'.format( numSwitch - 1 ),
+                        links='{}'.format( numLink - numSwitch ) )
+        time.sleep( main.switchSleep )
+        run.pingAll( main, "CASE{}_SWITCH_Failure{}".format( caseNum, pos + 1 ) )
+        run.recoverSwitch( main, main.spines[ switchToKill ][ 'name' ],
+                           switches='{}'.format( numSwitch ),
+                           links='{}'.format( numLink ) )
+        run.checkFlows( main, minFlowCount=minFlow,
+                        tag="CASE{}_SWITCH_Recovery{}".format( caseNum, pos + 1 ) )
+        run.pingAll( main, "CASE{}_SWITCH_Recovery{}".format( caseNum, pos + 1 ) )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/dependencies/__init__.py b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/dependencies/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/dependencies/__init__.py
diff --git a/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.params b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.params
index ea3112c..7c546d4 100755
--- a/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.params
@@ -13,6 +13,8 @@
     </SCALE>
 
     <DEPENDENCY>
+        <useCommonConf>True</useCommonConf>
+        <useCommonTopo>True</useCommonTopo>
         <topology>cord_fabric.py</topology>
     </DEPENDENCY>
 
diff --git a/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py
index e8b6cf7..dfc6e6c 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py
@@ -38,33 +38,17 @@
         Cause link failure
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs
+        except ImportError:
+            main.log.error( "SRLinkFailFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRLinkFailFuncs()
 
-        description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
-        main.case( description )
-
-        main.cfgName = '2x2'
-        main.Cluster.setRunningNode( 1 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        # link failure
-        run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' )
-        run.pingAll( main, "CASE1_Failure" )
-        run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
-                         'of:0000000000000002', '2', '3', '4', '8' )
-        run.pingAll( main, "CASE1_Recovery" )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        main.funcs.runTest( main, 1, 1, '2x2', 116 )
 
     def CASE2( self, main ):
         """
@@ -74,31 +58,17 @@
         Cause link failure
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
-        main.case( description )
-        main.cfgName = '4x4'
-        main.Cluster.setRunningNode( 1 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main )
-        # link failure
-        run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' )
-        run.pingAll( main, "CASE2_Failure" )
-        run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
-                         'of:0000000000000002', '2', '3', '8', '32' )
-        run.pingAll( main, "CASE2_Recovery" )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO preconfigured xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs
+        except ImportError:
+            main.log.error( "SRLinkFailFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRLinkFailFuncs()
+
+        main.funcs.runTest( main, 2, 1, '4x4', 350 )
 
     def CASE4( self, main ):
         """
@@ -108,31 +78,17 @@
         Cause link failure
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
-        main.case( description )
-        main.cfgName = '2x2'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        # link failure
-        run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' )
-        run.pingAll( main, "CASE3_Failure" )
-        run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
-                         'of:0000000000000002', '2', '3', '4', '8' )
-        run.pingAll( main, "CASE3_Recovery" )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs
+        except ImportError:
+            main.log.error( "SRLinkFailFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRLinkFailFuncs()
+
+        main.funcs.runTest( main, 3, 3, '2x2', 116 )
 
     def CASE5( self, main ):
         """
@@ -142,28 +98,14 @@
         Cause link failure
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
-        main.case( description )
-        main.cfgName = '4x4'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main )
-        # link failure
-        run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' )
-        run.pingAll( main, "CASE2_Failure" )
-        run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
-                         'of:0000000000000002', '2', '3', '8', '32' )
-        run.pingAll( main, "CASE2_Recovery" )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO preconfigured xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs
+        except ImportError:
+            main.log.error( "SRLinkFailFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRLinkFailFuncs()
+
+        main.funcs.runTest( main, 4, 3, '4x4', 350 )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/dependencies/SRLinkFailFuncs.py b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/dependencies/SRLinkFailFuncs.py
new file mode 100644
index 0000000..1837cf4
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/dependencies/SRLinkFailFuncs.py
@@ -0,0 +1,72 @@
+"""
+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/>.
+"""
+
+from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run
+
+class SRLinkFailFuncs():
+
+    def __init__( self ):
+        self.default = ''
+        self.topo = dict()
+        self.topo[ '0x1' ] = ( 0, 1, '--leaf=1 --spine=0', 'single switch' )
+        self.topo[ '2x2' ] = ( 2, 2, '', '2x2 Leaf-spine' )
+        self.topo[ '4x4' ] = ( 4, 4, '--leaf=4 --spine=4', '4x4 Leaf-spine' )
+        self.switchOne = 'spine101'
+        self.switchTwo = 'leaf2'
+        self.dpidOne = 'of:0000000000000101'
+        self.dpidTwo = 'of:0000000000000002'
+        self.portOne = '2'
+        self.portTwo = '3'
+
+    def runTest( self, main, caseNum, numNodes, Topo, minFlow ):
+        if not hasattr( main, 'apps' ):
+            run.initTest( main )
+
+        description = "Bridging and Routing Link Failure test with " + self.topo[ Topo ][ 3 ] + " and {} Onos".format( numNodes )
+        main.case( description )
+
+        main.cfgName = Topo
+        main.Cluster.setRunningNode( numNodes )
+        run.installOnos( main )
+        run.loadJson( main )
+        run.loadChart( main )
+        run.startMininet( main, 'cord_fabric.py', args=self.topo[ Topo ][ 2 ] )
+        # pre-configured routing and bridging test
+        run.checkFlows( main, minFlowCount=minFlow )
+        run.pingAll( main )
+        switch = self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ]
+        link = ( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] ) * self.topo[ Topo ][ 0 ]
+        # link failure
+        run.killLink( main, self.switchOne, self.switchTwo, switches='{}'.format( switch ), links='{}'.format( link - 2 ) )
+        run.pingAll( main, "CASE{}_Failure".format( caseNum ) )
+        run.restoreLink( main, self.switchOne, self.switchTwo, self.dpidOne,
+                         self.dpidTwo, self.portOne, self.portTwo, '{}'.format( switch ), '{}'.format( link ) )
+        run.pingAll( main, "CASE{}_Recovery".format( caseNum ) )
+        # TODO Dynamic config of hosts in subnet
+        # TODO Dynamic config of host not in subnet
+        # TODO Dynamic config of vlan xconnect
+        # TODO Vrouter integration
+        # TODO Mcast integration
+        if hasattr( main, 'Mininet1' ):
+            run.cleanup( main )
+        else:
+            # TODO: disconnect TestON from the physical network
+            pass
diff --git a/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/dependencies/__init__.py b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/dependencies/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/dependencies/__init__.py
diff --git a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.params b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.params
index abe305e..05222f0 100755
--- a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.params
+++ b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.params
@@ -13,6 +13,8 @@
     </SCALE>
 
     <DEPENDENCY>
+        <useCommonConf>True</useCommonConf>
+        <useCommonTopo>True</useCommonTopo>
         <topology>cord_fabric.py</topology>
     </DEPENDENCY>
 
diff --git a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.py b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.py
index 0e2b135..a2fca03 100644
--- a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.py
+++ b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.py
@@ -36,30 +36,17 @@
         Induce ONOS Failure
         Pingall
         """
-        description = "ONOS Failure test with 2x2 Leaf-spine "
-        main.case( description )
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        main.cfgName = '2x2'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        run.killOnos( main, [ 0 ], '4', '8', '2' )
-        run.pingAll( main, 'CASE1_Failure' )
-        run.recoverOnos( main, [ 0 ], '4', '8', '3' )
-        run.checkFlows( main, minFlowCount=116, tag='CASE1_Recovery' )
-        run.pingAll( main, 'CASE1_Recovery' )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SROnosFailure.dependencies.SROnosFailureFuncs import SROnosFailureFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SROnosFailureFuncs()
+        main.funcs.runTest( main, 1, 3,
+                            '2x2', 116 )
 
     def CASE2( self, main ):
         """
@@ -69,30 +56,17 @@
         Induce ONOS Failure
         Pingall
         """
-        description = "ONOS Failure test with 4x4 Leaf-spine "
-        main.case( description )
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        main.cfgName = '4x4'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main, 'CASE2' )
-        run.killOnos( main, [ 0 ], '8', '32', '2' )
-        run.pingAll( main, 'CASE2_Failure' )
-        run.recoverOnos( main, [ 0 ], '8', '32', '3' )
-        run.checkFlows( main, minFlowCount=350, tag='CASE2_Recovery' )
-        run.pingAll( main, 'CASE2_Recovery' )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SROnosFailure.dependencies.SROnosFailureFuncs import SROnosFailureFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SROnosFailureFuncs()
+        main.funcs.runTest( main, 2, 3,
+                            '4x4', 350 )
 
     def CASE3( self, main ):
         """
@@ -102,27 +76,14 @@
         Induce ONOS Failure
         Pingall
         """
-        description = "ONOS Failure test with single switch "
-        main.case( description )
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        main.cfgName = '0x1'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=15 )
-        run.pingAll( main, 'CASE3' )
-        run.killOnos( main, [ 0 ], '1', '0', '2' )
-        run.pingAll( main, 'CASE3_Failure' )
-        run.recoverOnos( main, [ 0 ], '1', '0', '3' )
-        run.checkFlows( main, minFlowCount=15, tag='CASE3_Recovery' )
-        run.pingAll( main, 'CASE3_Recovery' )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SROnosFailure.dependencies.SROnosFailureFuncs import SROnosFailureFuncs
+        except ImportError:
+            main.log.error( "SRClusterRestartFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SROnosFailureFuncs()
+        main.funcs.runTest( main, 3, 3,
+                            '0x1', 15 )
diff --git a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/dependencies/SROnosFailureFuncs.py b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/dependencies/SROnosFailureFuncs.py
new file mode 100644
index 0000000..f130ff2
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/dependencies/SROnosFailureFuncs.py
@@ -0,0 +1,68 @@
+"""
+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/>.
+"""
+
+from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run
+
+class SROnosFailureFuncs():
+
+    def __init__( self ):
+        self.default = ''
+        self.topo = dict()
+        self.topo[ '0x1' ] = ( 0, 1, '--leaf=1 --spine=0', 'single switch' )
+        self.topo[ '2x2' ] = ( 2, 2, '', '2x2 Leaf-spine' )
+        self.topo[ '4x4' ] = ( 4, 4, '--leaf=4 --spine=4', '4x4 Leaf-spine' )
+
+    def runTest( self, main, caseNum, numNodes, Topo, minFlow, killList=[ 0 ] ):
+        description = "ONOS Failure test with " + self.topo[ Topo ][ 3 ]
+        main.case( description )
+        if not hasattr( main, 'apps' ):
+            run.initTest( main )
+        main.cfgName = Topo
+        main.Cluster.setRunningNode( numNodes )
+        run.installOnos( main )
+        run.loadJson( main )
+        run.loadChart( main )
+        if hasattr( main, 'Mininet1' ):
+            run.startMininet( main, 'cord_fabric.py', args=self.topo[ Topo ][ 2 ] )
+        else:
+            # Run the test with physical devices
+            # TODO: connect TestON to the physical network
+            pass
+        # pre-configured routing and bridging test
+        run.checkFlows( main, minFlowCount=minFlow )
+        run.pingAll( main, 'CASE{}'.format( caseNum ) )
+        switch = '{}'.format( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] )
+        link = '{}'.format( ( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] ) * self.topo[ Topo ][ 0 ] )
+        run.killOnos( main, killList, switch, link, '{}'.format( numNodes - 1 ) )
+        run.pingAll( main, 'CASE{}_Failure'.format( caseNum ) )
+        run.recoverOnos( main, killList, switch, link, '{}'.format( numNodes ) )
+        run.checkFlows( main, minFlowCount=minFlow, tag='CASE{}_Recovery'.format( caseNum ) )
+        run.pingAll( main, 'CASE{}_Recovery'.format( caseNum ) )
+        # TODO Dynamic config of hosts in subnet
+        # TODO Dynamic config of host not in subnet
+        # TODO Dynamic config of vlan xconnect
+        # TODO Vrouter integration
+        # TODO Mcast integration
+        if hasattr( main, 'Mininet1' ):
+            run.cleanup( main )
+        else:
+            # TODO: disconnect TestON from the physical network
+            pass
diff --git a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/dependencies/__init__.py b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/dependencies/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/dependencies/__init__.py
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
index 6586fe3..54728ce 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
@@ -12,9 +12,11 @@
     </SCALE>
 
     <DEPENDENCY>
+        <useCommonConf>False</useCommonConf>
+        <useCommonTopo>True</useCommonTopo>
         <topology>comcast_fabric.py</topology>
         <lib>routinglib.py,trellislib.py,trellis_fabric.py</lib>
-        <testConf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</testConf>
+        <conf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</conf>
     </DEPENDENCY>
 
     <ENV>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
index 7566ff4..cecb915 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
@@ -30,7 +30,7 @@
         self.default = ''
 
     @staticmethod
-    def runTest( main, test_idx, onosNodes, dhcp, routers, ipv4, ipv6, description):
+    def runTest( main, test_idx, onosNodes, dhcp, routers, ipv4, ipv6, description ):
 
         skipPackage = False
         init = False
@@ -42,41 +42,41 @@
         if not init and onosNodes == main.Cluster.numCtrls:
             skipPackage = True
 
-        main.case('%s, ONOS instance%s' %
-                  (description, onosNodes))
+        main.case( '%s, ONOS instance%s' % ( description, onosNodes ) )
 
         main.cfgName = 'COMCAST_CONFIG_ipv4=%d_ipv6=%d_dhcp=%d_routers=%d' % \
-            (ipv4, ipv6, dhcp, routers)
-        main.configPath = main.path + "/dependencies/"
+            ( ipv4, ipv6, dhcp, routers )
         main.resultFileName = 'CASE%02d' % test_idx
-        main.Cluster.setRunningNode(onosNodes)
+        main.Cluster.setRunningNode( onosNodes )
 
-        run.installOnos(main, skipPackage=skipPackage, cliSleep=5,
-                        parallel=False)
+        run.installOnos( main, skipPackage=skipPackage, cliSleep=5,
+                         parallel=False )
+        run.loadJson( main )
+        run.loadChart( main )
 
         # wait some
-        time.sleep(5)
+        time.sleep( 5 )
 
-        if hasattr(main, 'Mininet1'):
+        if hasattr( main, 'Mininet1' ):
             # Run the test with Mininet
-            mininet_args = ' --dhcp=%s --routers=%s --ipv6=%s --ipv4=%s' % (dhcp, routers, ipv6, ipv4)
-            run.startMininet(main, 'comcast_fabric.py', args=mininet_args)
+            mininet_args = ' --dhcp=%s --routers=%s --ipv6=%s --ipv4=%s' % ( dhcp, routers, ipv6, ipv4 )
+            run.startMininet( main, 'comcast_fabric.py', args=mininet_args )
         else:
             # Run the test with physical devices
             # TODO: connect TestON to the physical network
             pass
 
         # wait some time for onos to install the rules!
-        time.sleep(25)
+        time.sleep( 25 )
 
-        if (dhcp):
-            time.sleep(60)
+        if ( dhcp ):
+            time.sleep( 60 )
 
         # ping hosts
         run.pingAll( main, 'CASE%02d' % test_idx, acceptableFailed=5, basedOnIp=True )
 
-        if hasattr(main, 'Mininet1'):
-            run.cleanup(main)
+        if hasattr( main, 'Mininet1' ):
+            run.cleanup( main )
         else:
             # TODO: disconnect TestON from the physical network
             pass
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=0_routers=0.chart b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/chart/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=0_routers=0.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=0_routers=0.chart
rename to TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/chart/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=0_routers=0.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=0.chart b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/chart/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=0.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=0.chart
rename to TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/chart/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=0.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=0_routers=0.chart b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/chart/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=0_routers=0.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=0_routers=0.chart
rename to TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/chart/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=0_routers=0.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=0.chart b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/chart/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=0.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=0.chart
rename to TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/chart/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=0.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=1_dhcp=0_routers=0.chart b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/chart/COMCAST_CONFIG_ipv4=1_ipv6=1_dhcp=0_routers=0.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=1_dhcp=0_routers=0.chart
rename to TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/chart/COMCAST_CONFIG_ipv4=1_ipv6=1_dhcp=0_routers=0.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/extra.json b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/extra.json
new file mode 100644
index 0000000..e3544bf
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/extra.json
@@ -0,0 +1,16 @@
+{
+    "hosts" : {
+        "00:00:00:00:00:09/-1" : {
+            "basic": {
+                "ips": ["10.0.1.9"],
+                "locations": ["of:0000000000000001/3"]
+            }
+        },
+        "00:00:00:00:09:01/-1" : {
+            "basic": {
+                "ips": ["10.0.9.1"],
+                "locations": ["of:0000000000000001/4"]
+            }
+        }
+    }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.params b/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.params
index fceb91a..d32d1a6 100755
--- a/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.params
@@ -13,6 +13,8 @@
     </SCALE>
 
     <DEPENDENCY>
+        <useCommonConf>True</useCommonConf>
+        <useCommonTopo>True</useCommonTopo>
         <topology>cord_fabric.py</topology>
     </DEPENDENCY>
 
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.py b/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.py
index 5a863a9..eefb4d5 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.py
@@ -37,27 +37,17 @@
         Start 2x2 Leaf-Spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-
-        description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
-        main.case( description )
-
-        main.cfgName = '2x2'
-        main.Cluster.setRunningNode( 1 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRSanity.dependencies.SRSanityFuncs import SRSanityFuncs
+        except ImportError:
+            main.log.error( "SRSanityFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRSanityFuncs()
+        main.funcs.runTest( main, 1, 1,
+                            '2x2', 116 )
 
     def CASE2( self, main ):
         """
@@ -65,25 +55,17 @@
         Start 4x4 Leaf-Spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
-        main.case( description )
-        main.cfgName = '4x4'
-        main.Cluster.setRunningNode( 1 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRSanity.dependencies.SRSanityFuncs import SRSanityFuncs
+        except ImportError:
+            main.log.error( "SRSanityFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRSanityFuncs()
+        main.funcs.runTest( main, 2, 1,
+                            '4x4', 350 )
 
     def CASE3( self, main ):
         """
@@ -91,25 +73,17 @@
         Start single switch topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with single switch "
-        main.case( description )
-        main.cfgName = '0x1'
-        main.numCtrls = 1
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=15 )
-        run.pingAll( main )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRSanity.dependencies.SRSanityFuncs import SRSanityFuncs
+        except ImportError:
+            main.log.error( "SRSanityFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRSanityFuncs()
+        main.funcs.runTest( main, 3, 1,
+                            '0x1', 15 )
 
     def CASE4( self, main ):
         """
@@ -117,25 +91,17 @@
         Start 2x2 Leaf-Spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
-        main.case( description )
-        main.cfgName = '2x2'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRSanity.dependencies.SRSanityFuncs import SRSanityFuncs
+        except ImportError:
+            main.log.error( "SRSanityFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRSanityFuncs()
+        main.funcs.runTest( main, 4, 3,
+                            '2x2', 116 )
 
     def CASE5( self, main ):
         """
@@ -143,25 +109,17 @@
         Start 4x4 Leaf-Spine topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
-        main.case( description )
-        main.cfgName = '4x4'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRSanity.dependencies.SRSanityFuncs import SRSanityFuncs
+        except ImportError:
+            main.log.error( "SRSanityFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRSanityFuncs()
+        main.funcs.runTest( main, 5, 3,
+                            '4x4', 350 )
 
     def CASE6( self, main ):
         """
@@ -169,22 +127,14 @@
         Start single switch topology
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with single switch "
-        main.case( description )
-        main.cfgName = '0x1'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=15 )
-        run.pingAll( main )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRSanity.dependencies.SRSanityFuncs import SRSanityFuncs
+        except ImportError:
+            main.log.error( "SRSanityFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRSanityFuncs()
+        main.funcs.runTest( main, 6, 3,
+                            '0x1', 15 )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSanity/dependencies/SRSanityFuncs.py b/TestON/tests/USECASE/SegmentRouting/SRSanity/dependencies/SRSanityFuncs.py
new file mode 100644
index 0000000..4d91bdd
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRSanity/dependencies/SRSanityFuncs.py
@@ -0,0 +1,58 @@
+"""
+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/>.
+"""
+
+from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run
+
+class SRSanityFuncs():
+
+    def __init__( self ):
+        self.default = ''
+        self.topo = dict()
+        self.topo[ '0x1' ] = ( 0, 1, '--leaf=1 --spine=0', 'single switch' )
+        self.topo[ '2x2' ] = ( 2, 2, '', '2x2 Leaf-spine' )
+        self.topo[ '4x4' ] = ( 4, 4, '--leaf=4 --spine=4', '4x4 Leaf-spine' )
+
+    def runTest( self, main, caseNum, numNodes, Topo, minFlow ):
+        if not hasattr( main, 'apps' ):
+            run.initTest( main )
+
+        description = "Bridging and Routing sanity test with " + self.topo[ Topo ][ 3 ] + " and {} Onos".format( numNodes )
+        main.case( description )
+
+        main.cfgName = Topo
+        main.Cluster.setRunningNode( numNodes )
+        run.installOnos( main )
+        run.loadJson( main )
+        run.loadChart( main )
+        run.startMininet( main, 'cord_fabric.py', args=self.topo[ Topo ][ 2 ] )
+        # pre-configured routing and bridging test
+        run.checkFlows( main, minFlowCount=minFlow )
+        run.pingAll( main )
+        # TODO Dynamic config of hosts in subnet
+        # TODO Dynamic config of host not in subnet
+        # TODO Dynamic config of vlan xconnect
+        # TODO Vrouter integration
+        # TODO Mcast integration
+        if hasattr( main, 'Mininet1' ):
+            run.cleanup( main )
+        else:
+            # TODO: disconnect TestON from the physical network
+            pass
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSanity/dependencies/__init__.py b/TestON/tests/USECASE/SegmentRouting/SRSanity/dependencies/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRSanity/dependencies/__init__.py
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.params b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.params
index ea3112c..7c546d4 100755
--- a/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.params
@@ -13,6 +13,8 @@
     </SCALE>
 
     <DEPENDENCY>
+        <useCommonConf>True</useCommonConf>
+        <useCommonTopo>True</useCommonTopo>
         <topology>cord_fabric.py</topology>
     </DEPENDENCY>
 
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py
index 1d013a0..61a9098 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py
@@ -38,34 +38,17 @@
         Cause switch failure
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-
-        description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
-        main.case( description )
-
-        main.cfgName = '2x2'
-        main.Cluster.setRunningNode( 1 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        # switch failure\
-        switch = main.params[ 'kill' ][ 'switch' ]
-        run.killSwitch( main, switch, switches='3', links='4' )
-        run.pingAll( main, "CASE1_Failure" )
-        run.recoverSwitch( main, switch, switches='4', links='8' )
-        run.checkFlows( main, minFlowCount=116, tag="CASE1_Recovery" )
-        run.pingAll( main, "CASE1_Recovery" )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRSwitchFailure.dependencies.SRSwitchFailureFuncs import SRSwitchFailureFuncs
+        except ImportError:
+            main.log.error( "SRSanityFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRSwitchFailureFuncs()
+        main.funcs.runTest( main, 1, 1,
+                            '2x2', 116 )
 
     def CASE2( self, main ):
         """
@@ -75,34 +58,17 @@
         Cause switch failure
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        import time
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
-        main.case( description )
-        main.cfgName = '4x4'
-        main.Cluster.setRunningNode( 1 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main )
-        # switch failure
-        switch = main.params[ 'kill' ][ 'switch' ]
-        run.killSwitch( main, switch, switches='7', links='24' )
-        time.sleep( main.switchSleep )
-        run.pingAll( main, "CASE2_Failure" )
-        run.recoverSwitch( main, switch, switches='8', links='32' )
-        run.checkFlows( main, minFlowCount=350, tag="CASE2_Recovery" )
-        run.pingAll( main, "CASE2_Recovery" )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO preconfigured xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRSwitchFailure.dependencies.SRSwitchFailureFuncs import SRSwitchFailureFuncs
+        except ImportError:
+            main.log.error( "SRSanityFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRSwitchFailureFuncs()
+        main.funcs.runTest( main, 2, 1,
+                            '4x4', 350 )
 
     def CASE4( self, main ):
         """
@@ -112,32 +78,17 @@
         Cause link failure
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
-        main.case( description )
-        main.cfgName = '2x2'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py' )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=116 )
-        run.pingAll( main )
-        # switch failure
-        switch = main.params[ 'kill' ][ 'switch' ]
-        run.killSwitch( main, switch, switches='3', links='4' )
-        run.pingAll( main, "CASE4_Failure" )
-        run.recoverSwitch( main, switch, switches='4', links='8' )
-        run.checkFlows( main, minFlowCount=116, tag="CASE4_Recovery" )
-        run.pingAll( main, "CASE4_Recovery" )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRSwitchFailure.dependencies.SRSwitchFailureFuncs import SRSwitchFailureFuncs
+        except ImportError:
+            main.log.error( "SRSanityFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRSwitchFailureFuncs()
+        main.funcs.runTest( main, 4, 3,
+                            '2x2', 116 )
 
     def CASE5( self, main ):
         """
@@ -147,31 +98,14 @@
         Cause link failure
         Pingall
         """
-        from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
-            Testcaselib as run
-        import time
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
-        main.case( description )
-        main.cfgName = '4x4'
-        main.Cluster.setRunningNode( 3 )
-        run.installOnos( main )
-        run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=350 )
-        run.pingAll( main )
-        # switch failure
-        switch = main.params[ 'kill' ][ 'switch' ]
-        run.killSwitch( main, switch, switches='7', links='24' )
-        time.sleep( main.switchSleep )
-        run.pingAll( main, "CASE5_Failure" )
-        run.recoverSwitch( main, switch, switches='8', links='32' )
-        run.checkFlows( main, minFlowCount=350, tag="CASE5_Recovery" )
-        run.pingAll( main, "CASE5_Recovery" )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO preconfigured xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        run.cleanup( main )
+        try:
+            from tests.USECASE.SegmentRouting.SRSwitchFailure.dependencies.SRSwitchFailureFuncs import SRSwitchFailureFuncs
+        except ImportError:
+            main.log.error( "SRSanityFuncs not found. Exiting the test" )
+            main.cleanAndExit()
+        try:
+            main.funcs
+        except ( NameError, AttributeError ):
+            main.funcs = SRSwitchFailureFuncs()
+        main.funcs.runTest( main, 5, 3,
+                            '4x4', 350 )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/dependencies/SRSwitchFailureFuncs.py b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/dependencies/SRSwitchFailureFuncs.py
new file mode 100644
index 0000000..0ff6338
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/dependencies/SRSwitchFailureFuncs.py
@@ -0,0 +1,67 @@
+"""
+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/>.
+"""
+
+from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run
+
+class SRSwitchFailureFuncs():
+
+    def __init__( self ):
+        self.default = ''
+        self.topo = dict()
+        self.topo[ '0x1' ] = ( 0, 1, '--leaf=1 --spine=0', 'single switch' )
+        self.topo[ '2x2' ] = ( 2, 2, '', '2x2 Leaf-spine' )
+        self.topo[ '4x4' ] = ( 4, 4, '--leaf=4 --spine=4', '4x4 Leaf-spine' )
+
+    def runTest( self, main, caseNum, numNodes, Topo, minFlow ):
+        if not hasattr( main, 'apps' ):
+            run.initTest( main )
+
+        description = "Switch Failure test with " + self.topo[ Topo ][ 3 ] + " and {} Onos".format( numNodes )
+        main.case( description )
+
+        main.cfgName = Topo
+        main.Cluster.setRunningNode( numNodes )
+        run.installOnos( main )
+        run.loadJson( main )
+        run.loadChart( main )
+        run.startMininet( main, 'cord_fabric.py', args=self.topo[ Topo ][ 2 ] )
+        # pre-configured routing and bridging test
+        run.checkFlows( main, minFlowCount=minFlow )
+        run.pingAll( main )
+        # switch failure\
+        switch = main.params[ 'kill' ][ 'switch' ]
+        switchNum = self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ]
+        linkNum = ( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] ) * self.topo[ Topo ][ 0 ]
+        run.killSwitch( main, switch, switches='{}'.format( switchNum - 1 ), links='{}'.format( linkNum - switchNum ) )
+        run.pingAll( main, "CASE{}_Failure".format( caseNum ) )
+        run.recoverSwitch( main, switch, switches='{}'.format( switchNum ), links='{}'.format( linkNum ) )
+        run.checkFlows( main, minFlowCount=minFlow, tag="CASE{}_Recovery".format( caseNum ) )
+        run.pingAll( main, "CASE{}_Recovery".format( caseNum ) )
+        # TODO Dynamic config of hosts in subnet
+        # TODO Dynamic config of host not in subnet
+        # TODO Dynamic config of vlan xconnect
+        # TODO Vrouter integration
+        # TODO Mcast integration
+        if hasattr( main, 'Mininet1' ):
+            run.cleanup( main )
+        else:
+            # TODO: disconnect TestON from the physical network
+            pass
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/dependencies/__init__.py b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/dependencies/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/dependencies/__init__.py
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index dd33993..bb868df 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -57,13 +57,17 @@
             main.cellName = main.params[ 'ENV' ][ 'cellName' ]
             main.apps = main.params[ 'ENV' ][ 'cellApps' ]
             main.path = os.path.dirname( main.testFile )
-            main.topoPath = main.path + "/../dependencies/"
-            main.configPath = main.path + "/../dependencies/conf/"
-            main.testConfPath = main.path + "/dependencies/conf/"
+            main.useCommonTopo = main.params[ 'DEPENDENCY' ][ 'useCommonTopo' ] == 'True'
+            main.topoPath = main.path + ( "/.." if main.useCommonTopo else "" ) + "/dependencies/"
+            main.useCommonConf = main.params[ 'DEPENDENCY' ][ 'useCommonConf' ] == 'True'
+            main.configPath = main.path + ( "/.." if main.useCommonConf else "" ) + "/dependencies/"
+            main.forJson = "json/"
+            main.forChart = "chart/"
+            main.forConfig = "conf/"
+            main.forHost = "host/"
             main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
             main.topologyLib = main.params[ 'DEPENDENCY' ][ 'lib' ] if 'lib' in main.params[ 'DEPENDENCY' ] else None
             main.topologyConf = main.params[ 'DEPENDENCY' ][ 'conf' ] if 'conf' in main.params[ 'DEPENDENCY' ] else None
-            main.testConf = main.params[ 'DEPENDENCY' ][ 'testConf' ] if 'testConf' in main.params[ 'DEPENDENCY' ] else None
             main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
             main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
             main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
@@ -107,16 +111,6 @@
         utilities.assert_equals( expect=main.TRUE, actual=ready,
                                  onpass="ONOS summary command succeded",
                                  onfail="ONOS summary command failed" )
-
-        with open( "%s/json/%s.json" % (
-                main.configPath, main.cfgName ) ) as cfg:
-            main.Cluster.active( 0 ).REST.setNetCfg( json.load( cfg ) )
-        try:
-            with open( "%s/json/%s.chart" % (
-                    main.configPath, main.cfgName ) ) as chart:
-                main.pingChart = json.load( chart )
-        except IOError:
-            main.log.warn( "No chart file found." )
         if not ready:
             main.log.error( "ONOS startup failed!" )
             main.cleanAndExit()
@@ -128,6 +122,27 @@
             ctrl.CLI.logSet( "DEBUG", "org.onosproject.net.flowobjective.impl" )
 
     @staticmethod
+    def loadJson( main ):
+        with open( "%s%s.json" % ( main.configPath + main.forJson,
+                                   main.cfgName ) ) as cfg:
+            main.Cluster.active( 0 ).REST.setNetCfg( json.load( cfg ) )
+
+    @staticmethod
+    def loadChart( main ):
+        try:
+            with open( "%s%s.chart" % ( main.configPath + main.forChart,
+                                        main.cfgName ) ) as chart:
+                main.pingChart = json.load(chart)
+        except IOError:
+            main.log.warn( "No chart file found." )
+
+    @staticmethod
+    def loadHost( main ):
+        with open( "%s%s.host" % ( main.configPath + main.forHost,
+                                   main.cfgName ) ) as host:
+            main.expectedHosts = json.load( host )
+
+    @staticmethod
     def startMininet( main, topology, args="" ):
         copyResult = main.ONOSbench.scp( main.Mininet1,
                                          main.topoPath + main.topology,
@@ -142,13 +157,7 @@
         if main.topologyConf:
             for conf in main.topologyConf.split(","):
                 copyResult = copyResult and main.ONOSbench.scp( main.Mininet1,
-                                                                main.configPath + conf,
-                                                                "~/",
-                                                                direction="to" )
-        if main.testConf:
-            for conf in main.testConf.split(","):
-                copyResult = copyResult and main.ONOSbench.scp( main.Mininet1,
-                                                                main.testConfPath + conf,
+                                                                main.configPath + main.forConfig + conf,
                                                                 "~/",
                                                                 direction="to" )
         stepResult = copyResult
@@ -593,7 +602,7 @@
         """
         import json
         hostCfg = {}
-        with open( main.configPath + "/json/extra.json" ) as template:
+        with open( main.configPath + main.forJson + "extra.json" ) as template:
             hostCfg = json.load( template )
         main.pingChart[ 'ip' ][ 'hosts' ] += [ 'in1' ]
         main.step( "Pushing new configuration" )
@@ -630,7 +639,7 @@
         """
         import json
         hostCfg = {}
-        with open( main.configPath + "/json/extra.json" ) as template:
+        with open( main.configPath + main.forJson + "extra.json" ) as template:
             hostCfg = json.load( template )
         main.step( "Removing host configuration" )
         main.pingChart[ 'ip' ][ 'expect' ] = 0
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/json/0x1.chart b/TestON/tests/USECASE/SegmentRouting/dependencies/chart/0x1.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/dependencies/json/0x1.chart
rename to TestON/tests/USECASE/SegmentRouting/dependencies/chart/0x1.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/json/2x2.chart b/TestON/tests/USECASE/SegmentRouting/dependencies/chart/2x2.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/dependencies/json/2x2.chart
rename to TestON/tests/USECASE/SegmentRouting/dependencies/chart/2x2.chart
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/json/4x4.chart b/TestON/tests/USECASE/SegmentRouting/dependencies/chart/4x4.chart
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/dependencies/json/4x4.chart
rename to TestON/tests/USECASE/SegmentRouting/dependencies/chart/4x4.chart