Merge "Improve the SCPFscaleTopo Test     - The test result assert by verifing topology, not pingall result     - Remove retry function for pingall     - Tests topolgy start from 5x5 to 15x15"
diff --git a/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.params b/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.params
index b906804..2fa1aae 100755
--- a/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.params
+++ b/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.params
@@ -41,7 +41,8 @@
     </SLEEP>
 
     <TIMEOUT>
-        <pingall>2000</pingall>
+        # pingall timeout unit: ms
+        <pingall>0.03</pingall>
     </TIMEOUT>
 
     <ATTEMPTS>
@@ -51,7 +52,7 @@
 
     <TOPOLOGY>
         <topology>torus</topology>
-        <scale>3,5,10</scale>
+        <scale>5,10,15</scale>
     </TOPOLOGY>
 
 </PARAMS>
diff --git a/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py b/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py
index ae197a6..68b040f 100644
--- a/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py
+++ b/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py
@@ -47,7 +47,7 @@
         main.nodeSleep = int( main.params[ 'SLEEP' ][ 'nodeSleep' ] )
         main.pingallSleep = int( main.params[ 'SLEEP' ][ 'pingall' ] )
         main.MNSleep = int( main.params[ 'SLEEP' ][ 'MNsleep' ] )
-        main.pingTimeout = int( main.params[ 'TIMEOUT' ][ 'pingall' ] )
+        main.pingTimeout = float( main.params[ 'TIMEOUT' ][ 'pingall' ] )
         gitPull = main.params[ 'GIT' ][ 'pull' ]
         main.homeDir = os.path.expanduser('~')
         main.cellData = {} # for creating cell file
@@ -227,7 +227,7 @@
 
     def CASE10( self, main ):
         """
-            Starting up torus topology, pingall, and compare topo
+            Starting up torus topology
         """
         import json
 
@@ -270,28 +270,29 @@
     def CASE11( self, main ):
         """
             Pingall, and compare topo
+            We don't care the pingall result,
+            if the topology is same, then Pass.
         """
         import json
 
         main.case( "Verifying topology: TORUS %sx%s" % (main.currScale, main.currScale) )
-        main.caseExplanation = "Pinging all hosts andcomparing topology " +\
+        main.caseExplanation = "Pinging all hosts and comparing topology " +\
                 "elements between Mininet and ONOS"
 
-        main.step( "Pinging all hosts" )
-        pingResult = utilities.retry( main.Mininet1.pingall,
-                                      main.FALSE,
-                                      [main.pingTimeout],
-                                      sleep=main.pingallSleep,
-                                      attempts=main.pingallAttempts )
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=pingResult,
-                                 onpass="Pingall successfull",
-                                 onfail="Pingall failed" )
+        main.log.info( "Pinging all hosts" )
+
+        # the pingall timeout is depend on the number of total host
+        pingTimeout = int( main.pingTimeout * float( int(main.currScale) * int(main.currScale ) ) )
+        pingResult = main.Mininet1.pingall( pingTimeout )
 
         main.log.info( "Gathering topology information" )
+
+        time.sleep( main.MNSleep )
+
         devicesResults = main.TRUE
         linksResults = main.TRUE
         hostsResults = main.TRUE
+        stepResult = main.TRUE
         devices = main.topo.getAllDevices( main )
         hosts = main.topo.getAllHosts( main )
         ports = main.topo.getAllPorts( main )
@@ -314,25 +315,13 @@
                         json.loads( ports[ controller ] ) )
             else:
                 currentDevicesResult = main.FALSE
-            utilities.assert_equals( expect=main.TRUE,
-                                     actual=currentDevicesResult,
-                                     onpass="ONOS" + controllerStr +
-                                     " Switches view is correct",
-                                     onfail="ONOS" + controllerStr +
-                                     " Switches view is incorrect" )
-
+ 
             if links[ controller ] and "Error" not in links[ controller ]:
                 currentLinksResult = main.Mininet1.compareLinks(
                         mnSwitches, mnLinks,
                         json.loads( links[ controller ] ) )
             else:
                 currentLinksResult = main.FALSE
-            utilities.assert_equals( expect=main.TRUE,
-                                     actual=currentLinksResult,
-                                     onpass="ONOS" + controllerStr +
-                                     " links view is correct",
-                                     onfail="ONOS" + controllerStr +
-                                     " links view is incorrect" )
 
             if hosts[ controller ] or "Error" not in hosts[ controller ]:
                 currentHostsResult = main.Mininet1.compareHosts(
@@ -340,12 +329,14 @@
                         json.loads( hosts[ controller ] ) )
             else:
                 currentHostsResult = main.FALSE
+
+            stepResult = stepResult and currentDevicesResult and currentLinksResult and currentHostsResult
+
         utilities.assert_equals( expect=main.TRUE,
-                                 actual=currentHostsResult,
-                                 onpass="ONOS" + controllerStr +
-                                 " hosts exist in Mininet",
+                                 actual=stepResult,
+                                 onpass=" Topology match Mininet",
                                  onfail="ONOS" + controllerStr +
-                                 " hosts don't match Mininet" )
+                                 " Topology doesn't match Mininet" )
 
 
     def CASE100( self, main ):
@@ -401,7 +392,7 @@
 
             Balancing Masters
         '''
-
+        time.sleep(main.balanceSleep)
         main.step( "Balancing Masters" )
 
         stepResult = main.FALSE