Latest HA tests

    - better startup sequence
    - single node HA test
    - minor fixes to improve error handling
diff --git a/TestON/tests/HATestSanity/HATestSanity.py b/TestON/tests/HATestSanity/HATestSanity.py
index 03fcfe7..54e9d3f 100644
--- a/TestON/tests/HATestSanity/HATestSanity.py
+++ b/TestON/tests/HATestSanity/HATestSanity.py
@@ -83,15 +83,17 @@
         cell_result = main.ONOSbench.set_cell(cell_name)
         verify_result = main.ONOSbench.verify_cell()
 
-        main.ONOSbench.onos_stop(ONOS1_ip)
-        main.ONOSbench.onos_stop(ONOS2_ip)
-        main.ONOSbench.onos_stop(ONOS3_ip)
-        main.ONOSbench.onos_stop(ONOS4_ip)
-        main.ONOSbench.onos_stop(ONOS5_ip)
-        main.ONOSbench.onos_stop(ONOS6_ip)
-        main.ONOSbench.onos_stop(ONOS7_ip)
         #FIXME:this is short term fix 
+        main.log.report("Removing raft logs")
         main.ONOSbench.onos_remove_raft_logs()
+        main.log.report("Uninstalling ONOS")
+        main.ONOSbench.onos_uninstall(ONOS1_ip)
+        main.ONOSbench.onos_uninstall(ONOS2_ip)
+        main.ONOSbench.onos_uninstall(ONOS3_ip)
+        main.ONOSbench.onos_uninstall(ONOS4_ip)
+        main.ONOSbench.onos_uninstall(ONOS5_ip)
+        main.ONOSbench.onos_uninstall(ONOS6_ip)
+        main.ONOSbench.onos_uninstall(ONOS7_ip)
 
         clean_install_result = main.TRUE
         git_pull_result = main.TRUE
@@ -133,28 +135,52 @@
                 and onos3_install_result and onos4_install_result\
                 and onos5_install_result and onos6_install_result\
                 and onos7_install_result
+        '''
+        #FIXME: work around until onos is less fragile
+        main.ONOSbench.handle.sendline("onos-cluster-install")
+        print main.ONOSbench.handle.expect("\$")
+        onos_install_result = main.TRUE
+        '''
 
 
         main.step("Checking if ONOS is up yet")
+        #TODO: Refactor
+        # check bundle:list?
         onos1_isup = main.ONOSbench.isup(ONOS1_ip)
+        if not onos1_isup:
+            main.log.report("ONOS1 didn't start!")
         onos2_isup = main.ONOSbench.isup(ONOS2_ip)
+        if not onos2_isup:
+            main.log.report("ONOS2 didn't start!")
         onos3_isup = main.ONOSbench.isup(ONOS3_ip)
+        if not onos3_isup:
+            main.log.report("ONOS3 didn't start!")
         onos4_isup = main.ONOSbench.isup(ONOS4_ip)
+        if not onos4_isup:
+            main.log.report("ONOS4 didn't start!")
         onos5_isup = main.ONOSbench.isup(ONOS5_ip)
+        if not onos5_isup:
+            main.log.report("ONOS5 didn't start!")
         onos6_isup = main.ONOSbench.isup(ONOS6_ip)
+        if not onos6_isup:
+            main.log.report("ONOS6 didn't start!")
         onos7_isup = main.ONOSbench.isup(ONOS7_ip)
+        if not onos7_isup:
+            main.log.report("ONOS7 didn't start!")
         onos_isup_result = onos1_isup and onos2_isup and onos3_isup\
                 and onos4_isup and onos5_isup and onos6_isup and onos7_isup
         # TODO: if it becomes an issue, we can retry this step  a few times
 
 
-        main.ONOScli1.start_onos_cli(ONOS1_ip)
-        main.ONOScli2.start_onos_cli(ONOS2_ip)
-        main.ONOScli3.start_onos_cli(ONOS3_ip)
-        main.ONOScli4.start_onos_cli(ONOS4_ip)
-        main.ONOScli5.start_onos_cli(ONOS5_ip)
-        main.ONOScli6.start_onos_cli(ONOS6_ip)
-        main.ONOScli7.start_onos_cli(ONOS7_ip)
+        cli_result1 = main.ONOScli1.start_onos_cli(ONOS1_ip)
+        cli_result2 = main.ONOScli2.start_onos_cli(ONOS2_ip)
+        cli_result3 = main.ONOScli3.start_onos_cli(ONOS3_ip)
+        cli_result4 = main.ONOScli4.start_onos_cli(ONOS4_ip)
+        cli_result5 = main.ONOScli5.start_onos_cli(ONOS5_ip)
+        cli_result6 = main.ONOScli6.start_onos_cli(ONOS6_ip)
+        cli_result7 = main.ONOScli7.start_onos_cli(ONOS7_ip)
+        cli_results = cli_result1 and cli_result2 and cli_result3 and\
+                cli_result4 and cli_result5 and cli_result6 and cli_result7
 
         main.step("Start Packet Capture MN")
         main.Mininet2.start_tcpdump(
@@ -165,7 +191,7 @@
 
         case1_result = (clean_install_result and package_result and
                 cell_result and verify_result and onos_install_result and
-                onos_isup_result)
+                onos_isup_result and cli_results)
 
         utilities.assert_equals(expect=main.TRUE, actual=case1_result,
                 onpass="Test startup successful",
@@ -220,7 +246,7 @@
         mastership_check = main.TRUE
         for i in range (1,29):
             response = main.Mininet1.get_sw_controller("s"+str(i))
-            main.log.info(str(response))
+            main.log.info(repr(response))
             if re.search("tcp:"+ONOS1_ip,response)\
                     and re.search("tcp:"+ONOS2_ip,response)\
                     and re.search("tcp:"+ONOS3_ip,response)\
@@ -340,7 +366,23 @@
         ONOS6_mastership = main.ONOScli6.roles()
         ONOS7_mastership = main.ONOScli7.roles()
         #print json.dumps(json.loads(ONOS1_mastership), sort_keys=True, indent=4, separators=(',', ': '))
-        if ONOS1_mastership == ONOS2_mastership\
+        if "Error" in ONOS1_mastership or not ONOS1_mastership\
+                or "Error" in ONOS2_mastership or not ONOS2_mastership\
+                or "Error" in ONOS3_mastership or not ONOS3_mastership\
+                or "Error" in ONOS4_mastership or not ONOS4_mastership\
+                or "Error" in ONOS5_mastership or not ONOS5_mastership\
+                or "Error" in ONOS6_mastership or not ONOS6_mastership\
+                or "Error" in ONOS7_mastership or not ONOS7_mastership:
+                    main.log.report("Error in getting ONOS roles")
+                    main.log.warn("ONOS1 mastership response: " + repr(ONOS1_mastership))
+                    main.log.warn("ONOS2 mastership response: " + repr(ONOS2_mastership))
+                    main.log.warn("ONOS3 mastership response: " + repr(ONOS3_mastership))
+                    main.log.warn("ONOS4 mastership response: " + repr(ONOS4_mastership))
+                    main.log.warn("ONOS5 mastership response: " + repr(ONOS5_mastership))
+                    main.log.warn("ONOS6 mastership response: " + repr(ONOS6_mastership))
+                    main.log.warn("ONOS7 mastership response: " + repr(ONOS7_mastership))
+                    consistent_mastership = main.FALSE
+        elif ONOS1_mastership == ONOS2_mastership\
                 and ONOS1_mastership == ONOS3_mastership\
                 and ONOS1_mastership == ONOS4_mastership\
                 and ONOS1_mastership == ONOS5_mastership\
@@ -380,21 +422,21 @@
         ONOS6_intents = main.ONOScli6.intents( json_format=True )
         ONOS7_intents = main.ONOScli7.intents( json_format=True )
         intent_check = main.FALSE
-        if "Error" in ONOS1_intents\
-                or "Error" in ONOS2_intents\
-                or "Error" in ONOS3_intents\
-                or "Error" in ONOS4_intents\
-                or "Error" in ONOS5_intents\
-                or "Error" in ONOS6_intents\
-                or "Error" in ONOS7_intents:
-                    main.log.error("Error in getting ONOS intents")
-                    main.log.warn("ONOS1 intents response: " + str(ONOS1_intents))
-                    main.log.warn("ONOS2 intents response: " + str(ONOS2_intents))
-                    main.log.warn("ONOS3 intents response: " + str(ONOS3_intents))
-                    main.log.warn("ONOS4 intents response: " + str(ONOS4_intents))
-                    main.log.warn("ONOS5 intents response: " + str(ONOS5_intents))
-                    main.log.warn("ONOS6 intents response: " + str(ONOS6_intents))
-                    main.log.warn("ONOS7 intents response: " + str(ONOS7_intents))
+        if "Error" in ONOS1_intents or not ONOS1_intents\
+                or "Error" in ONOS2_intents or not ONOS2_intents\
+                or "Error" in ONOS3_intents or not ONOS3_intents\
+                or "Error" in ONOS4_intents or not ONOS4_intents\
+                or "Error" in ONOS5_intents or not ONOS5_intents\
+                or "Error" in ONOS6_intents or not ONOS6_intents\
+                or "Error" in ONOS7_intents or not ONOS7_intents:
+                    main.log.report("Error in getting ONOS intents")
+                    main.log.warn("ONOS1 intents response: " + repr(ONOS1_intents))
+                    main.log.warn("ONOS2 intents response: " + repr(ONOS2_intents))
+                    main.log.warn("ONOS3 intents response: " + repr(ONOS3_intents))
+                    main.log.warn("ONOS4 intents response: " + repr(ONOS4_intents))
+                    main.log.warn("ONOS5 intents response: " + repr(ONOS5_intents))
+                    main.log.warn("ONOS6 intents response: " + repr(ONOS6_intents))
+                    main.log.warn("ONOS7 intents response: " + repr(ONOS7_intents))
         elif ONOS1_intents == ONOS2_intents\
                 and ONOS1_intents == ONOS3_intents\
                 and ONOS1_intents == ONOS4_intents\
@@ -434,14 +476,14 @@
         ONOS6_flows = main.ONOScli6.flows( json_format=True )
         ONOS7_flows = main.ONOScli7.flows( json_format=True )
         flow_check = main.FALSE
-        if "Error" in ONOS1_flows\
-                or "Error" in ONOS2_flows\
-                or "Error" in ONOS3_flows\
-                or "Error" in ONOS4_flows\
-                or "Error" in ONOS5_flows\
-                or "Error" in ONOS6_flows\
-                or "Error" in ONOS7_flows:
-                    main.log.error("Error in getting ONOS intents")
+        if "Error" in ONOS1_flows or not ONOS1_flows\
+                or "Error" in ONOS2_flows or not ONOS2_flows\
+                or "Error" in ONOS3_flows or not ONOS3_flows\
+                or "Error" in ONOS4_flows or not ONOS4_flows\
+                or "Error" in ONOS5_flows or not ONOS5_flows\
+                or "Error" in ONOS6_flows or not ONOS6_flows\
+                or "Error" in ONOS7_flows or not ONOS7_flows:
+                    main.log.report("Error in getting ONOS intents")
                     main.log.warn("ONOS1 flows repsponse: "+ ONOS1_flows)
                     main.log.warn("ONOS2 flows repsponse: "+ ONOS2_flows)
                     main.log.warn("ONOS3 flows repsponse: "+ ONOS3_flows)
@@ -567,17 +609,26 @@
         ports_results = main.TRUE
         links_results = main.TRUE
         for controller in range(7): #TODO parameterize the number of controllers
-            current_devices_result =  main.Mininet1.compare_switches(MNTopo, json.loads(devices[controller]))
+            if devices[controller] or not "Error" in devices[controller]:
+                current_devices_result =  main.Mininet1.compare_switches(MNTopo, json.loads(devices[controller]))
+            else:
+                current_devices_result = main.FALSE
             utilities.assert_equals(expect=main.TRUE, actual=current_devices_result,
                     onpass="ONOS"+str(int(controller+1))+" Switches view is correct",
                     onfail="ONOS"+str(int(controller+1))+" Switches view is incorrect")
 
-            current_ports_result =  main.Mininet1.compare_ports(MNTopo, json.loads(ports[controller]))
+            if ports[controller] or not "Error" in ports[controller]:
+                current_ports_result =  main.Mininet1.compare_ports(MNTopo, json.loads(ports[controller]))
+            else:
+                current_ports_result = main.FALSE
             utilities.assert_equals(expect=main.TRUE, actual=current_ports_result,
                     onpass="ONOS"+str(int(controller+1))+" ports view is correct",
                     onfail="ONOS"+str(int(controller+1))+" ports view is incorrect")
 
-            current_links_result =  main.Mininet1.compare_links(MNTopo, json.loads(links[controller]))
+            if links[controller] or not "Error" in links[controller]:
+                current_links_result =  main.Mininet1.compare_links(MNTopo, json.loads(links[controller]))
+            else:
+                current_links_result = main.FALSE
             utilities.assert_equals(expect=main.TRUE, actual=current_links_result,
                     onpass="ONOS"+str(int(controller+1))+" links view is correct",
                     onfail="ONOS"+str(int(controller+1))+" links view is incorrect")
@@ -604,6 +655,7 @@
         The Failure case. Since this is the Sanity test, we do nothing.
         '''
         import time
+        main.log.report("Wait 60 seconds instead of inducing a failure")
         time.sleep(60)
         utilities.assert_equals(expect=main.TRUE, actual=main.TRUE,
                 onpass="Sleeping 60 seconds",
@@ -626,7 +678,23 @@
         ONOS6_mastership = main.ONOScli6.roles()
         ONOS7_mastership = main.ONOScli7.roles()
         #print json.dumps(json.loads(ONOS1_mastership), sort_keys=True, indent=4, separators=(',', ': '))
-        if ONOS1_mastership == ONOS2_mastership\
+        if "Error" in ONOS1_mastership or not ONOS1_mastership\
+                or "Error" in ONOS2_mastership or not ONOS2_mastership\
+                or "Error" in ONOS3_mastership or not ONOS3_mastership\
+                or "Error" in ONOS4_mastership or not ONOS4_mastership\
+                or "Error" in ONOS5_mastership or not ONOS5_mastership\
+                or "Error" in ONOS6_mastership or not ONOS6_mastership\
+                or "Error" in ONOS7_mastership or not ONOS7_mastership:
+                    main.log.error("Error in getting ONOS mastership")
+                    main.log.warn("ONOS1 mastership response: " + repr(ONOS1_mastership))
+                    main.log.warn("ONOS2 mastership response: " + repr(ONOS2_mastership))
+                    main.log.warn("ONOS3 mastership response: " + repr(ONOS3_mastership))
+                    main.log.warn("ONOS4 mastership response: " + repr(ONOS4_mastership))
+                    main.log.warn("ONOS5 mastership response: " + repr(ONOS5_mastership))
+                    main.log.warn("ONOS6 mastership response: " + repr(ONOS6_mastership))
+                    main.log.warn("ONOS7 mastership response: " + repr(ONOS7_mastership))
+                    consistent_mastership = main.FALSE
+        elif ONOS1_mastership == ONOS2_mastership\
                 and ONOS1_mastership == ONOS3_mastership\
                 and ONOS1_mastership == ONOS4_mastership\
                 and ONOS1_mastership == ONOS5_mastership\
@@ -690,28 +758,27 @@
         ONOS6_intents = main.ONOScli6.intents( json_format=True )
         ONOS7_intents = main.ONOScli7.intents( json_format=True )
         intent_check = main.FALSE
-        if "Error" in ONOS1_intents\
-                or "Error" in ONOS2_intents\
-                or "Error" in ONOS3_intents\
-                or "Error" in ONOS4_intents\
-                or "Error" in ONOS5_intents\
-                or "Error" in ONOS6_intents\
-                or "Error" in ONOS7_intents:
-                    main.log.error("Error in getting ONOS intents")
-                    main.log.warn("ONOS1 intents response: " + str(ONOS1_intents))
-                    main.log.warn("ONOS2 intents response: " + str(ONOS2_intents))
-                    main.log.warn("ONOS3 intents response: " + str(ONOS3_intents))
-                    main.log.warn("ONOS4 intents response: " + str(ONOS4_intents))
-                    main.log.warn("ONOS5 intents response: " + str(ONOS5_intents))
-                    main.log.warn("ONOS6 intents response: " + str(ONOS6_intents))
-                    main.log.warn("ONOS7 intents response: " + str(ONOS7_intents))
+        if "Error" in ONOS1_intents or not ONOS1_intents\
+                or "Error" in ONOS2_intents or not ONOS2_intents\
+                or "Error" in ONOS3_intents or not ONOS3_intents\
+                or "Error" in ONOS4_intents or not ONOS4_intents\
+                or "Error" in ONOS5_intents or not ONOS5_intents\
+                or "Error" in ONOS6_intents or not ONOS6_intents\
+                or "Error" in ONOS7_intents or not ONOS7_intents:
+                    main.log.report("Error in getting ONOS intents")
+                    main.log.warn("ONOS1 intents response: " + repr(ONOS1_intents))
+                    main.log.warn("ONOS2 intents response: " + repr(ONOS2_intents))
+                    main.log.warn("ONOS3 intents response: " + repr(ONOS3_intents))
+                    main.log.warn("ONOS4 intents response: " + repr(ONOS4_intents))
+                    main.log.warn("ONOS5 intents response: " + repr(ONOS5_intents))
+                    main.log.warn("ONOS6 intents response: " + repr(ONOS6_intents))
+                    main.log.warn("ONOS7 intents response: " + repr(ONOS7_intents))
         elif ONOS1_intents == ONOS2_intents\
                 and ONOS1_intents == ONOS3_intents\
                 and ONOS1_intents == ONOS4_intents\
                 and ONOS1_intents == ONOS5_intents\
                 and ONOS1_intents == ONOS6_intents\
                 and ONOS1_intents == ONOS7_intents:
-                    intent_state = ONOS1_intents
                     intent_check = main.TRUE
                     main.log.report("Intents are consistent across all ONOS nodes")
         else:
@@ -803,6 +870,7 @@
         sys.path.append("/home/admin/sts") # Trying to remove some dependancies, #FIXME add this path to params
         from sts.topology.teston_topology import TestONTopology # assumes that sts is already in you PYTHONPATH
         import json
+        import time
 
         description ="Compare ONOS Topology view to Mininet topology"
         main.case(description)
@@ -864,27 +932,49 @@
         devices_results = main.TRUE
         ports_results = main.TRUE
         links_results = main.TRUE
-        for controller in range(7): #TODO parameterize the number of controllers
-            current_devices_result =  main.Mininet1.compare_switches(MNTopo, json.loads(devices[controller]))
-            utilities.assert_equals(expect=main.TRUE, actual=current_devices_result,
-                    onpass="ONOS"+str(int(controller+1))+" Switches view is correct",
-                    onfail="ONOS"+str(int(controller+1))+" Switches view is incorrect")
+        topo_result = main.FALSE
+        start_time = time.time()
+        elapsed = 0
+        while topo_result == main.FALSE and elapsed < 120:
+            try:
+                for controller in range(7): #TODO parameterize the number of controllers
+                    if devices[controller] or not "Error" in devices[controller]:
+                        current_devices_result =  main.Mininet1.compare_switches(MNTopo, json.loads(devices[controller]))
+                    else:
+                        current_devices_result = main.FALSE
+                    utilities.assert_equals(expect=main.TRUE, actual=current_devices_result,
+                            onpass="ONOS"+str(int(controller+1))+" Switches view is correct",
+                            onfail="ONOS"+str(int(controller+1))+" Switches view is incorrect")
 
-            current_ports_result =  main.Mininet1.compare_ports(MNTopo, json.loads(ports[controller]))
-            utilities.assert_equals(expect=main.TRUE, actual=current_ports_result,
-                    onpass="ONOS"+str(int(controller+1))+" ports view is correct",
-                    onfail="ONOS"+str(int(controller+1))+" ports view is incorrect")
+                    if ports[controller] or not "Error" in ports[controller]:
+                        current_ports_result =  main.Mininet1.compare_ports(MNTopo, json.loads(ports[controller]))
+                    else:
+                        current_ports_result = main.FALSE
+                    utilities.assert_equals(expect=main.TRUE, actual=current_ports_result,
+                            onpass="ONOS"+str(int(controller+1))+" ports view is correct",
+                            onfail="ONOS"+str(int(controller+1))+" ports view is incorrect")
 
-            current_links_result =  main.Mininet1.compare_links(MNTopo, json.loads(links[controller]))
-            utilities.assert_equals(expect=main.TRUE, actual=current_links_result,
-                    onpass="ONOS"+str(int(controller+1))+" links view is correct",
-                    onfail="ONOS"+str(int(controller+1))+" links view is incorrect")
+                    if links[controller] or not "Error" in links[controller]:
+                        current_links_result =  main.Mininet1.compare_links(MNTopo, json.loads(links[controller]))
+                    else:
+                        current_links_result = main.FALSE
+                    utilities.assert_equals(expect=main.TRUE, actual=current_links_result,
+                            onpass="ONOS"+str(int(controller+1))+" links view is correct",
+                            onfail="ONOS"+str(int(controller+1))+" links view is incorrect")
+            except:
+                main.log.error("something went wrong in topo comparison")
+                main.log.warn( repr( devices ) )
+                main.log.warn( repr( ports ) )
+                main.log.warn( repr( links ) )
 
             devices_results = devices_results and current_devices_result
             ports_results = ports_results and current_ports_result
             links_results = links_results and current_links_result
-
-        topo_result = devices_results and ports_results and links_results
+            elapsed = time.time()-start_time()
+        time_threshold = elapsed < 1
+        topo_result = devices_results and ports_results and links_results and time_threshold
+        #TODO make sure this step is non-blocking. IE add a timeout
+        main.log.report("Very crass estimate for topology discovery/convergence: " + str(elapsed) + " seconds")
         utilities.assert_equals(expect=main.TRUE, actual=topo_result,
                 onpass="Topology Check Test successful",
                 onfail="Topology Check Test NOT successful")
@@ -996,44 +1086,72 @@
         '''
         Clean up
         '''
+        import os
+        import time
         description = "Test Cleanup"
         main.log.report(description)
         main.case(description)
         main.step("Killing tcpdumps")
         main.Mininet2.stop_tcpdump()
 
-        #TODO: Enable once test is ready
-        '''
-        main.step("Copying pcap files to test station")
+        main.step("Copying MN pcap and ONOS log files to test station")
         testname = main.TEST
-        #FIXME: Do the mininet pcap get archived?
-        #FIXME: also, make sure karaf logs are saved
+        #NOTE: MN Pcap file is being saved to ~/packet_captures
+        #       scp this file as MN and TestON aren't necessarily the same vm
+        #FIXME: scp
+        #####mn files
+        #TODO: Load these from params
+        #NOTE: must end in /
+        log_folder = "/opt/onos/log/"
+        log_files = ["karaf.log", "karaf.log.1"]
+        #NOTE: must end in /
+        dst_dir = "~/packet_captures/"
+        for f in log_files:
+            main.ONOSbench.secureCopy( "sdn", ONOS1_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS1-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS2_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS2-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS3_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS3-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS4_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS4-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS5_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS5-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS6_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS6-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS7_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS7-"+f )
+
+        #std*.log's
+        #NOTE: must end in /
+        log_folder = "/opt/onos/var/"
+        log_files = ["stderr.log", "stdout.log"]
+        #NOTE: must end in /
+        dst_dir = "~/packet_captures/"
+        for f in log_files:
+            main.ONOSbench.secureCopy( "sdn", ONOS1_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS1-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS2_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS2-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS3_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS3-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS4_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS4-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS5_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS5-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS6_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS6-"+f )
+            main.ONOSbench.secureCopy( "sdn", ONOS7_ip,log_folder+f,"rocks",\
+                    dst_dir + str(testname) + "-ONOS7-"+f )
+
+
+
 
         #sleep so scp can finish
         time.sleep(10)
         main.step("Packing and rotating pcap archives")
-        import os
         os.system("~/TestON/dependencies/rotate.sh "+ str(testname))
-        '''
 
-        import time
-
-        #Stopping ONOS
-        main.step("Stopping ONOS")
-        main.ONOScli1.disconnect()
-        main.ONOScli2.disconnect()
-        main.ONOScli3.disconnect()
-        main.ONOScli4.disconnect()
-        main.ONOScli5.disconnect()
-        main.ONOScli6.disconnect()
-        main.ONOScli7.disconnect()
-        main.ONOSbench.onos_stop(ONOS1_ip)
-        main.ONOSbench.onos_stop(ONOS2_ip)
-        main.ONOSbench.onos_stop(ONOS3_ip)
-        main.ONOSbench.onos_stop(ONOS4_ip)
-        main.ONOSbench.onos_stop(ONOS5_ip)
-        main.ONOSbench.onos_stop(ONOS6_ip)
-        main.ONOSbench.onos_stop(ONOS7_ip)
 
         #TODO: actually check something here
         utilities.assert_equals(expect=main.TRUE, actual=main.TRUE,