bluetooth: Handle exception in quick_test_init.
bluetooth_facade init could fail and raise a unhandled exception. This
CL handles the exception and fails the test gracefully.
BUG=b:170884674
TEST=Ran one test
Change-Id: I2c83cb5ddc8f55de53fb0a2c28cfd4d7e9b7fc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2473121
Tested-by: Shijin Abraham <shijinabraham@google.com>
Reviewed-by: Daniel Winkler <danielwinkler@google.com>
Commit-Queue: Shijin Abraham <shijinabraham@google.com>
diff --git a/server/cros/bluetooth/bluetooth_adapter_quick_tests.py b/server/cros/bluetooth/bluetooth_adapter_quick_tests.py
index 0efd6e2..7bac5fb 100644
--- a/server/cros/bluetooth/bluetooth_adapter_quick_tests.py
+++ b/server/cros/bluetooth/bluetooth_adapter_quick_tests.py
@@ -114,7 +114,13 @@
self.factory = remote_facade_factory.RemoteFacadeFactory(
host, no_chrome=not self.start_browser, disable_arc=True)
- self.bluetooth_facade = self.factory.create_bluetooth_hid_facade()
+ try:
+ self.bluetooth_facade = self.factory.create_bluetooth_hid_facade()
+ except Exception as e:
+ logging.error('Exception %s while creating bluetooth_facade',
+ str(e))
+ raise error.TestFail('Unable to create bluetooth_facade')
+
# Common list to track old/new Bluetooth peers
# Adding chameleon to btpeer_list causes issue in cros_labels