check_ethernet.hook: Refactor and enhance recovery

This CL splits up the recovery steps in check_ethernet.hook so
that less disruptive remidation steps are run before more
disruptive ones.  For example, restarting the connection manager
is likely to disrupt any running network connectivity test that
uses the connection manager.  To mitigate the possibility that
the connection manager is really at fault, we first check to see
if the connection manager is stopped.

Additionally, this change adds a new recovery step that uses
the "reload_network_device" script to virtually unplug and replug
USB Ethernet devices, in most cases performing a power cycle on
the peripheral.  This should hopefully work around failures with
some problematic USB-Etherent devices.

TEST=Manual: run with Ethernet disconnected, the driver unloaded,
the connnection manager stopped

Change-Id: I3f213f60f441207a539118ce75e3872040d136bc
Reviewed-by: Chris Sosa <>
Commit-Queue: Paul Stewart <>
Tested-by: Paul Stewart <>
(cherry picked from commit 45b0bf6b2b2942c52775efd224d837e2915a991c)
Reviewed-by: Paul Stewart <>
1 file changed