New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 680913 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

bluetooth autotest: catch and display dbus error properly

Project Member Reported by josephsih@chromium.org, Jan 13 2017

Issue description

When running the bluetooth_AdapterPairing autotest on bluez 

commit d9d6e06ce937f8c2e82898ff1442109539bea486
CHROMIUM: supports a new dbus method ResetAdvertising

it would fail due to an upstream error. 

The autotest is able to catch the error which is good. But the autotest does not catch and show the error properly. We need to fix the issue.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/060a711d10ffa6eadb1e46e5b200b6ffb2dc83ef

commit 060a711d10ffa6eadb1e46e5b200b6ffb2dc83ef
Author: Joseph Hwang <josephsih@chromium.org>
Date: Fri Jan 13 07:16:29 2017

bluetooth_device_xmlrpc_server: catch dbus error properly.

In _find_device(), when executing dbus.Interface(), it may
return False if exceptions occur owing to the decorator,
@xmlrpc_server.dbus_safe(False).

In this patch, we would like to catch the error and display
the error log properly. For instance, if BlueZ crashes on
dereferencing a null pointer, the test server should capture
D-Bus interface exception. Refer to TEST below for catching
such a crash example through bluetooth autotests.

BUG= chromium:680913 
TEST=Perform the following steps:

(1) Reset bluez to the following commit.
    commit d9d6e06ce937f8c2e82898ff1442109539bea486
           CHROMIUM: supports a new dbus method ResetAdvertising
    Emerge and deploy bluez to a chromebook machine.
    For more information about the crash issue, refer to
    crbug.com/662144: Bluetooth is broken in Chrome OS.

    Please also refer to the following patch about what were fixed
    about the crash caused by scan.
    https://chromium.googlesource.com/chromiumos/third_party/bluez/+/4c86ad3816e5f1e62cbca09b232157f768afedd8%5E%21/
    Basically, that patch fixed the device flags type and size in
    /src/device.c in bluez.

(2) Run bluetooth_AdapterPairing autotest.
    (cr) $ test_that --args "chameleon_host=$CHAMELEON_IP" $CHROMEBOOK_IP
           bluetooth_AdapterPairing.mouse

    When executing test_discover_device, observe an exception as follows:

    test_discover_device:
        <Fault 1: "<type 'exceptions.Exception'>:dbus.Interface error">
    bluetoothd probably crash. Check out /var/log/messages.

(3) Remember to update your bluez back to the latest commit after testing.

Change-Id: I216adc626e0bf1dd7b02a416425693f8d14dde6b
Reviewed-on: https://chromium-review.googlesource.com/427425
Commit-Ready: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
Reviewed-by: Shyh-In Hwang <josephsih@chromium.org>

[modify] https://crrev.com/060a711d10ffa6eadb1e46e5b200b6ffb2dc83ef/server/cros/bluetooth/bluetooth_adpater_tests.py
[modify] https://crrev.com/060a711d10ffa6eadb1e46e5b200b6ffb2dc83ef/client/cros/bluetooth/bluetooth_device_xmlrpc_server.py

Status: Fixed (was: Started)

Sign in to add a comment