Merge "Fix a problem which set cfg didn't work correct"
diff --git a/TestON/bin/cleanup.sh b/TestON/bin/cleanup.sh
index 3f82161..f931eca 100755
--- a/TestON/bin/cleanup.sh
+++ b/TestON/bin/cleanup.sh
@@ -29,6 +29,5 @@
         echo "Restoring iptables rules on ${i}"
         ssh sdn@$i "sudo iptables -F"
         ssh sdn@$i "sudo iptables-restore < /etc/iptables/rules.v4"
-        exit 0
     done
 fi
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index ba2b37c..93f98b8 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -2508,7 +2508,7 @@
             nodesStr = self.nodes( jsonFormat=True )
             idList = []
             # Sample nodesStr output
-            # id=local, address=127.0.0.1:9876, state=ACTIVE *
+            # id=local, address=127.0.0.1:9876, state=READY *
             if not nodesStr:
                 main.log.info( "There are no nodes to get id from" )
                 return idList
@@ -3283,7 +3283,6 @@
                 response = self.app( appName, "activate" )
                 if check and response == main.TRUE:
                     for i in range(10):  # try 10 times then give up
-                        # TODO: Check with Thomas about this delay
                         status = self.appStatus( appName )
                         if status == "ACTIVE":
                             return main.TRUE
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 9dee93e..7dbf023 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -1106,7 +1106,7 @@
         try:
             self.handle.sendline( "" )
             self.handle.expect( "\$" )
-            cmdStr = "onos-kill " + str( nodeIp )
+            cmdStr = "onos-die " + str( nodeIp )
             self.handle.sendline( cmdStr )
             i = self.handle.expect( [
                 "Killing\sONOS",
diff --git a/TestON/tests/FUNCintent/FUNCintent.params b/TestON/tests/FUNCintent/FUNCintent.params
index 26ee48d..59db14d 100644
--- a/TestON/tests/FUNCintent/FUNCintent.params
+++ b/TestON/tests/FUNCintent/FUNCintent.params
@@ -11,7 +11,8 @@
     # 14 - Discover hosts with Mininet Pingall
     # 15 - Discover hosts with Scapy arping ( only discovers scapy hosts )
     # 16 - Balance ownership of switches
-    # 17 - Stop Mininet
+    # 17 - Activate Flow Objectives
+    # 18 - Stop Mininet
     # 1000 - Test host intents
     # 2000 - Test point intents
     # 3000 - Test single to multi point intents
@@ -19,10 +20,10 @@
     # 5000 - Test host mobility
     # 6000 - Test Multi Point intent End Point Failure
 
-    <testcases>1,[2,10,12,13,15,16,1000,2000,3000,4000,5000,6000,17]*2,[2,11,12,13,15,16,1000,2000,3000,4000,5000,6000,17]*2</testcases>
+    <testcases>1,[2,10,12,13,15,16,1000,2000,3000,4000,5000,6000,18]*2,[2,10,12,13,15,16,17,1000,2000,3000,4000,5000,6000,18]*2,[2,11,12,13,15,16,1000,2000,3000,4000,5000,6000,18]*2,[2,11,12,13,15,16,17,1000,2000,3000,4000,5000,6000,18]*2</testcases>
 
     <SCALE>
-        <size>1,3,1,3</size>
+        <size>1,3,1,3,1,3,1,3</size>
     </SCALE>
 
     <DEPENDENCY>
diff --git a/TestON/tests/FUNCintent/FUNCintent.py b/TestON/tests/FUNCintent/FUNCintent.py
index ba4e8dd..1ec3a93 100644
--- a/TestON/tests/FUNCintent/FUNCintent.py
+++ b/TestON/tests/FUNCintent/FUNCintent.py
@@ -134,6 +134,7 @@
 
         # main.scale[ 0 ] determines the current number of ONOS controller
         main.numCtrls = int( main.scale[ 0 ] )
+        main.flowCompiler = "Flow Rules"
 
         main.case( "Starting up " + str( main.numCtrls ) +
                    " node(s) ONOS cluster" )
@@ -548,12 +549,31 @@
         balanceResult = utilities.retry( f=main.CLIs[ 0 ].balanceMasters, retValue=main.FALSE, args=[] )
 
         utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
+                                 actual=balanceResult,
                                  onpass="Successfully balanced mastership of switches",
                                  onfail="Failed to balance mastership of switches" )
 
     def CASE17( self, main ):
         """
+            Use Flow Objectives
+        """
+        main.case( "Enable intent compilation using Flow Objectives" )
+        main.step( "Enabling Flow Objectives" )
+
+        main.flowCompiler = "Flow Objectives"
+
+        cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"
+
+        stepResult = main.CLIs[ 0 ].setCfg( component=cmd,
+                                            propName="useFlowObjectives", value="true" )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully activated Flow Objectives",
+                                 onfail="Failed to activate Flow Objectives" )
+
+    def CASE18( self, main ):
+        """
             Stop mininet and remove scapy host
         """
         main.log.report( "Stop Mininet and Scapy" )
@@ -626,13 +646,14 @@
 
         main.testName = "Host Intents"
         main.case( main.testName + " Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case tests Host intents using " +\
                                 str( main.numCtrls ) + " node(s) cluster;\n" +\
                                 "Different type of hosts will be tested in " +\
                                 "each step such as IPV4, Dual stack, VLAN " +\
-                                "etc;\nThe test will use OF " + main.OFProtocol\
-                                + " OVS running in Mininet"
+                                "etc;\nThe test will use OF " + main.OFProtocol +\
+                                " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         main.step( "IPV4: Add host intents between h1 and h9" )
         main.assertReturnString = "Assertion Result for IPV4 host intent with mac addresses\n"
@@ -856,14 +877,15 @@
 
         main.testName = "Point Intents"
         main.case( main.testName + " Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test point to point" +\
                                " intents using " + str( main.numCtrls ) +\
                                " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         # No option point intents
         main.step( "NOOPTION: Add point intents between h1 and h9" )
@@ -1177,14 +1199,15 @@
 
         main.testName = "Single to Multi Point Intents"
         main.case( main.testName + " Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test single point to" +\
                                " multi point intents using " +\
                                str( main.numCtrls ) + " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         main.step( "NOOPTION: Install and test single point to multi point intents" )
         main.assertReturnString = "Assertion results for IPV4 single to multi point intent with no options set\n"
@@ -1382,14 +1405,15 @@
 
         main.testName = "Multi To Single Point Intents"
         main.case( main.testName + " Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test single point to" +\
                                " multi point intents using " +\
                                str( main.numCtrls ) + " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         main.step( "NOOPTION: Add multi point to single point intents" )
         main.assertReturnString = "Assertion results for NOOPTION multi to single point intent\n"
diff --git a/TestON/tests/FUNCintentRest/FUNCintentRest.params b/TestON/tests/FUNCintentRest/FUNCintentRest.params
index 07a5cff..7b29e9d 100644
--- a/TestON/tests/FUNCintentRest/FUNCintentRest.params
+++ b/TestON/tests/FUNCintentRest/FUNCintentRest.params
@@ -11,17 +11,18 @@
     # 14 - Discover all hosts and Create a dictionary of hosts information
     # 15 - Discover hosts with scapy arping ( only discovers scapy hosts )
     # 16 - Balance ownership of switches
-    # 17 - Stop Mininet
+    # 17 - Activate Flow Objectives
+    # 18 - Stop Mininet
     # 1000 - Test host intents
     # 2000 - Test point intents
     # 3000 - Test single to multi point intents
     # 4000 - Test multi to single point intents
     # 5000 - Test host mobility
 
-    <testcases>1,[2,10,12,13,15,16,1000,2000,5000,17]*2,[2,11,12,13,15,16,1000,2000,5000,17]*2</testcases>
+    <testcases>1,[2,10,12,13,15,16,1000,2000,5000,18]*2,[2,10,12,13,15,16,17,1000,2000,5000,18]*2,[2,11,12,13,15,16,1000,2000,5000,18]*2,[2,11,12,13,15,16,17,1000,2000,5000,18]*2</testcases>
 
     <SCALE>
-        <size>1,3,1,3</size>
+        <size>1,3,1,3,1,3,1,3</size>
     </SCALE>
 
     <DEPENDENCY>
diff --git a/TestON/tests/FUNCintentRest/FUNCintentRest.py b/TestON/tests/FUNCintentRest/FUNCintentRest.py
index 1a32bc1..8c6c8d5 100644
--- a/TestON/tests/FUNCintentRest/FUNCintentRest.py
+++ b/TestON/tests/FUNCintentRest/FUNCintentRest.py
@@ -154,6 +154,7 @@
 
         # main.scale[ 0 ] determines the current number of ONOS controller
         main.numCtrls = int( main.scale[ 0 ] )
+        main.flowCompiler = "Flow Rules"
 
         main.case( "Starting up " + str( main.numCtrls ) +
                    " node(s) ONOS cluster" )
@@ -671,6 +672,25 @@
 
     def CASE17( self, main ):
         """
+            Use Flow Objectives
+        """
+        main.case( "Enable intent compilation using Flow Objectives" )
+        main.step( "Enabling Flow Objectives" )
+
+        main.flowCompiler = "Flow Objectives"
+
+        cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"
+
+        stepResult = main.CLIs2[ 0 ].setCfg( component=cmd,
+                                            propName="useFlowObjectives", value="true" )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully activated Flow Objectives",
+                                 onfail="Failed to activate Flow Objectives" )
+
+    def CASE18( self, main ):
+        """
             Stop mininet and remove scapy hosts
         """
         main.log.report( "Stop Mininet and Scapy" )
@@ -743,13 +763,14 @@
         intentLeadersOld = main.CLIs2[ 0 ].leaderCandidates()
 
         main.case( "Host Intents Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case tests Host intents using " +\
                                 str( main.numCtrls ) + " node(s) cluster;\n" +\
                                 "Different type of hosts will be tested in " +\
                                 "each step such as IPV4, Dual stack, VLAN " +\
-                                "etc;\nThe test will use OF " + main.OFProtocol\
-                                + " OVS running in Mininet"
+                                "etc;\nThe test will use OF " + main.OFProtocol +\
+                                " OVS running in Mininet and compile intents" +\
+                                " using " + main.flowCompiler
 
         main.step( "IPV4: Add and test host intents between h1 and h9" )
         main.assertReturnString = "Assertion result for IPV4 host intent with mac addresses\n"
@@ -960,14 +981,15 @@
                                 main.numSwitch"
 
         main.case( "Point Intents Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test point to point" +\
                                " intents using " + str( main.numCtrls ) +\
                                " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         # No option point intents
         main.step( "NOOPTION: Add point intents between h1 and h9" )
@@ -1255,14 +1277,15 @@
                                 main.numSwitch"
 
         main.case( "Single To Multi Point Intents Test - " +
-                   str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol )
+                   str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test single point to" +\
                                " multi point intents using " +\
                                str( main.numCtrls ) + " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         main.step( "NOOPTION: Add single point to multi point intents" )
         stepResult = main.TRUE
@@ -1395,14 +1418,15 @@
                                 main.numSwitch"
 
         main.case( "Multi To Single Point Intents Test - " +
-                   str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol )
+                   str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test single point to" +\
                                " multi point intents using " +\
                                str( main.numCtrls ) + " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         main.step( "NOOPTION: Add multi point to single point intents" )
         stepResult = main.TRUE
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HAclusterRestart/HAclusterRestart.py
index 850a93f..f903f95 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.py
@@ -2533,7 +2533,7 @@
                 activeIps = []
                 currentResult = main.FALSE
                 for node in current:
-                    if node['state'] == 'ACTIVE':
+                    if node['state'] == 'READY':
                         activeIps.append( node['ip'] )
                 activeIps.sort()
                 if ips == activeIps:
diff --git a/TestON/tests/HAfullNetPartition/HAfullNetPartition.py b/TestON/tests/HAfullNetPartition/HAfullNetPartition.py
index 5c342f3..5a6de1a 100644
--- a/TestON/tests/HAfullNetPartition/HAfullNetPartition.py
+++ b/TestON/tests/HAfullNetPartition/HAfullNetPartition.py
@@ -2537,7 +2537,7 @@
                 activeIps = []
                 currentResult = main.FALSE
                 for node in current:
-                    if node['state'] == 'ACTIVE':
+                    if node['state'] == 'READY':
                         activeIps.append( node['ip'] )
                 activeIps.sort()
                 if ips == activeIps:
diff --git a/TestON/tests/HAkillNodes/HAkillNodes.py b/TestON/tests/HAkillNodes/HAkillNodes.py
index 16b8a8b..7654097 100644
--- a/TestON/tests/HAkillNodes/HAkillNodes.py
+++ b/TestON/tests/HAkillNodes/HAkillNodes.py
@@ -2547,7 +2547,7 @@
                 activeIps = []
                 currentResult = main.FALSE
                 for node in current:
-                    if node['state'] == 'ACTIVE':
+                    if node['state'] == 'READY':
                         activeIps.append( node['ip'] )
                 activeIps.sort()
                 if ips == activeIps:
diff --git a/TestON/tests/HAsanity/HAsanity.py b/TestON/tests/HAsanity/HAsanity.py
index 205e6d2..624b720 100644
--- a/TestON/tests/HAsanity/HAsanity.py
+++ b/TestON/tests/HAsanity/HAsanity.py
@@ -2434,7 +2434,7 @@
                 activeIps = []
                 currentResult = main.FALSE
                 for node in current:
-                    if node['state'] == 'ACTIVE':
+                    if node['state'] == 'READY':
                         activeIps.append( node['ip'] )
                 activeIps.sort()
                 if ips == activeIps:
diff --git a/TestON/tests/HAstopNodes/HAstopNodes.py b/TestON/tests/HAstopNodes/HAstopNodes.py
index 1ebf34a..21ec7f3 100644
--- a/TestON/tests/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HAstopNodes/HAstopNodes.py
@@ -2536,7 +2536,7 @@
                 activeIps = []
                 currentResult = main.FALSE
                 for node in current:
-                    if node['state'] == 'ACTIVE':
+                    if node['state'] == 'READY':
                         activeIps.append( node['ip'] )
                 activeIps.sort()
                 if ips == activeIps:
diff --git a/TestON/tests/PLATdockertest/PLATdockertest.py b/TestON/tests/PLATdockertest/PLATdockertest.py
index f56ae70..2e743f3 100755
--- a/TestON/tests/PLATdockertest/PLATdockertest.py
+++ b/TestON/tests/PLATdockertest/PLATdockertest.py
@@ -167,7 +167,7 @@
         main.log.debug("Rest call response: " + str(status) + " - " + response)
         if status == 200:
             jrsp = json.loads(response)
-            clusterIP = [item["ip"]for item in jrsp["nodes"] if item["status"]== "ACTIVE"]
+            clusterIP = [item["ip"]for item in jrsp["nodes"] if item["status"]== "READY"]
             main.log.debug(" IPlist is:" + ",".join(IPlist))
             main.log.debug("cluster IP is" + ",".join(clusterIP) )
             if set(IPlist) == set(clusterIP): stepResult = main.TRUE
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
index aef817d..3fccbe2 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
+++ b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
@@ -8,7 +8,7 @@
     </ENV>
 
     <CTRL>
-        <numCtrl>1</numCtrl>
+        <numCtrl>3</numCtrl>
         <ip1>OC1</ip1>
         <ip2>OC2</ip2>
         <ip3>OC3</ip3>
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
index 42b4bc8..7593368 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
+++ b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
@@ -10,7 +10,7 @@
             Start mininet
         """
         import imp
-        main.log.case( "Setup the Mininet testbed" )
+        main.case( "Setup the Mininet testbed" )
         main.dependencyPath = main.testDir + \
                               main.params[ 'DEPENDENCY' ][ 'path' ]
         main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
@@ -34,7 +34,6 @@
             sw = "sw%s" % ( i )
             swResult = swResult and main.Mininet.assignSwController( sw,
                                                  [ONOS1Ip, ONOS2Ip, ONOS3Ip] )
-
         utilities.assert_equals( expect=main.TRUE,
                                  actual=swResult,
                                  onpass="Successfully connect all switches to ONOS",
@@ -158,6 +157,7 @@
                                  onpass="ONOS CLIs are ready",
                                  onfail="ONOS CLIs are not ready" )
 
+        main.step( "Checking if ONOS CLI is ready for issuing commands" )
         for i in range( 10 ):
             ready = True
             for cli in main.CLIs:
@@ -181,16 +181,21 @@
         main.log.info( "waiting link discovery......" )
         time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
 
-        main.log.info( "Get links in the network" )
+        main.step( "Get links in the network" )
         summaryResult = main.ONOScli1.summary()
         linkNum = json.loads( summaryResult )[ "links" ]
-        listResult = main.ONOScli1.links( jsonFormat=False )
-        main.log.info( listResult )
+        main.log.info( "Expected 100 links, actual number is: {}".format( linkNum ) )
         if linkNum < 100:
-            main.log.error( "Link number is wrong!" )
+            main.log.error( "Link number is wrong! Retrying..." )
             time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
-            listResult = main.ONOScli1.links( jsonFormat=False )
-            main.log.info( listResult )
+            summaryResult = main.ONOScli1.summary()
+            linkNum = json.loads( summaryResult )[ "links" ]
+        main.log.info( "Expected 100 links, actual number is: {}".format( linkNum ) )
+        utilities.assert_equals( expect=100,
+                                 actual=linkNum,
+                                 onpass="ONOS correctly discovered all links",
+                                 onfail="ONOS Failed to discover all links" )
+        if linkNum < 100:
             main.cleanup()
             main.exit()
 
@@ -237,7 +242,7 @@
         ping test from 3 bgp peers to BGP speaker
         '''
 
-        main.case( "Ping tests between BGP peers and speakers" )
+        main.case( "Ping between BGP peers and speakers" )
         main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
                        peers=["peer64514", "peer64515", "peer64516"],
                        expectAllSuccess=True )
@@ -261,18 +266,17 @@
         bgpIntentsExpectedNum = int( main.params[ 'config' ][ 'peerNum' ] ) * 6 * 2
         if bgpIntentsActualNum != bgpIntentsExpectedNum:
             time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
             bgpIntentsActualNum = \
                 main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
         main.log.info( "bgpIntentsExpected num is:" )
         main.log.info( bgpIntentsExpectedNum )
         main.log.info( "bgpIntentsActual num is:" )
         main.log.info( bgpIntentsActualNum )
-        utilities.assertEquals( \
-            expect=True,
-            actual=eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
-            onpass="PointToPointIntent Intent Num is correct!",
-            onfail="PointToPointIntent Intent Num is wrong!" )
-
+        utilities.assert_equals( expect=bgpIntentsExpectedNum,
+                                 actual=bgpIntentsActualNum,
+                                 onpass="PointToPointIntent Intent Num is correct!",
+                                 onfail="PointToPointIntent Intent Num is wrong!" )
 
     def CASE3( self, main ):
         '''
@@ -281,6 +285,7 @@
         import time
         main.case( "Check routes and M2S intents to all BGP peers" )
 
+        main.step( "Check routes installed" )
         allRoutesExpected = []
         allRoutesExpected.append( "4.0.0.0/24" + "/" + "10.0.4.1" )
         allRoutesExpected.append( "5.0.0.0/24" + "/" + "10.0.5.1" )
@@ -297,15 +302,14 @@
                 main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
             allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
 
-        main.step( "Check routes installed" )
         main.log.info( "Routes expected:" )
         main.log.info( allRoutesStrExpected )
         main.log.info( "Routes get from ONOS CLI:" )
         main.log.info( allRoutesStrActual )
-        utilities.assertEquals( \
-            expect=allRoutesStrExpected, actual=allRoutesStrActual,
-            onpass="Routes are correct!",
-            onfail="Routes are wrong!" )
+        utilities.assert_equals( expect=allRoutesStrExpected,
+                                 actual=allRoutesStrActual,
+                                 onpass="Routes are correct!",
+                                 onfail="Routes are wrong!" )
 
         main.step( "Check M2S intents installed" )
         getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
@@ -314,6 +318,7 @@
         routeIntentsExpectedNum = 3
         if routeIntentsActualNum != routeIntentsExpectedNum:
             time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
             routeIntentsActualNum = \
                 main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
 
@@ -321,22 +326,20 @@
         main.log.info( routeIntentsExpectedNum )
         main.log.info( "MultiPointToSinglePoint Intent NUM Actual is:" )
         main.log.info( routeIntentsActualNum )
-        utilities.assertEquals( \
-            expect=routeIntentsExpectedNum,
-            actual=routeIntentsActualNum,
-            onpass="MultiPointToSinglePoint Intent Num is correct!",
-            onfail="MultiPointToSinglePoint Intent Num is wrong!" )
+        utilities.assert_equals( expect=routeIntentsExpectedNum,
+                                 actual=routeIntentsActualNum,
+                                 onpass="MultiPointToSinglePoint Intent Num is correct!",
+                                 onfail="MultiPointToSinglePoint Intent Num is wrong!" )
 
         main.step( "Check whether all flow status are ADDED" )
         flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
                                      main.FALSE,
                                      kwargs={'isPENDING':False},
                                      attempts=10 )
-        utilities.assertEquals( \
-            expect=main.TRUE,
-            actual=flowCheck,
-            onpass="Flow status is correct!",
-            onfail="Flow status is wrong!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
 
     def CASE4( self, main ):
@@ -358,10 +361,10 @@
         main.step( "Bring down the link between sw32 and peer64514" )
         linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
                                          OPTION="down" )
-        utilities.assertEquals( expect=main.TRUE,
-                                actual=linkResult1,
-                                onpass="Bring down link succeeded!",
-                                onfail="Bring down link failed!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult1,
+                                 onpass="Bring down link succeeded!",
+                                 onfail="Bring down link failed!" )
 
         if linkResult1 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -375,10 +378,10 @@
         main.step( "Bring down the link between sw8 and peer64515" )
         linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
                                          OPTION="down" )
-        utilities.assertEquals( expect=main.TRUE,
-                                actual=linkResult2,
-                                onpass="Bring down link succeeded!",
-                                onfail="Bring down link failed!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult2,
+                                 onpass="Bring down link succeeded!",
+                                 onfail="Bring down link failed!" )
         if linkResult2 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 1 )
@@ -391,10 +394,10 @@
         main.step( "Bring down the link between sw28 and peer64516" )
         linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
                                          OPTION="down" )
-        utilities.assertEquals( expect=main.TRUE,
-                                actual=linkResult3,
-                                onpass="Bring down link succeeded!",
-                                onfail="Bring down link failed!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult3,
+                                 onpass="Bring down link succeeded!",
+                                 onfail="Bring down link failed!" )
         if linkResult3 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 0 )
@@ -409,11 +412,10 @@
                                      main.FALSE,
                                      kwargs={'isPENDING':False},
                                      attempts=10 )
-        utilities.assertEquals( \
-            expect=main.TRUE,
-            actual=flowCheck,
-            onpass="Flow status is correct!",
-            onfail="Flow status is wrong!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
         # Ping test
         main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
@@ -423,7 +425,6 @@
                         hosts=["host64514", "host64515", "host64516"],
                         expectAllSuccess=False )
 
-
     def CASE6( self, main ):
         '''
         Recover links to peers one by one, check routes/intents
@@ -433,10 +434,10 @@
         main.step( "Bring up the link between sw32 and peer64514" )
         linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
                                          OPTION="up" )
-        utilities.assertEquals( expect=main.TRUE,
-                                actual=linkResult1,
-                                onpass="Bring up link succeeded!",
-                                onfail="Bring up link failed!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult1,
+                                 onpass="Bring up link succeeded!",
+                                 onfail="Bring up link failed!" )
         if linkResult1 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 1 )
@@ -449,10 +450,10 @@
         main.step( "Bring up the link between sw8 and peer64515" )
         linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
                                          OPTION="up" )
-        utilities.assertEquals( expect=main.TRUE,
-                                actual=linkResult2,
-                                onpass="Bring up link succeeded!",
-                                onfail="Bring up link failed!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult2,
+                                 onpass="Bring up link succeeded!",
+                                 onfail="Bring up link failed!" )
         if linkResult2 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 2 )
@@ -465,10 +466,10 @@
         main.step( "Bring up the link between sw28 and peer64516" )
         linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
                                          OPTION="up" )
-        utilities.assertEquals( expect=main.TRUE,
-                                actual=linkResult3,
-                                onpass="Bring up link succeeded!",
-                                onfail="Bring up link failed!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult3,
+                                 onpass="Bring up link succeeded!",
+                                 onfail="Bring up link failed!" )
         if linkResult3 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 3 )
@@ -483,11 +484,10 @@
                                      main.FALSE,
                                      kwargs={'isPENDING':False},
                                      attempts=10 )
-        utilities.assertEquals( \
-            expect=main.TRUE,
-            actual=flowCheck,
-            onpass="Flow status is correct!",
-            onfail="Flow status is wrong!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
         # Ping test
         main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
@@ -497,7 +497,6 @@
                         hosts=["host64514", "host64515", "host64516"],
                         expectAllSuccess=True )
 
-
     def CASE7( self, main ):
         '''
         Shut down a edge switch, check P-2-P and M-2-S intents, ping test
@@ -506,9 +505,9 @@
         main.case( "Stop edge sw32,check P-2-P and M-2-S intents, ping test" )
         main.step( "Stop sw32" )
         result = main.Mininet.switch( SW="sw32", OPTION="stop" )
-        utilities.assertEquals( expect=main.TRUE, actual=result,
-                                onpass="Stopping switch succeeded!",
-                                onfail="Stopping switch failed!" )
+        utilities.assert_equals( expect=main.TRUE, actual=result,
+                                 onpass="Stopping switch succeeded!",
+                                 onfail="Stopping switch failed!" )
 
         if result == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -571,12 +570,10 @@
                                      main.FALSE,
                                      kwargs={'isPENDING':False},
                                      attempts=10 )
-        utilities.assertEquals( \
-            expect=main.TRUE,
-            actual=flowCheck,
-            onpass="Flow status is correct!",
-            onfail="Flow status is wrong!" )
-
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
     def CASE8( self, main ):
         '''
@@ -587,18 +584,16 @@
         main.case( "Start the edge sw32, check P-2-P and M-2-S intents, ping test" )
         main.step( "Start sw32" )
         result1 = main.Mininet.switch( SW="sw32", OPTION="start" )
-        utilities.assertEquals( \
-            expect=main.TRUE,
-            actual=result1,
-            onpass="Starting switch succeeded!",
-            onfail="Starting switch failed!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=result1,
+                                 onpass="Starting switch succeeded!",
+                                 onfail="Starting switch failed!" )
 
         result2 = main.Mininet.assignSwController( "sw32", ONOS1Ip )
-        utilities.assertEquals( \
-            expect=main.TRUE,
-            actual=result2,
-            onpass="Connect switch to ONOS succeeded!",
-            onfail="Connect switch to ONOS failed!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=result2,
+                                 onpass="Connect switch to ONOS succeeded!",
+                                 onfail="Connect switch to ONOS failed!" )
 
         if result1 and result2:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -615,11 +610,10 @@
                                      main.FALSE,
                                      kwargs={'isPENDING':False},
                                      attempts=10 )
-        utilities.assertEquals( \
-            expect=main.TRUE,
-            actual=flowCheck,
-            onpass="Flow status is correct!",
-            onfail="Flow status is wrong!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
         # Ping test
         main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
@@ -632,7 +626,6 @@
                         hosts=["host64514", "host64515", "host64516"],
                         expectAllSuccess=True )
 
-
     def CASE9( self, main ):
         '''
         Bring down a switch in best path, check:
@@ -651,9 +644,9 @@
 
         main.step( "Stop sw11" )
         result = main.Mininet.switch( SW="sw11", OPTION="stop" )
-        utilities.assertEquals( expect=main.TRUE, actual=result,
-                                onpass="Stopping switch succeeded!",
-                                onfail="Stopping switch failed!" )
+        utilities.assert_equals( expect=main.TRUE, actual=result,
+                                 onpass="Stopping switch succeeded!",
+                                 onfail="Stopping switch failed!" )
         if result:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -670,11 +663,10 @@
                                      main.FALSE,
                                      kwargs={'isPENDING':False},
                                      attempts=10 )
-        utilities.assertEquals( \
-            expect=main.TRUE,
-            actual=flowCheck,
-            onpass="Flow status is correct!",
-            onfail="Flow status is wrong!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
         # Ping test
         main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
                        peers=["peer64514", "peer64515", "peer64516"],
@@ -703,13 +695,13 @@
 
         main.step( "Start sw11" )
         result1 = main.Mininet.switch( SW="sw11", OPTION="start" )
-        utilities.assertEquals( expect=main.TRUE, actual=result1,
-                                onpass="Starting switch succeeded!",
-                                onfail="Starting switch failed!" )
+        utilities.assert_equals( expect=main.TRUE, actual=result1,
+                                 onpass="Starting switch succeeded!",
+                                 onfail="Starting switch failed!" )
         result2 = main.Mininet.assignSwController( "sw11", ONOS1Ip )
-        utilities.assertEquals( expect=main.TRUE, actual=result2,
-                                onpass="Connect switch to ONOS succeeded!",
-                                onfail="Connect switch to ONOS failed!" )
+        utilities.assert_equals( expect=main.TRUE, actual=result2,
+                                 onpass="Connect switch to ONOS succeeded!",
+                                 onfail="Connect switch to ONOS failed!" )
         if result1 and result2:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 3 )
@@ -729,11 +721,10 @@
                                      main.FALSE,
                                      kwargs={'isPENDING':False},
                                      attempts=10 )
-        utilities.assertEquals( \
-            expect=main.TRUE,
-            actual=flowCheck,
-            onpass="Flow status is correct!",
-            onfail="Flow status is wrong!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
         # Ping test
         main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
                        peers=["peer64514", "peer64515", "peer64516"],
@@ -759,11 +750,10 @@
                                      main.FALSE,
                                      kwargs={'isPENDING':False},
                                      attempts=10 )
-        utilities.assertEquals( \
-            expect=main.TRUE,
-            actual=flowCheck,
-            onpass="Flow status is correct!",
-            onfail="Flow status is wrong!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
         main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
                        peers=["peer64514", "peer64515", "peer64516"],
@@ -810,11 +800,10 @@
                                      main.FALSE,
                                      kwargs={'isPENDING':False},
                                      attempts=10 )
-        utilities.assertEquals( \
-            expect=main.TRUE,
-            actual=flowCheck,
-            onpass="Flow status is correct!",
-            onfail="Flow status is wrong!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
         '''
         main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
@@ -871,11 +860,10 @@
                                          main.FALSE,
                                          kwargs={'isPENDING':False},
                                          attempts=10 )
-            utilities.assertEquals( \
-                expect=main.TRUE,
-                actual=flowCheck,
-                onpass="Flow status is correct!",
-                onfail="Flow status is wrong!" )
+            utilities.assert_equals( expect=main.TRUE,
+                                     actual=flowCheck,
+                                     onpass="Flow status is correct!",
+                                     onfail="Flow status is wrong!" )
         else:
             main.Functions.checkRouteNum( main, 3 )
             main.Functions.checkM2SintentNum( main, 3 )
@@ -886,11 +874,10 @@
                                          main.FALSE,
                                          kwargs={'isPENDING':False},
                                          attempts=10 )
-            utilities.assertEquals( \
-                expect=main.TRUE,
-                actual=flowCheck,
-                onpass="Flow status is correct!",
-                onfail="Flow status is wrong!" )
+            utilities.assert_equals( expect=main.TRUE,
+                                     actual=flowCheck,
+                                     onpass="Flow status is correct!",
+                                     onfail="Flow status is wrong!" )
 
         main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
                        peers=["peer64514", "peer64515", "peer64516"],
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo
index f3c9b5f..a10527a 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo
+++ b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo
@@ -26,6 +26,14 @@
             <connect_order>3</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOScli2>
+        <ONOScli3>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli3>
 
         <QuaggaCliSpeaker1>
             <host>127.0.0.1</host>
@@ -49,4 +57,3 @@
 
     </COMPONENT>
 </TOPOLOGY>
-
diff --git a/TestON/tests/USECASE_SegmentRouting/2x2.json b/TestON/tests/USECASE_SegmentRouting/2x2.json
index c6c2eb8..31b2cc8 100644
--- a/TestON/tests/USECASE_SegmentRouting/2x2.json
+++ b/TestON/tests/USECASE_SegmentRouting/2x2.json
@@ -76,25 +76,25 @@
         }
     },
     "hosts" : {
-        "00:00:00:00:00:01/4093" : {
+        "00:00:00:00:00:01/-1" : {
             "basic": {
                 "ips": ["10.0.1.1"],
                 "location": "of:0000000000000001/3"
             }
         },
-        "00:00:00:00:00:02/4093" : {
+        "00:00:00:00:00:02/-1" : {
             "basic": {
                 "ips": ["10.0.1.2"],
                 "location": "of:0000000000000001/4"
             }
         },
-        "00:00:00:00:00:03/4093" : {
+        "00:00:00:00:00:03/-1" : {
             "basic": {
                 "ips": ["10.0.2.1"],
                 "location": "of:0000000000000002/3"
             }
         },
-        "00:00:00:00:00:04/4093" : {
+        "00:00:00:00:00:04/-1" : {
             "basic": {
                 "ips": ["10.0.2.2"],
                 "location": "of:0000000000000002/4"
diff --git a/TestON/tests/USECASE_SegmentRouting/Dependency/cord_fabric.py b/TestON/tests/USECASE_SegmentRouting/Dependency/cord_fabric.py
index b710b12..a2a8a8e 100755
--- a/TestON/tests/USECASE_SegmentRouting/Dependency/cord_fabric.py
+++ b/TestON/tests/USECASE_SegmentRouting/Dependency/cord_fabric.py
@@ -39,7 +39,7 @@
         for s in range(spine):
             spines[s] = self.addSwitch('spine10%s' % (s + 1), dpid="00000000010%s" % (s + 1))
         # Set link speeds to 100Mb/s
-        linkopts = dict(bw=10)
+        linkopts = dict(bw=100)
 
         # Add Leaf switches
         for ls in range(leaf):
diff --git a/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.params b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.params
index 93c957f..dfa3d5f 100755
--- a/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.params
+++ b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.params
@@ -1,6 +1,6 @@
 <PARAMS>
 
-    <testcases>1,2,11,9</testcases>
+    <testcases>1,2,11,9, 2,11,9</testcases>
 
     <SCALE>
         <size>1</size>
@@ -15,7 +15,8 @@
 
     <ENV>
         <cellName>productionCell</cellName>
-        <cellApps>drivers,openflow-base,netcfghostprovider,netcfglinksprovider,segmentrouting,vrouter,hostprovider</cellApps>
+        <cellApps>drivers,segmentrouting</cellApps>
+        <diffApps>openflow-base,netcfghostprovider,netcfglinksprovider;openflow</diffApps>
         <cellUser>sdn</cellUser>
     </ENV>
 
@@ -29,7 +30,7 @@
     </CTRL>
 
     <SLEEP>
-        <startup>15</startup>
+        <startup>10</startup>
     </SLEEP>
 
 </PARAMS>
diff --git a/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.py b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.py
index 292f990..8635b79 100644
--- a/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.py
+++ b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.py
@@ -22,7 +22,7 @@
             - Build ONOS package
         """
 
-        main.case( "Constructing test variables and building ONOS package" )
+        main.case( "Constructing test variables and building ONOS" )
         main.step( "Constructing test variables" )
         stepResult = main.FALSE
 
@@ -30,10 +30,15 @@
         main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir )
         main.cellName = main.params[ 'ENV' ][ 'cellName' ]
         main.apps = main.params[ 'ENV' ][ 'cellApps' ]
+        main.diff = ( main.params[ 'ENV' ][ 'diffApps' ] ).split(";")
         gitBranch = main.params[ 'GIT' ][ 'branch' ]
         main.dependencyPath = main.testOnDirectory + \
                               main.params[ 'DEPENDENCY' ][ 'path' ]
         main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
+        #main.json = ["4x4"]
+        main.json = ["2x2", "2x2"]
+        main.args = [" ", " "]
+        #main.args = [" --spine 4 --leaf 4 "]
         main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
         main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
         main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
@@ -86,7 +91,7 @@
         else:
             main.log.warn( "Did not pull new code so skipping mvn " +
                            "clean install" )
-
+         
     def CASE2( self, main ):
         """
         - Set up cell
@@ -103,8 +108,7 @@
         # main.scale[ 0 ] determines the current number of ONOS controller
         main.numCtrls = int( main.scale[ 0 ] )
 
-        main.case( "Starting up " + str( main.numCtrls ) +
-                   " node(s) ONOS cluster" )
+        main.case( "Package and start ONOS")
 
         #kill off all onos processes
         main.log.info( "Safety check, killing all ONOS processes" +
@@ -118,14 +122,17 @@
         tempOnosIp = []
         for i in range( main.numCtrls ):
             tempOnosIp.append( main.ONOSip[i] )
-
+        apps=main.apps
+        if main.diff:
+            apps = main.apps+","+main.diff.pop(0)
+        else: main.log.error( "App list is empty" )
         onosUser = main.params[ 'ENV' ][ 'cellUser' ]
         main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
                                        "temp",
                                        main.Mininet1.ip_address,
-                                       main.apps,
+                                       apps,
                                        tempOnosIp,
-                                       onosUser)
+                                       main.ONOSbench.user_name)
 
         main.step( "Apply cell to environment" )
         cellResult = main.ONOSbench.setCell( "temp" )
@@ -138,7 +145,7 @@
                                  onfail="Failed to apply cell to environment " )
 
         main.step( "Creating ONOS package" )
-        main.ONOSbench.handle.sendline( "cp ~/OnosSystemTest/TestON/tests/USECASE_SegmentRouting/2x2.json ~/onos/tools/package/config/network-cfg.json")
+        main.ONOSbench.handle.sendline( "cp ~/OnosSystemTest/TestON/tests/USECASE_SegmentRouting/"+main.json.pop(0)+".json ~/onos/tools/package/config/network-cfg.json")
         packageResult = main.ONOSbench.onosPackage()
         stepResult = packageResult
         utilities.assert_equals( expect=main.TRUE,
@@ -147,6 +154,7 @@
                                  onfail="Failed to create ONOS package" )
 
         time.sleep( main.startUpSleep )
+
         main.step( "Installing ONOS package" )
         onosInstallResult = main.TRUE
         for i in range( main.numCtrls ):
@@ -181,12 +189,13 @@
                                  actual=stepResult,
                                  onpass="ONOS service is ready",
                                  onfail="ONOS service did not start properly" )
-        time.sleep( main.startUpSleep )
+        time.sleep( 2*main.startUpSleep )
 
     def CASE9( self, main ):
         '''
             Report errors/warnings/exceptions
         '''
+        main.log.case( "Logging test" )
         #main.ONOSbench.logReport( main.ONOSip[ 0 ],
         #                          [ "INFO" ],
         #                          "a" )
@@ -200,16 +209,23 @@
                                     "Except" ],
                                   "s" )
 
-
     def CASE11( self, main ):
         """
             Start mininet
         """
+        main.log.case( "Start Leaf-Spine 2x2 Mininet Topology" )
         main.log.report( "Start Mininet topology" )
-        main.log.case( "Start Mininet topology" )
 
         main.step( "Starting Mininet Topology" )
-        topoResult = main.Mininet1.startNet( topoFile= main.dependencyPath + main.topology, args="--onos 1" )
+        args,topo=" "," "
+        #if main.topology:
+        #    topo = main.topology.pop(0)
+        #else: main.log.error( "Topo list is empty" )
+        if main.args:
+            args = "--onos 1 " + main.args.pop(0)
+        else: main.log.error( "Argument list is empty" )
+
+        topoResult = main.Mininet1.startNet( topoFile= main.dependencyPath + main.topology, args=args )
         stepResult = topoResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
@@ -220,16 +236,14 @@
             main.cleanup()
             main.exit()
         main.step("Waiting for switch initialization and configuration")
-        time.sleep( main.startUpSleep )
+        time.sleep( 3*main.startUpSleep)
         pa = main.Mininet1.pingall()
         utilities.assert_equals( expect=main.TRUE, actual=pa,
                                  onpass="Full connectivity successfully tested",
                                  onfail="Full connectivity failed" )
         # cleanup mininet
-        main.CLIs[0].logout()
         main.ONOSbench.onosStop( main.ONOSip[0] )
         main.Mininet1.stopNet()
-        main.Mininet1.disconnect()