check_ethernet: add -W 1 to do_ping()

Adding "-W 1" since otherwise ping waits "2x the RTT" which in the
failure case (no RTT) appears to be ~3-4 seconds.
"ping -c9" to a non-responding IP takes ~12 seconds.

Higher levels try up to three different IPs resulting in up to
(3*12 = 36 seconds) to determine we don't have a link.
"ping -c 9 -W 1" takes 9 seconds (or 3*9 = 27 seconds total).

In the unlikely event a DUT has two live NICs (with link),
double the above numbers.

Since all three IPs are "local" (gateway, SSH client, or "neighbor"),
one second is > 100 times more than expected for ICMP RTT.

TEST=manually run ping command

Change-Id: I0b2b8a35b63108e94b4e12540ab58b81383e62e6
Reviewed-by: Brian Norris <>
Reviewed-by: Grant Grundler <>
Commit-Queue: Grant Grundler <>
Tested-by: Grant Grundler <>
diff --git a/recover_duts/hooks/check_ethernet.hook b/recover_duts/hooks/check_ethernet.hook
index f5758b9..a197d1c 100755
--- a/recover_duts/hooks/check_ethernet.hook
+++ b/recover_duts/hooks/check_ethernet.hook
@@ -77,7 +77,7 @@
   local eth
   for eth in $(search_devices 1); do
-    ping -q -I "${eth}" -c 9 "${ip_addr}" && return 0
+    ping -q -I "${eth}" -W 1 -c 9 "${ip_addr}" && return 0
   return 1