Updates recover_duts' check_ethernet hook to match additional
interfaces.
BUG=chrome-os-partner:43509
TEST=Applied to DUT. Verified shill is no longer flapping.
Verified DUT stays up longer than 20 minutes.
Change-Id: I1b1e78af0774daeb240d889f1710d43daa3aaeea
Reviewed-on: https://chromium-review.googlesource.com/290411
Trybot-Ready: Laurence Goodby <lgoodby@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Laurence Goodby <lgoodby@chromium.org>
Tested-by: Laurence Goodby <lgoodby@chromium.org>
diff --git a/recover_duts/hooks/check_ethernet.hook b/recover_duts/hooks/check_ethernet.hook
index 1feb28c..abf4e47 100755
--- a/recover_duts/hooks/check_ethernet.hook
+++ b/recover_duts/hooks/check_ethernet.hook
@@ -56,13 +56,15 @@
local device
local driver
- for device_path in /sys/class/net/eth*; do
- driver_path="${device_path}/device/driver"
- if [ -e "${driver_path}" ]; then
- device=$(basename "${device_path}")
- driver=$(basename $(readlink -f "${driver_path}"))
- if ! is_non_ethernet_driver "${driver}" || is_connected "${device}" ; then
- echo "${device}"
+ for device_path in /sys/class/net/{eth,wan,lan,usbeth}*; do
+ if [ -e "${device_path}" ]; then
+ driver_path="${device_path}/device/driver"
+ if [ -e "${driver_path}" ]; then
+ device=$(basename "${device_path}")
+ driver=$(basename $(readlink -f "${driver_path}"))
+ if ! is_non_ethernet_driver "${driver}" || is_connected "${device}" ; then
+ echo "${device}"
+ fi
fi
fi
done
@@ -70,9 +72,11 @@
# Shows the list of USB-Ethernet interfaces found on the system.
find_usb_ethernet_interfaces() {
- for device_path in /sys/class/net/eth*; do
- if readlink -f "${device_path}" | grep -q usb; then
- basename "${device_path}"
+ for device_path in /sys/class/net/{eth,wan,lan,usbeth}*; do
+ if [ -e "${device_path}" ]; then
+ if readlink -f "${device_path}" | grep -q usb; then
+ basename "${device_path}"
+ fi
fi
done
}