network: Fix network_3GModemControl pseudomodem test
This CL addresses 3 pseudomodem related bugs that caused
network_3GModemControl to fail:
- shill failed to enable the pseudomodem since it requires a
modemmanager to be in the DISABLED state. pseudomodem initialized
itself to be in the UNKNOWN state, which prevented it from ever
getting enabled. It is now initialized to be in the DISABLED state.
- pseudo_modem.py Modem.Disconnect sets a DisconnectDone timeout which
fires after 500 ms, in which if the modem state is DISCONNECTING,
it sets the state to REGISTERED, otherwise raises an error.
If shill sends a Disconnect command to the modem and then disables it,
and the state changes to DISABLED before the DisconnectDone callback fires,
this causes an unwanted org.freedesktop.ModemManager1.Connection.Unknown
error to be raised. As a work-around, pseudomodem now checks in the
callback whether its state is DISABLE. If it is, it doesn't raise an
error.
- network_3GModemControl failed with 'Already have a pending Enable
operation' on machines equipped with a Gobi modem when the test runs
with the pseudomodem. The reason for this was that, before starting
the pseudomodem the test only disabled modemmanager and not cromo. The
presence of two modem managers caused undefined behavior. The test now
stops cromo before starting the pseudomodem.
BUG=chromium-os:35475,chromium-os:34474,chromium-os:32699
TEST=Ran network_3GModemControl on a lumpy equppied with a Gobi3k modem,
both with and without using the pseudomodem and the test passes.
Change-Id: I1f681113d4838be1188684563cba9e3751c4c1b0
Reviewed-on: https://gerrit.chromium.org/gerrit/36070
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Ready: Arman Uguray <armansito@chromium.org>
Tested-by: Arman Uguray <armansito@chromium.org>
2 files changed