diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py
index ee04e89..195e156 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py
@@ -21,6 +21,7 @@
 
 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run
 import tests.USECASE.SegmentRouting.dependencies.cfgtranslator as translator
+import json
 
 class SRBridgingTest ():
 
@@ -38,6 +39,7 @@
         try:
             skipPackage = False
             init = False
+            originalJSON = None
             if not hasattr( main, 'apps' ):
                 init = True
                 run.initTest( main )
@@ -93,6 +95,7 @@
                 # Run the test with physical devices
                 run.connectToPhysicalNetwork( main, hostDiscovery=False )  # We don't want to do host discovery in the pod
                 if main.cfgName:
+                    originalJSON = main.Cluster.active( 0 ).REST.getNetCfg()
                     returnValue = run.loadNewJson( main, suffix=suf )
                     utilities.assert_equals( expect=main.TRUE,
                                  actual=returnValue,
@@ -113,6 +116,8 @@
             run.populateHostsVlan( main, main.Network.hosts.keys()  )
             run.verifyTopology( main, switches, links, onosNodes )
             run.pingAll( main )
+            if originalJSON:
+              run.netCfgTransition( main, json.loads(originalJSON) )
         except Exception as e:
             main.log.exception( "Error in runTest" )
             main.skipCase( result="FAIL", msg=e )
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index 93af0ee..3aba8fc 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -216,24 +216,28 @@
 
     @staticmethod
     def loadNewJson( main, suffix='' ):
-        returnValue = main.TRUE
         with open( "%s%s.json%s" % ( main.configPath + main.forJson,
                                      main.cfgName, suffix ) ) as cfg:
             desiredJSON = json.load ( cfg )
-            for device in desiredJSON ["ports"].keys():
-                deviceCfg = desiredJSON[ "ports" ][ device ]
-                currentJSON = main.Cluster.active( 0 ).REST.getNetCfg( subjectClass = "ports", subjectKey = device )
+        return Testcaselib.netCfgTransition( main, desiredJSON )
 
-                currentJSON = json.loads( currentJSON )
-                if currentJSON['interfaces'][0]['ips'] != deviceCfg['interfaces'][0]['ips']:
-                    currentJSON['interfaces'][0]['ips'] = deviceCfg['interfaces'][0]['ips']
-                    data = { 'interfaces': currentJSON['interfaces'] }
-                    A = main.Cluster.active( 0 ).REST.setNetCfg(  data , subjectClass = "ports", subjectKey = device )
-                    returnValue = returnValue and A
-                currentJSON['interfaces'] = deviceCfg['interfaces']
+    @staticmethod
+    def netCfgTransition( main, desiredJSON ):
+        returnValue = main.TRUE
+        for device in desiredJSON ["ports"].keys():
+            deviceCfg = desiredJSON[ "ports" ][ device ]
+            currentJSON = main.Cluster.active( 0 ).REST.getNetCfg( subjectClass = "ports", subjectKey = device )
+
+            currentJSON = json.loads( currentJSON )
+            if currentJSON['interfaces'][0]['ips'] != deviceCfg['interfaces'][0]['ips']:
+                currentJSON['interfaces'][0]['ips'] = deviceCfg['interfaces'][0]['ips']
                 data = { 'interfaces': currentJSON['interfaces'] }
-                B = main.Cluster.active( 0 ).REST.setNetCfg( data , subjectClass = "ports", subjectKey = device )
-                returnValue = returnValue and B
+                A = main.Cluster.active( 0 ).REST.setNetCfg(  data , subjectClass = "ports", subjectKey = device )
+                returnValue = returnValue and A
+            currentJSON['interfaces'] = deviceCfg['interfaces']
+            data = { 'interfaces': currentJSON['interfaces'] }
+            B = main.Cluster.active( 0 ).REST.setNetCfg( data , subjectClass = "ports", subjectKey = device )
+            returnValue = returnValue and B
         return returnValue
 
     @staticmethod
