Updated ONOS and Cassandra drivers, test modified for compatability
diff --git a/TestON/drivers/common/cli/cassandraclidriver.py b/TestON/drivers/common/cli/cassandraclidriver.py
index d307f93..6a961ee 100644
--- a/TestON/drivers/common/cli/cassandraclidriver.py
+++ b/TestON/drivers/common/cli/cassandraclidriver.py
@@ -55,7 +55,7 @@
         
         self.ssh_handle = self.handle
         if self.handle :
-            self.start()
+            #self.start()
             return main.TRUE
         else :
             main.log.error("Connection failed to the host "+self.user_name+"@"+self.ip_address) 
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 3b9e86b..4861e05 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -76,7 +76,17 @@
         
         main.log.error("ONOS expect script missed something... ") 
         return main.FALSE
-    
+ 
+    def start_embedded(self):
+        self.handle.sendline("")
+        self.handle.expect("\$")
+        self.handle.sendline("~/ONOS/start-onos-embedded.sh start")
+        try:
+            self.handle.expect("start...")
+            main.log.info("Embedded ONOS started")
+        except:
+            main.log.info("Embedded ONOS failed to start")
+
     def link_down(self, **linkParams):
         '''
         Specifically used for the ONOS demo on the HW.
diff --git a/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.params b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.params
index fae2aed..2c95ef2 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,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,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>
     <FLOWDEF>~/flowdef_files/Center_Triangle/flowdef_20.txt</FLOWDEF>
     <CASE1>       
         <destination>h6</destination>
diff --git a/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.py b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.py
index 75f3d5f..763791d 100644
--- a/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.py
+++ b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.py
@@ -9,29 +9,11 @@
 #Tests the startup of Zookeeper1, Cassandra1, and ONOS1 to be certain that all started up successfully
     def CASE1(self,main) :  #Check to be sure ZK, Cass, and ONOS are up, then get ONOS version
         import time
-        main.log.report("Pulling latest code from github to all nodes")
+        main.log.report("Setting up fresh database")
         main.ONOS1.stop()
         main.ONOS2.stop()
         main.ONOS3.stop()
         main.ONOS4.stop()
-        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")   
         data =  main.Cassandra1.isup()
         if data == main.FALSE:
             main.Cassandra1.stop()
@@ -40,21 +22,46 @@
             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.ONOS1.drop_keyspace()
+        main.ONOS1.start()
+        main.ONOS2.start()
+        main.ONOS3.start()
+        main.ONOS4.start()
+        '''
+        For embedded ONOS
+        main.Cassandra1.stop()
+        main.Cassandra1.stop()
+        main.Cassandra1.stop()
+        main.Cassandra1.stop()
+        main.log.report("Starting embedded ONOS")
+        main.ONOS1.start_embedded()
+        time.sleep(30)
+        main.ONOS2.start_embedded()
+        main.ONOS3.start_embedded()
+        main.ONOS4.start_embedded()
+        '''
+        main.ONOS1.start_rest()
+        time.sleep(30)
+        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.step("Testing startup Cassandra")
+        data =  main.Cassandra1.isup()
+        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Cassandra is up!",onfail="Cassandra is down...")
+        data =  main.Zookeeper1.isup()
+        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...")
         main.step("Testing startup ONOS")   
         data = main.ONOS1.isup()
-        if data == main.FALSE: 
-            main.log.report("Something is funny... restarting ONOS")
-            main.ONOS1.stop()
-            time.sleep(3)
-            main.ONOS1.start()
-            time.sleep(5) 
-            data = main.ONOS1.isup()
         utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
            
 #**********************************************************************************************************************************************************************************************
@@ -113,7 +120,7 @@
         main.case("Checking flows")
         tmp = main.FALSE
         count = 1
-        main.log.info("Wait for flows to settle, then check")
+        main.log.info("Wait for flows to be pushed to the switches, then check")
         while tmp == main.FALSE:
             main.step("Waiting")
             time.sleep(10)
@@ -130,7 +137,7 @@
                 break
         endTime = time.time()
         if result1 == main.TRUE:
-            main.log.report("\n\t\t\t\tTime to add flows: "+str(round(endTime-strtTime,2))+" seconds")
+            main.log.report("\n\t\t\t\tTime to add flows: "+str(round(endTime-strtTime,2)))
         else:
             main.log.report("\tFlows failed check")
         
@@ -154,7 +161,7 @@
                 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.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2)))
         else:
             main.log.report("\tPING TEST FAIL")
 
@@ -169,17 +176,43 @@
 #If the ping test fails 6 times, then the test case will return false
 
     def CASE4(self,main) :
-        main.log.report("Remove ONOS 2,3,4 then ping until all hosts are reachable or fail after 6 attempts")
+        main.log.report("Remove all but one ONOS node then ping until all hosts are reachable or fail after 6 attempts")
         import time
+        import random
+
+        random.seed(None)
+
+        rand = random.randrange(4)
+
+        if rand == 0:
+            main.log.info("Controller 1 will be the lone coontroller")
+            ip = main.params['CTRL']['ip1']
+            port = main.params['CTRL']['port1']
+        elif rand == 1:
+            main.log.info("Controller 2 will be the lone controller")
+            ip = main.params['CTRL']['ip2']
+            port = main.params['CTRL']['port2']
+        elif rand == 2:
+            main.log.info("Controller 3 will be the lone controller")
+            ip = main.params['CTRL']['ip3']
+            port = main.params['CTRL']['port3']
+        elif rand == 3:
+            main.log.info("Controller 4 will be the lone controller")
+            ip = main.params['CTRL']['ip4']
+            port = main.params['CTRL']['port4']
+
         for i in range(25):
             if i < 15:
                 j=i+1
-                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])  #Assigning a single controller removes all other controllers
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=ip,port1=port)  #Assigning a single controller removes all other controllers
             else:
                 j=i+16
-                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=ip,port1=port)
        
         result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+ 
+        strtTime = time.time()
+
         for i in range(2):
             if result == main.FALSE:
                 time.sleep(5)
@@ -187,7 +220,6 @@
             else:
                 break
 
-        strtTime = time.time()
         count = 1
         i = 6
         while i < 16 :
@@ -207,7 +239,7 @@
                 result = main.TRUE
         endTime = time.time() 
         if result == main.TRUE:
-            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2)))
         else:
             main.log.report("\tPING TEST FAIL")
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
@@ -227,6 +259,9 @@
                 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'])
        
         result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+       
+        strtTime = time.time()
+
         for i in range(2):
             if result == main.FALSE:
                 time.sleep(5)
@@ -234,7 +269,6 @@
             else:
                 break
 
-        strtTime = time.time()
         count = 1
         i = 6
         while i < 16 :
@@ -254,7 +288,7 @@
                 result = main.TRUE
         endTime = time.time()
         if result == main.TRUE:
-            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2)))
         else:
             main.log.report("\tPING TEST FAILED")
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
@@ -263,13 +297,15 @@
 #Brings a link that all flows pass through in the mininet down, then runs a ping test to view reroute time
 
     def CASE6(self,main) :
-        main.log.report("Bring Link between s1 and s2 down, wait 15 seconds, then ping until all hosts are reachable or fail after 6 attempts")
+        main.log.report("Bring Link between s1 and s2 down, then ping until all hosts are reachable or fail after 10 attempts")
         import time
         main.case("Bringing Link down... ")
         result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="down")
         time.sleep(15)
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link DOWN!",onfail="Link not brought down...")
-        
+       
+        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):
             if result == main.FALSE:
@@ -278,18 +314,17 @@
             else:
                 break
 
-        strtTime = time.time()
         count = 1
         i = 6
         while i < 16 :
             main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) )
             ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+25))
-            if ping == main.FALSE and count < 6:
+            if ping == main.FALSE and count < 10:
                 count = count + 1
                 main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
                 i = 6
                 time.sleep(5)
-            elif ping == main.FALSE and count ==6:
+            elif ping == main.FALSE and count == 10:
                 main.log.error("Ping test failed")
                 i = 17
                 result = main.FALSE
@@ -298,7 +333,7 @@
                 result = main.TRUE
         endTime = time.time()
         if result == main.TRUE:
-            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2)))
         else:
             main.log.report("\tPING TEST FAILED")
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
@@ -307,13 +342,15 @@
 #Brings the link that Case 6 took down  back up, then runs a ping test to view reroute time
 
     def CASE7(self,main) :
-        main.log.report("Bring Link between s1 and s2 up, wait 15 seconds, then ping until all hosts are reachable or fail after 6 attempts")
+        main.log.report("Bring Link between s1 and s2 up, then ping until all hosts are reachable or fail after 10 attempts")
         import time
         main.case("Bringing Link up... ")
         result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="up")
         time.sleep(15)
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link UP!",onfail="Link not brought up...")
        
+        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):
             if result == main.FALSE:
@@ -328,12 +365,12 @@
         while i < 16 :
             main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) )
             ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+25))
-            if ping == main.FALSE and count < 6:
+            if ping == main.FALSE and count < 10:
                 count = count + 1
                 main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
                 i = 6
                 time.sleep(5)
-            elif ping == main.FALSE and count ==6:
+            elif ping == main.FALSE and count == 10:
                 main.log.error("Ping test failed")
                 i = 17
                 result = main.FALSE
@@ -342,7 +379,7 @@
                 result = main.TRUE
         endTime = time.time()
         if result == main.TRUE:
-            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2)))
         else:
             main.log.report("\tPING TESTS FAILED")
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
diff --git a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.params b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.params
index 995ecda..6634060 100644
--- a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.params
+++ b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.params
@@ -1,5 +1,5 @@
 <PARAMS>
-    <testcases>1,2,3,4,5,6,7,8,9,10,11</testcases>
+    <testcases>1,2,3,4,5,6,7,4,8,7,4,9,7</testcases>
     <Iterations>3</Iterations>
     <WaitTime>60</WaitTime>
     <RestIP>10.128.100.4</RestIP>
diff --git a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py
index f84b232..29eef45 100644
--- a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py
+++ b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py
@@ -14,10 +14,10 @@
         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.ONOS1.stop()
+        main.ONOS2.stop()
+        main.ONOS3.stop()
+        main.ONOS4.stop()
         main.step("Testing startup Zookeeper")
         main.ONOS1.get_version()
         data =  main.Zookeeper1.isup()
@@ -246,7 +246,7 @@
         '''
         import os
         import time
-        main.log.report("Process ping data")
+        main.log.report("Process ping data (Fail is time is >20 seconds)")
         main.case("Processing Ping data") 
         time.sleep(3) 
         #result=os.popen("/home/admin/tools/shell.sh " + main.params['Iterations']).read()
@@ -275,7 +275,7 @@
         main.log.report("Start continuous pings, then toggle multiple links in center triangle")
         import time
         import os
-
+        time.sleep(20)
         main.case("Starting long ping... ")
         main.Mininet4.pingLong(src=main.params['PING']['source1'],target=main.params['PING']['target1'])
         main.Mininet4.pingLong(src=main.params['PING']['source2'],target=main.params['PING']['target2'])
@@ -319,43 +319,20 @@
         main.case("Killing remote ping processes ")
         result =  result & main.Mininet4.pingKill()
         utilities.assert_equals(expect=main.TRUE,actual=result)
-
-    def CASE9(self,main) :
-        '''
-        Processes all of the ping data and outputs raw data and an overall average
-        '''
-        import os
-        import time
-        main.log.report("Process ping data")
-        main.case("Processing Ping data")
-        time.sleep(3)
-        #result=os.popen("/home/admin/tools/shell.sh " + main.params['Iterations']).read()
-        result=os.popen("/home/admin/get_reroute_times.py").read()
-        average=result.split(":")[1]
-        main.log.info( "Reroute times are... " )
-        main.log.report( result )
-        try:
-            if float(average) < float(main.params['TargetTime']) :
-                test=main.TRUE
-            else:
-                test=main.FALSE
-        except ValueError:
-            main.log.error("Data is corrupted")
-            test=main.FALSE
-        utilities.assert_equals(expect=main.TRUE,actual=test,onpass="Average is less then the target time!",onfail="Average is worse then target time... ")
-
-    def CASE10(self,main) :
-        '''
-        Starts continuous pings on the Mininet nodes
-        '''
         main.log.info("Make sure all links in triangle are up")
         main.Mininet1.link(END1="s1",END2="s2",OPTION="up")
         main.Mininet1.link(END1="s1",END2="s3",OPTION="up")
         main.Mininet1.link(END1="s2",END2="s3",OPTION="up")
+
+    def CASE9(self,main) :
+        '''
+        Starts continuous pings on the Mininet nodes
+        '''
         main.log.report("Start continuous pings, then toggle one link in center triangle and start/stop 1 ONOS node")
         import time
         import os
 
+        time.sleep(20)
         main.case("Starting long ping... ")
         main.Mininet4.pingLong(src=main.params['PING']['source1'],target=main.params['PING']['target1'])
         main.Mininet4.pingLong(src=main.params['PING']['source2'],target=main.params['PING']['target2'])
@@ -416,26 +393,3 @@
         result =  result & main.Mininet4.pingKill()
         utilities.assert_equals(expect=main.TRUE,actual=result)
 
-    def CASE11(self,main) :
-        '''
-        Processes all of the ping data and outputs raw data and an overall average
-        '''
-        import os
-        import time
-        main.log.report("Process ping data")
-        main.case("Processing Ping data")
-        time.sleep(3)
-        #result=os.popen("/home/admin/tools/shell.sh " + main.params['Iterations']).read()
-        result=os.popen("/home/admin/get_reroute_times.py").read()
-        average=result.split(":")[1]
-        main.log.info( "Reroute times are... " )
-        main.log.report( result )
-        try:
-            if float(average) < float(main.params['TargetTime']) :
-                test=main.TRUE
-            else:
-                test=main.FALSE
-        except ValueError:
-            main.log.error("Data is corrupted")
-            test=main.FALSE
-        utilities.assert_equals(expect=main.TRUE,actual=test,onpass="Average is less then the target time!",onfail="Average is worse then target time... ")
diff --git a/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.py b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.py
index bc0291b..1da2ac4 100644
--- a/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.py
+++ b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.py
@@ -14,6 +14,11 @@
         main.ONOS2.git_pull()
         main.ONOS3.git_pull()
         main.ONOS4.git_pull()
+        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)
@@ -113,7 +118,7 @@
         main.case("Checking flows")
         tmp = main.FALSE
         count = 1
-        main.log.info("Wait for flows to settle, then check")
+        main.log.info("Wait for flows to be pushed to the switches, then check")
         while tmp == main.FALSE:
             main.step("Waiting")
             time.sleep(10)
@@ -178,7 +183,8 @@
             else:
                 j=i+16
                 main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
-       
+      
+        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):
             if result == main.FALSE:
@@ -187,7 +193,6 @@
             else:
                 break
 
-        strtTime = time.time()
         count = 1
         i = 6
         while i < 16 :
@@ -225,7 +230,8 @@
             else:
                 j=i+16
                 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'])
-       
+      
+        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):
             if result == main.FALSE:
@@ -234,7 +240,6 @@
             else:
                 break
 
-        strtTime = time.time()
         count = 1
         i = 6
         while i < 16 :
@@ -263,13 +268,13 @@
 #Brings a link that all flows pass through in the mininet down, then runs a ping test to view reroute time
 
     def CASE6(self,main) :
-        main.log.report("Bring Link between s1 and s2 down, wait 15 seconds, then ping until all hosts are reachable or fail after 6 attempts")
+        main.log.report("Bring Link between s1 and s2 down, then ping until all hosts are reachable or fail after 10 attempts")
         import time
         main.case("Bringing Link down... ")
         result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="down")
-        time.sleep(15)
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link DOWN!",onfail="Link not brought down...")
-        
+       
+        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):
             if result == main.FALSE:
@@ -278,18 +283,17 @@
             else:
                 break
 
-        strtTime = time.time()
         count = 1
         i = 6
         while i < 16 :
             main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) )
             ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+25))
-            if ping == main.FALSE and count < 6:
+            if ping == main.FALSE and count < 10:
                 count = count + 1
                 main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
                 i = 6
                 time.sleep(5)
-            elif ping == main.FALSE and count ==6:
+            elif ping == main.FALSE and count == 10:
                 main.log.error("Ping test failed")
                 i = 17
                 result = main.FALSE
@@ -307,13 +311,13 @@
 #Brings the link that Case 6 took down  back up, then runs a ping test to view reroute time
 
     def CASE7(self,main) :
-        main.log.report("Bring Link between s1 and s2 up, wait 15 seconds, then ping until all hosts are reachable or fail after 6 attempts")
+        main.log.report("Bring Link between s1 and s2 up, then ping until all hosts are reachable or fail after 10 attempts")
         import time
         main.case("Bringing Link up... ")
         result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="up")
-        time.sleep(15)
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link UP!",onfail="Link not brought up...")
-       
+      
+        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):
             if result == main.FALSE:
@@ -328,12 +332,12 @@
         while i < 16 :
             main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) )
             ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+25))
-            if ping == main.FALSE and count < 6:
+            if ping == main.FALSE and count < 10:
                 count = count + 1
                 main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
                 i = 6
                 time.sleep(5)
-            elif ping == main.FALSE and count ==6:
+            elif ping == main.FALSE and count ==10:
                 main.log.error("Ping test failed")
                 i = 17
                 result = main.FALSE