cellular: Add support for MBIM modem in test environment
BUG=chromium:414125
TEST=Run network_3GSmokeTest on MBIM modem
Change-Id: I88653a57ca9245e45d336ed5dfd2cedabc50465a
Reviewed-on: https://chromium-review.googlesource.com/218321
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
Commit-Queue: Thieu Le <thieule@chromium.org>
diff --git a/client/cros/cellular/test_environment.py b/client/cros/cellular/test_environment.py
index ca03a6d..2cf504d 100644
--- a/client/cros/cellular/test_environment.py
+++ b/client/cros/cellular/test_environment.py
@@ -135,17 +135,23 @@
timeout=shill_proxy.ShillProxy.DEVICE_ENABLE_DISABLE_TIMEOUT)
+ def _is_unsupported_error(self, e):
+ return (e.get_dbus_name() ==
+ shill_proxy.ShillProxy.ERROR_NOT_SUPPORTED or
+ (e.get_dbus_name() ==
+ shill_proxy.ShillProxy.ERROR_FAILURE and
+ 'operation not supported' in e.get_dbus_message()))
+
def _reset_modem(self):
modem_device = self.shill.find_cellular_device_object()
if not modem_device:
raise error.TestError('Cannot find cellular device in shill. '
'Is the modem plugged in?')
try:
- # Cromo modems do not support being reset.
+ # Cromo/MBIM modems do not support being reset.
self.shill.reset_modem(modem_device, expect_service=False)
except dbus.DBusException as e:
- if (e.get_dbus_name() !=
- cellular_proxy.CellularProxy.ERROR_NOT_SUPPORTED):
+ if not self._is_unsupported_error(e):
raise