bluetooth_Sanity_DefaultState: handle BR/EDR whitelist
Recent kernels change the way they manage the "connectable" state of the
adapter. Instead of making the computer connectable to anything (which is
what this flag implies), instead the kernel uses the device whitelist to
determine what can connect.
The result is that the "connectable" flag remains off on systems running
3.10 or 3.14
Handle this in the autotest by checking whether the kernel supports the
"Add Device" management command and checking the opposite value of
"connectable" for those that do.
In addition, actually look at the raw HCI flags to check the PSCAN flag
and make sure that toggles on/off as we expect by adding and removing
a device.
BUG=chromium:433561
TEST=test_that bluetooth_Sanity_DefaultState
Change-Id: Ia43be23a8a1b0b5f7e14ae5aa8bd43fa2234e47e
Reviewed-on: https://chromium-review.googlesource.com/232514
Tested-by: Scott James Remnant <keybuk@chromium.org>
Reviewed-by: Michael Janssen <jamuraa@chromium.org>
Reviewed-by: Arman Uguray <armansito@chromium.org>
Commit-Queue: Scott James Remnant <keybuk@chromium.org>
diff --git a/server/cros/bluetooth/bluetooth_device.py b/server/cros/bluetooth/bluetooth_device.py
index 20ec115..b7d319b 100644
--- a/server/cros/bluetooth/bluetooth_device.py
+++ b/server/cros/bluetooth/bluetooth_device.py
@@ -205,6 +205,20 @@
return self._proxy.stop_discovery()
+ def get_dev_info(self):
+ """Read raw HCI device information.
+
+ @return tuple of (index, name, address, flags, device_type, bus_type,
+ features, pkt_type, link_policy, link_mode,
+ acl_mtu, acl_pkts, sco_mtu, sco_pkts,
+ err_rx, err_tx, cmd_tx, evt_rx, acl_tx, acl_rx,
+ sco_tx, sco_rx, byte_rx, byte_tx) on success,
+ None on failure.
+
+ """
+ return json.loads(self._proxy.get_dev_info())
+
+
def register_profile(self, path, uuid, options):
"""Register new profile (service).