diff options
author | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2018-01-31 21:04:26 +0100 |
---|---|---|
committer | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2018-01-31 21:14:56 +0100 |
commit | 4c4815c714728cf8408ca397cb0f0b28c702080c (patch) | |
tree | 7a170ed6534f85ea5f1071bbdcef79c47c2ea445 | |
parent | 391d0636ced29e4ae2e60d065a696bd56aa9fd1b (diff) |
hci-smoke: add <auto> mode that reads AutoEnable from Policy
Bluez can use AutoEnable parameter from main.conf file to decide if bluetoothd
should enable newly discovered adaptors automatically. So instead of hardcoding
the state of the adaptor at BOOT, we add a new <auto> mode and we try to extract
the AutoEnable property from Bluez main.conf config file.
For example, Debian would set it to true by default, while it is false in OE.
Change-Id: Ic7487cc7bedae30a4d012369e22a3c5d0256b4d0
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
-rwxr-xr-x | automated/linux/hci-smoke/hci-smoke-test.sh | 14 | ||||
-rw-r--r-- | automated/linux/hci-smoke/hci-smoke.yaml | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/automated/linux/hci-smoke/hci-smoke-test.sh b/automated/linux/hci-smoke/hci-smoke-test.sh index 3f91091..454d4fa 100755 --- a/automated/linux/hci-smoke/hci-smoke-test.sh +++ b/automated/linux/hci-smoke/hci-smoke-test.sh @@ -52,12 +52,24 @@ test_hciconfig() { # test HCI device is $BOOT at boot test_hciconfig_boot() { info_msg "Running hciconfig_boot test..." + + # rely on distro policy for AutoEnable + if [ "${BOOT}" = "auto" ]; then + # get rid of spaces and comments + sed 's/\s\+//g;/^#/d' /etc/bluetooth/main.conf | grep "^AutoEnable=true" + if [ "$?" -eq 0 ]; then + BOOT="enabled" + else + BOOT="disabled" + fi + fi + if [ "${BOOT}" = "enabled" ]; then hciconfig "${DEVICE}" | grep "UP RUNNING" else hciconfig "${DEVICE}" | grep "DOWN" fi - check_return "hciconfig-boot" + check_return "hciconfig-boot-${BOOT}" } # test HCI device is up diff --git a/automated/linux/hci-smoke/hci-smoke.yaml b/automated/linux/hci-smoke/hci-smoke.yaml index 04a878f..47716de 100644 --- a/automated/linux/hci-smoke/hci-smoke.yaml +++ b/automated/linux/hci-smoke/hci-smoke.yaml @@ -16,7 +16,7 @@ metadata: params: DEVICE: hci0 - # expected state on first boot: <enabled> or <disabled> + # expected state on first boot: <enabled> or <disabled> or <auto> BOOT: enabled run: |