Update all HA tests with some of the recent changes

Change-Id: I63ad789df1b1ebb8686c690c05949fd3e1f1ac41
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HAclusterRestart/HAclusterRestart.py
index 1abca54..3026c1e 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.py
@@ -510,19 +510,22 @@
         # FIXME: Once we have a host discovery mechanism, use that instead
         # REACTIVE FWD test
         pingResult = main.FALSE
-        for i in range(2):  # Retry if pingall fails first time
-            time1 = time.time()
+        passMsg = "Reactive Pingall test passed"
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall()
+        time2 = time.time()
+        if not pingResult:
+            main.log.warn("First pingall failed. Trying again...")
             pingResult = main.Mininet1.pingall()
-            if i == 0:
-                utilities.assert_equals(
-                    expect=main.TRUE,
-                    actual=pingResult,
-                    onpass="Reactive Pingall test passed",
-                    onfail="Reactive Pingall failed, " +
-                           "one or more ping pairs failed" )
-            time2 = time.time()
-            main.log.info( "Time for pingall: %2f seconds" %
-                           ( time2 - time1 ) )
+            passMsg += " on the second try"
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=pingResult,
+            onpass= passMsg,
+            onfail="Reactive Pingall failed, " +
+                   "one or more ping pairs failed" )
+        main.log.info( "Time for pingall: %2f seconds" %
+                       ( time2 - time1 ) )
         # timeout for fwd flows
         time.sleep( 11 )
         # uninstall onos-app-fwd
@@ -2699,15 +2702,14 @@
         main.Mininet2.stopTcpdump()
 
         testname = main.TEST
-        main.log.error( main.params[ 'BACKUP' ][ 'ENABLED' ] )
         if main.params[ 'BACKUP' ][ 'ENABLED' ] == "True":
             main.step( "Copying MN pcap and ONOS log files to test station" )
             teststationUser = main.params[ 'BACKUP' ][ 'TESTONUSER' ]
             teststationIP = main.params[ 'BACKUP' ][ 'TESTONIP' ]
-            # 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
+            # NOTE: MN Pcap file is being saved to logdir.
+            #       We scp this file as MN and TestON aren't necessarily the same vm
+
+            # FIXME: To be replaced with a Jenkin's post script
             # TODO: Load these from params
             # NOTE: must end in /
             logFolder = "/opt/onos/log/"
@@ -2715,14 +2717,9 @@
             # NOTE: must end in /
             for f in logFiles:
                 for node in main.nodes:
-                    # scp sdn@<ip>:<file path> <test's log path>/<node name>-<orig filename>
-                    main.ONOSbench.handle.sendline( "scp sdn@" + node.ip_address +
-                                                    ":" + logFolder + f + " " +
-                                                    main.logdir + "/" +
-                                                    node.name + "-" + f )
-                    main.ONOSbench.handle.expect( "\$ " )
-                    print main.ONOSbench.handle.before
-
+                    dstName =  main.logdir + "/" + node.name + "-" + f
+                    main.ONOSbench.secureCopy( node.user_name, node.ip_address,
+                                               logFolder + f, dstName )
             # std*.log's
             # NOTE: must end in /
             logFolder = "/opt/onos/var/"
@@ -2730,17 +2727,9 @@
             # NOTE: must end in /
             for f in logFiles:
                 for node in main.nodes:
-                    # scp sdn@<ip>:<file path> <test's log path>/<node name>-<orig filename>
-                    main.ONOSbench.handle.sendline( "scp sdn@" + node.ip_address +
-                                                    ":" + logFolder + f + " " +
-                                                    main.logdir + "/" +
-                                                    node.name + "-" + f )
-                    main.ONOSbench.handle.expect( "\$ " )
-                    print main.ONOSbench.handle.before
-            # sleep so scp can finish
-            time.sleep( 10 )
-            # main.step( "Packing and rotating pcap archives" )
-            # os.system( "~/TestON/dependencies/rotate.sh " + str( testname ) )
+                    dstName =  main.logdir + "/" + node.name + "-" + f
+                    main.ONOSbench.secureCopy( node.user_name, node.ip_address,
+                                               logFolder + f, dstName )
         else:
             main.log.debug( "skipping saving log files" )