Simple script changes
diff --git a/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.params b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.params
index 2c95ef2..ebaf5d7 100644
--- a/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.params
+++ b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.params
@@ -1,5 +1,5 @@
 <PARAMS>
-    <testcases>1,2,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7 </testcases>
+    <testcases>1,2,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,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20.txt</FLOWDEF>
     <CASE1>       
         <destination>h6</destination>
diff --git a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py
index 29eef45..db0c60b 100644
--- a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py
+++ b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py
@@ -12,14 +12,30 @@
         The test will only pass if ONOS is running properly, and has a full view of all topology elements.
         '''
         import time
-        main.log.report("Checking if the startup was clean") 
-        main.case("Checking if the startup was clean...")
         main.ONOS1.stop()
         main.ONOS2.stop()
         main.ONOS3.stop()
         main.ONOS4.stop()
-        main.step("Testing startup Zookeeper")
+        main.Cassandra1.start()
+        main.Cassandra2.start()
+        main.Cassandra3.start()
+        main.Cassandra4.start()
+        time.sleep(20)
+        main.ONOS1.drop_keyspace()
+        main.ONOS1.start()
+        time.sleep(10)
+        main.ONOS2.start()
+        main.ONOS3.start()
+        main.ONOS4.start()
+        main.ONOS1.start_rest()
+        time.sleep(5)
+        test= main.ONOS1.rest_status()
+        if test == main.FALSE:
+            main.ONOS1.start_rest()
         main.ONOS1.get_version()
+        main.log.report("Startup check Zookeeper1, Cassandra1, and ONOS1 connections")
+        main.case("Checking if the startup was clean...")
+        main.step("Testing startup Zookeeper")
         data =  main.Zookeeper1.isup()
         utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...")
         main.step("Testing startup Cassandra")
@@ -37,33 +53,25 @@
             main.Cassandra3.start()
             main.Cassandra4.start()
         utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Cassandra is up!",onfail="Cassandra is down...")
-        main.ONOS1.drop_keyspace()
-        time.sleep(5) 
-        main.ONOS1.start()
-        time.sleep(5)
-        main.ONOS2.start()
-        main.ONOS3.start()
-        main.ONOS4.start()
         main.step("Testing startup ONOS")
         data = main.ONOS1.isup()
+        data = data and main.ONOS2.isup()
+        data = data and main.ONOS3.isup()
+        data = data and main.ONOS4.isup()
         if data == main.FALSE:
-            main.log.info("Something is funny... restarting ONOS")
+            main.log.report("Something is funny... restarting ONOS")
             main.ONOS1.stop()
-            time.sleep(3)
-            main.ONOS1.start()
+            main.ONOS2.stop()
+            main.ONOS3.stop()
+            main.ONOS4.stop()
             time.sleep(5)
+            main.ONOS1.start()
+            time.sleep(10)
+            main.ONOS2.start()
+            main.ONOS3.start()
+            main.ONOS4.start()
             data = main.ONOS1.isup()
-        data = data & main.ONOS2.isup()
-        data = data & main.ONOS3.isup()
-        data = data & main.ONOS4.isup()
-        main.ONOS1.start_rest()
-        time.sleep(5)
-        test= main.ONOS1.rest_status()
-        if test == main.FALSE:
-            main.ONOS1.start_rest()
-        #topoview = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
-
-        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running ",onfail="ONOS didn't start ...")
+        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
 
     def CASE2(self,main) :
         '''
@@ -107,6 +115,7 @@
                 time.sleep(1)
                 main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
         main.Mininet1.get_sw_controller("s1")
+        time.sleep(5)        
 
     def CASE3(self,main) :
         '''
@@ -116,7 +125,7 @@
         main.log.report("checking if ONOS sees the right topo...") 
         main.case("TOPO check")
         main.step("calling rest calls") 
-        for i in range(9):
+        for i in range(4):
             result = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
             time.sleep(5)
             if result == 1:
@@ -126,7 +135,7 @@
             main.ONOS2.start()
             main.ONOS3.start()
             main.ONOS4.start()
-            for i in range(9):
+            for i in range(4):
                 result = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
                 time.sleep(5)
                 if result == 1:
@@ -185,6 +194,14 @@
 
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="flows are good",onfail="FLOWS not correct") 
 
+        main.log.report("checking if ONOS sees the right topo...")
+        main.case("TOPO check")
+        main.step("calling rest calls")
+        for i in range(3):
+            result = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            time.sleep(5)
+            if result == 1:
+                break
 
     def CASE5(self,main) :
         '''
diff --git a/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.py b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.py
index 1da2ac4..10cdc58 100644
--- a/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.py
+++ b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.py
@@ -100,6 +100,13 @@
                 time.sleep(1)
                 main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
         main.Mininet1.get_sw_controller("s1")       
+
+        for i in range(9):
+            if result == main.FALSE:
+                time.sleep(3)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break 
  
 # **********************************************************************************************************************************************************************************************
 #Add Flows
@@ -109,6 +116,15 @@
     def CASE3(self,main) :    #Delete any remnant flows, then add flows, and time how long it takes flow tables to update
         main.log.report("Delete any flows from previous tests, then add flows from FLOWDEF file, then wait for switch flow tables to update")
         import time
+
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        for i in range(9):
+            if result == main.FALSE:
+                time.sleep(3)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break
+
         main.case("Taking care of these flows!") 
         main.step("Cleaning out any leftover flows...")
         main.ONOS1.delete_flow("all")
@@ -121,7 +137,7 @@
         main.log.info("Wait for flows to be pushed to the switches, then check")
         while tmp == main.FALSE:
             main.step("Waiting")
-            time.sleep(10)
+            time.sleep(5)
             main.step("Checking")
             tmp = main.ONOS1.check_flow()
             if tmp == main.FALSE and count < 6:
@@ -139,7 +155,6 @@
         else:
             main.log.report("\tFlows failed check")
         
-        strtTime = time.time()
         count = 1
         i = 6
         while i < 16 :
@@ -157,15 +172,13 @@
             elif ping == main.TRUE:
                 i = i + 1
                 result2 = main.TRUE
-        endTime = time.time()
         if result2 == main.TRUE:
-            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+            main.log.info("Flows successfully added")
         else:
             main.log.report("\tPING TEST FAIL")
 
-        result3 = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
         main.step("Verifying the result")
-        utilities.assert_equals(expect=main.TRUE,actual=result1 and result2 and result3,onpass="Flow check PASS",onfail="Flow check FAIL")
+        utilities.assert_equals(expect=main.TRUE,actual=result1 and result2,onpass="Flow check PASS",onfail="Flow check FAIL")
 
 #**********************************************************************************************************************************************************************************************
 #This test case removes Controllers 2,3, and 4 then performs a ping test.
@@ -186,9 +199,9 @@
       
         strtTime = time.time() 
         result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
-        for i in range(2):
+        for i in range(9):
             if result == main.FALSE:
-                time.sleep(5)
+                time.sleep(3)
                 result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
             else:
                 break
@@ -233,9 +246,9 @@
       
         strtTime = time.time() 
         result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
-        for i in range(2):
+        for i in range(9):
             if result == main.FALSE:
-                time.sleep(5)
+                time.sleep(3)
                 result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
             else:
                 break
@@ -276,9 +289,9 @@
        
         strtTime = time.time() 
         result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],str(int(main.params['NR_Links'])-2))
-        for i in range(2):
+        for i in range(9):
             if result == main.FALSE:
-                time.sleep(5)
+                time.sleep(3)
                 result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],str(int(main.params['NR_Links'])-2))
             else:
                 break
@@ -319,9 +332,9 @@
       
         strtTime = time.time() 
         result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
-        for i in range(2):
+        for i in range(9):
             if result == main.FALSE:
-                time.sleep(5)
+                time.sleep(3)
                 result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
             else:
                 break
@@ -374,11 +387,18 @@
         Reststatus, Hoststatus = restcall.find_host(RestIP1,RestPort,url,mac)
         try:
             attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
-        except IndexError:
+            ip_found = Hoststatus[0]['ipv4'][0]
+        except:
             Reststatus = 0
+
         if Reststatus == 1:
             main.log.report("\tFound host " + host + " attached to switchDPID = " + attachedSW)
-            result = main.TRUE
+            if ip_found != None:
+                main.log.report("\t IP discovered is ip_found ( " + ip_found + " ).")
+                result = main.TRUE
+            else:
+                main.log.report("\t Found host attached to switch, but no IP address discovered.")
+                result = main.FALSE
         else:
             main.log.report("\t Host " + host + " with MAC:" + str(mac) + " does not exist. FAILED")
             result = main.FALSE
@@ -394,7 +414,7 @@
         Reststatus, Hoststatus = restcall.find_host(RestIP1,RestPort,url,mac)
         try:
             attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
-        except IndexError:
+        except:
             Reststatus = 0
         if Reststatus == 0:
             main.log.report("Attempt to yank out s1-eth1 from s1 sucessfully")
@@ -413,14 +433,20 @@
         Reststatus, Hoststatus = restcall.find_host(RestIP2,RestPort,url,mac)
         try:
             attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
-        except IndexError:
+            ip_found = Hoststatus[0]['ipv4'][0]
+        except:
             Reststatus = 0
         if Reststatus == 0:
             main.log.report("Attempt to plug s1-eth1 to s6 FAILED")
             result = main.FALSE
         elif attachedSW == "00:00:00:00:00:00:00:06":
             main.log.report("Attempt to plug s1-eht1 to s6 succeded.")
-            result = main.TRUE
+            if ip_found != None:
+                main.log.report("\t IP discovered is ip_found ( " + ip_found + " ).")
+                result = main.TRUE
+            else:
+                main.log.report("\t Found host attached to switch, but no IP address discovered.")
+                result = main.FALSE
         else:
             main.log.report( "FAILED to attach s1-eth1 to s6 correctly!")
             result = main.FALSE
@@ -436,14 +462,20 @@
         Reststatus, Hoststatus = restcall.find_host(RestIP1,RestPort,url,mac)
         try:
             attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
-        except IndexError:
+            ip_found = Hoststatus[0]['ipv4'][0]
+        except:
             Reststatus = 0
         if Reststatus == 0:
             main.log.report("Attempt to plug s1-eth1 back to s1 FAILED")
             result = main.FALSE
         elif attachedSW == "00:00:00:00:00:00:00:01":
             main.log.report("Attempt to plug s1-eht1 back to s1 succeded.")
-            result = main.TRUE
+            if ip_found != None:
+                main.log.report("\t IP discovered is ip_found ( " + ip_found + " ).")
+                result = main.TRUE
+            else:
+                main.log.report("\t Found host attached to switch, but no IP address discovered.")
+                result = main.FALSE
         else:
             main.log.report( "FAIL to attach s1-eth1 to s1 correctly!")
             result = main.FALSE
@@ -451,3 +483,5 @@
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="DEVICE DISCOVERY TEST PASSED PLUG/UNPLUG/MOVE TEST",onfail="DEVICE DISCOVERY TEST FAILED")
 
 
+
+
diff --git a/TestON/tests/OnosScale4nodes/OnosScale4nodes.py b/TestON/tests/OnosScale4nodes/OnosScale4nodes.py
index 06778da..29b56e2 100644
--- a/TestON/tests/OnosScale4nodes/OnosScale4nodes.py
+++ b/TestON/tests/OnosScale4nodes/OnosScale4nodes.py
@@ -12,10 +12,30 @@
         The test will only pass if ONOS is running properly, and has a full view of all topology elements.
         '''
         import time
-        main.log.report("Checking is startup was clean")
+        main.ONOS1.stop()
+        main.ONOS2.stop()
+        main.ONOS3.stop()
+        main.ONOS4.stop()
+        main.Cassandra1.start()
+        main.Cassandra2.start()
+        main.Cassandra3.start()
+        main.Cassandra4.start()
+        time.sleep(20)
+        main.ONOS1.drop_keyspace()
+        main.ONOS1.start()
+        time.sleep(10)
+        main.ONOS2.start()
+        main.ONOS3.start()
+        main.ONOS4.start()
+        main.ONOS1.start_rest()
+        time.sleep(5)
+        test= main.ONOS1.rest_status()
+        if test == main.FALSE:
+            main.ONOS1.start_rest()
+        main.ONOS1.get_version()
+        main.log.report("Startup check Zookeeper1, Cassandra1, and ONOS1 connections")
         main.case("Checking if the startup was clean...")
         main.step("Testing startup Zookeeper")
-        main.ONOS1.get_version()
         data =  main.Zookeeper1.isup()
         utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...")
         main.step("Testing startup Cassandra")
@@ -27,38 +47,31 @@
             main.Cassandra4.stop()
 
             time.sleep(5)
- 
+
             main.Cassandra1.start()
             main.Cassandra2.start()
             main.Cassandra3.start()
             main.Cassandra4.start()
         utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Cassandra is up!",onfail="Cassandra is down...")
         main.step("Testing startup ONOS")
-        main.ONOS1.start()
-        main.ONOS2.start()
-        main.ONOS2.start_rest()
-        time.sleep(5)
-        test= main.ONOS2.rest_status()
-        if test == main.FALSE:
-            main.ONOS2.start_rest()
-        main.ONOS3.start()
-        main.ONOS4.start()
         data = main.ONOS1.isup()
+        data = data and main.ONOS2.isup()
+        data = data and main.ONOS3.isup()
+        data = data and main.ONOS4.isup()
         if data == main.FALSE:
-            main.log.info("Something is funny... restarting ONOS")
+            main.log.report("Something is funny... restarting ONOS")
             main.ONOS1.stop()
-            time.sleep(3)
-            main.ONOS1.start()
+            main.ONOS2.stop()
+            main.ONOS3.stop()
+            main.ONOS4.stop()
             time.sleep(5)
+            main.ONOS1.start()
+            time.sleep(10)
+            main.ONOS2.start()
+            main.ONOS3.start()
+            main.ONOS4.start()
             data = main.ONOS1.isup()
-        #topoview = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
-        topoview = main.TRUE
-        if topoview == main.TRUE & data == main.TRUE :
-            data = main.TRUE
-        else:
-            data = main.FALSE
-
-        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running and has full view of topology",onfail="ONOS didn't start or has fragmented view of topology...")
+        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
 
     def CASE2(self,main) :
         '''