bluetooth4/beacon_eddystone_url_hci0 always fails

Bug #1904697 reported by Leon Liao
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HWE Next
Invalid
Undecided
Unassigned
OEM Priority Project
Won't Fix
High
jeremyszu

Bug Description

The bluetooth4/beacon_eddystone_url_hci0 test case always fails.

When this test case was running, although "LE Set Scan Enable" and "LE Set Advertise Enable" was set, but the bluetooth still can not get the advertise information.

But, when the Settings stays in bluetooth page, the advertise information is got.

Tags: oem-priority stella originate-from-1901862 originate-from-1903246 originate-from-1904106 originate-from-1904119 originate-from-1904137 originate-from-1904497 originate-from-1904679 originate-from-1904834 originate-from-1905834 originate-from-1906586 originate-from-1907020 originate-from-1907037 originate-from-1908353 originate-from-1908641 originate-from-1908658 originate-from-1909199 originate-from-1909271 originate-from-1909551 originate-from-1909707 originate-from-1910377 originate-from-1910640 originate-from-1910700 originate-from-1911116 originate-from-1911610 originate-from-1912734 originate-from-1914330 originate-from-1914699 originate-from-1918113 originate-from-1918243 originate-from-1918631 originate-from-1918646 originate-from-1919987 originate-from-1919998 originate-from-1921330 originate-from-1921360 originate-from-1921838 originate-from-1922182 originate-from-1923574 originate-from-1925192 originate-from-1926741 originate-from-1927109 originate-from-1927322 originate-from-1927708 originate-from-1928628 originate-from-1928637 originate-from-1928658 originate-from-1929679 originate-from-1930210 originate-from-1931399 originate-from-1931409 originate-from-1931419 originate-from-1932379 originate-from-1934226 originate-from-1934712 originate-from-1937996 originate-from-1938004 originate-from-1938513 originate-from-1940354 originate-from-1940361 originate-from-1941677 originate-from-1942400 originate-from-1943939 originate-from-1944489 originate-from-1944825 originate-from-1945599 originate-from-1945610 originate-from-1959208 originate-from-1968670 originate-from-1981038 somerville sutton
Leon Liao (lihow731)
tags: added: originate-from-1904679
tags: added: originate-from-1904497
Cyrus Lien (cyruslien)
tags: added: originate-from-1903246
Alex Tu (alextu)
tags: added: originate-from-1904834
Leon Liao (lihow731)
tags: added: originate-from-1905834
Cyrus Lien (cyruslien)
tags: added: originate-from-1904119
Cyrus Lien (cyruslien)
tags: added: originate-from-1904137
Revision history for this message
Jonathan Cave (jocave) wrote :

Can you explain why this is a bug with checkbox? What is the expected behaviour?

Note that this job was developed for IoT systems orginially.

Changed in plainbox-provider-checkbox:
status: New → Incomplete
Changed in oem-priority:
status: New → Incomplete
Changed in plainbox-provider-checkbox:
assignee: nobody → Leon Liao (lihow731)
Revision history for this message
Leon Liao (lihow731) wrote :

This test case always failed in desktop and notebook machines.
But, when we open the bluetooth settings then run this test case, this test case will be passed.

The expected behaviour: This test case should be run without any extra action (ex: open the bluetooth settings).

Cyrus Lien (cyruslien)
tags: added: originate-from-1901862
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Please note that even if I wrote this test for IoT initially it also was quickly adopted for desktop testing. We do run it as part of kernel SRU in Cert lab:

E.g: https://certification.canonical.com/hardware/201907-27241/submission/189913/

But in Lab everything runs using checkbox remote and the checkbox service on the SUT is invoked by systemd as root. How do you run yours?

Revision history for this message
Leon Liao (lihow731) wrote :

We use autostart to invoke the test plan that nested_part client-cert-auto.
During the test, we enable `sudo` without password.

Revision history for this message
Leon Liao (lihow731) wrote :

We are buying the new beacon broadcast devices that will be set near the SUTs.
Let this bug status stay at incomplete until the issue occured again when beacon broadcast device is near by the SUT.

Leon Liao (lihow731)
tags: added: originate-from-1907020
Leon Liao (lihow731)
tags: added: originate-from-1907037
Cyrus Lien (cyruslien)
tags: added: originate-from-1904106
Changed in plainbox-provider-checkbox:
importance: Critical → High
jeremyszu (os369510)
tags: added: originate-from-1909199 stella
Revision history for this message
Leon Liao (lihow731) wrote :

The attached file is the traces in btsnoop format when this bug failed.

Revision history for this message
Leon Liao (lihow731) wrote :

The attached file is the traces in btsnoop format when the Settings stayed on bluetooth tab and the result is passed.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Good, then you can easily find following errors by `btmon -r btsnoop-*.log` in both cases, which clearly gives it could be a flaw in the init sequence of aioblescan, most likely be a duplicate of bug 1893176, bug 1896858:

< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7 #1 [hci0] 9.480545
        Type: Active (0x01)
        Interval: 10.000 msec (0x0010)
        Window: 10.000 msec (0x0010)
        Own address type: Public (0x00)
        Filter policy: Accept all advertisement (0x00)
> HCI Event: Command Complete (0x0e) plen 4 #2 [hci0] 9.615793
      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Command Disallowed (0x0c)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2 #3 [hci0] 9.615903
        Scanning: Enabled (0x01)
        Filter duplicates: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 4 #4 [hci0] 9.616670
      LE Set Scan Enable (0x08|0x000c) ncmd 1
        Status: Command Disallowed (0x0c)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2 #5 [hci0] 19.491459
        Scanning: Disabled (0x00)
        Filter duplicates: Disabled (0x00)
@ RAW Close: checkbox-suppor {0x0003} [hci0] 19.498046
> HCI Event: Command Complete (0x0e) plen 4 #6 [hci0] 19.627648
      LE Set Scan Enable (0x08|0x000c) ncmd 1
        Status: Command Disallowed (0x0c)
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1 #7 [hci0] 19.627696
        Advertising: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 4 #8 [hci0] 19.628745
      LE Set Advertise Enable (0x08|0x000a) ncmd 1
        Status: Command Disallowed (0x0c)

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Possible solutions are:

1. Fix in device firmware and let a BT 5.1 device support 5.0 commands. This is against Bluetooth spec "3.1.1 Legacy and extended advertising":

  If, since the last power-on or reset, the Host has ever issued
  a legacy advertising command and then issues an extended
  advertising command, or has ever issued an extended
  advertising command and then issues a legacy advertising
  command, the Controller shall return the error code Command
  Disallowed (0x0C).

So basically mixing legacy and extended commands is not an option. aioblescan must follow how kernel has initialized the device.

2. Pull https://github.com/frawau/aioblescan/pull/30 into checkbox aioblescan. This PR was abandoned because it will introduce API changes to aioblescan, which has some, if not many, down stream projects.

3. Reimplment EddyStone URL scanning by checking ServiceData exposed by bluetoothd DBus API. See https://gitlab.com/vicamo/blasda/-/blob/wip/blasda/__main__.py . This will assure we only have one Bluetooth daemon controlling the bluetooth stack, so such mixing legacy & extended scan commands will no more happen.

jeremyszu (os369510)
tags: added: originate-from-1909707
Cyrus Lien (cyruslien)
tags: added: originate-from-1910700
Cyrus Lien (cyruslien)
tags: added: originate-from-1906586
tags: added: originate-from-1909551
tags: added: originate-from-1910640
tags: added: originate-from-1911116
Cyrus Lien (cyruslien)
tags: added: originate-from-1911610
Cyrus Lien (cyruslien)
tags: added: originate-from-1912734
Cyrus Lien (cyruslien)
tags: added: originate-from-1914699
jeremyszu (os369510)
tags: added: originate-from-1918113
jeremyszu (os369510)
tags: added: originate-from-1918243
jeremyszu (os369510)
tags: added: originate-from-1918631
tags: added: originate-from-1918646
Cyrus Lien (cyruslien)
tags: added: originate-from-1919987
tags: added: originate-from-1919998
jeremyszu (os369510)
tags: added: originate-from-1921330
jeremyszu (os369510)
Changed in oem-priority:
assignee: nobody → Alex Tu (alextu)
Cyrus Lien (cyruslien)
tags: added: originate-from-1922182
Cyrus Lien (cyruslien)
tags: added: originate-from-1921838
tags: added: originate-from-1914330 sutton
tags: added: originate-from-1908658
tags: added: originate-from-1909271
Cyrus Lien (cyruslien)
tags: added: originate-from-1923574
tags: added: originate-from-1908353
Cyrus Lien (cyruslien)
tags: added: originate-from-1910377
You-Sheng Yang (vicamo)
tags: added: originate-from-1925192
jeremyszu (os369510)
Changed in plainbox-provider-checkbox:
assignee: Leon Liao (lihow731) → nobody
jeremyszu (os369510)
tags: added: originate-from-1926741
jeremyszu (os369510)
tags: added: originate-from-1927109
jeremyszu (os369510)
tags: added: originate-from-1927322
Andy Chi (andch)
tags: added: originate-from-1927708
Andy Chi (andch)
tags: added: originate-from-1928658
jeremyszu (os369510)
tags: added: originate-from-1928637
jeremyszu (os369510)
tags: added: originate-from-1928628
tags: added: originate-from-1908641
Bin Li (binli)
tags: added: originate-from-1930210
Andy Chi (andch)
tags: added: originate-from-1921360
Andy Chi (andch)
tags: added: originate-from-1931409
Andy Chi (andch)
tags: added: originate-from-1931419
Andy Chi (andch)
tags: added: originate-from-1931399
Andy Chi (andch)
tags: added: originate-from-1932379
Andy Chi (andch)
tags: added: originate-from-1934712
Cyrus Lien (cyruslien)
tags: added: originate-from-1934226
Andy Chi (andch)
tags: added: originate-from-1937996
Andy Chi (andch)
tags: added: originate-from-1938004
Andy Chi (andch)
tags: added: originate-from-1938513
Jonathan Cave (jocave)
tags: removed: oem-priority originate-from-1901862 originate-from-1903246 originate-from-1904106 originate-from-1904119 originate-from-1904137 originate-from-1904497 originate-from-1904679 originate-from-1904834 originate-from-1905834 originate-from-1906586 originate-from-1907020 originate-from-1907037 originate-from-1908353 originate-from-1908641 originate-from-1908658 originate-from-1909199 originate-from-1909271 originate-from-1909551 originate-from-1909707 originate-from-1910377 originate-from-1910640 originate-from-1910700 originate-from-1911116 originate-from-1911610 originate-from-1912734 originate-from-1914330 originate-from-1914699 originate-from-1918113 originate-from-1918243 originate-from-1918631 originate-from-1918646 originate-from-1919987 originate-from-1919998 originate-from-1921330 originate-from-1921360 originate-from-1921838 originate-from-1922182 originate-from-1923574 originate-from-1925192 originate-from-1926741 originate-from-1927109 originate-from-1927322 originate-from-1927708 originate-from-1928628 originate-from-1928637 originate-from-1928658 originate-from-1930210 originate-from-1931399 originate-from-1931409 originate-from-1931419 originate-from-1932379 originate-from-1934226 originate-from-1934712 originate-from-1937996 originate-from-1938004 originate-from-1938513 somerville stella sutton
Jonathan Cave (jocave)
tags: added: oem-priority originate-from-1901862 originate-from-1903246 originate-from-1904106 originate-from-1904119 originate-from-1904137 originate-from-1904497 originate-from-1904679 originate-from-1904834 originate-from-1905834 originate-from-1906586 originate-from-1907020 originate-from-1907037 originate-from-1908353 originate-from-1908641 originate-from-1908658 originate-from-1909199 originate-from-1909271 originate-from-1909551 originate-from-1909707 originate-from-1910377 originate-from-1910640 originate-from-1910700 originate-from-1911116 originate-from-1911610 originate-from-1912734 originate-from-1914330 originate-from-1914699 originate-from-1918113 originate-from-1918243 originate-from-1918631 originate-from-1918646 originate-from-1919987 originate-from-1919998 originate-from-1921330 originate-from-1921360 originate-from-1921838 originate-from-1922182 originate-from-1923574 originate-from-1925192 originate-from-1926741 originate-from-1927109 originate-from-1927322 originate-from-1927708 originate-from-1928628 originate-from-1928637 originate-from-1928658 originate-from-1930210 originate-from-1931399 originate-from-1931409 originate-from-1931419 originate-from-1932379 originate-from-1934226 originate-from-1934712 originate-from-1937996 originate-from-1938004 originate-from-1938513 somerville stella sutton
Revision history for this message
Jonathan Cave (jocave) wrote :

I think the implementation has changed since the last time this bug was commented on. I can run this test on my desktop PC without any workarounds like opening the Settings dialog.

--------------[ Running job 1 / 1. Estimated time left: 0:00:10 ]---------------
[ Test system can get beacon EddyStone URL advertisements on the hci0 adapter ]-
ID: com.canonical.certification::bluetooth4/beacon_eddystone_url_hci0
Category: com.canonical.plainbox::bluetooth
... 8< -------------------------------------------------------------------------
Enter sudo password:

Eddystone beacon detected: URL: http://mytest.com/ <mac: 52:c4:98:76:05:85> <rssi: -66>
------------------------------------------------------------------------- >8 ---
Outcome: job passed

Could you confirm that you are using the latest version of checkbox-support and have an Eddystone Beacon within range of the devices under test?

Revision history for this message
Jonathan Cave (jocave) wrote :

As there are a number of examples of the test now working in SRU runs I'm going to set this to Fix Released.

Changed in oem-priority:
status: Incomplete → Fix Released
Changed in plainbox-provider-checkbox:
status: Incomplete → Fix Released
Revision history for this message
jeremyszu (os369510) wrote :

@Jonathan,

thanks for sharing the information.
Since Leon is not in Canonical anymore, I will take over to verify this issue in our sanity environment.
Please allow me to leave oem-priority here and I will arrange the time to verify it and change the status here.

Changed in oem-priority:
status: Fix Released → New
assignee: Alex Tu (alextu) → jeremyszu (os369510)
importance: Undecided → High
Revision history for this message
Jonathan Cave (jocave) wrote :

Thanks Jeremy, please make sure you have a Beacon within range of a device and let us know if the job now passes for you.

For reference the MR related to this test is:
https://code.launchpad.net/~pwlars/checkbox-support/+git/checkbox-support/+merge/402529

Andy Chi (andch)
tags: added: originate-from-1940354
Andy Chi (andch)
tags: added: originate-from-1940361
tags: added: originate-from-1941677
Dirk Su (dirksu)
tags: added: originate-from-1942400
tags: added: originate-from-1943939
tags: added: originate-from-1944489
Andy Chi (andch)
tags: added: originate-from-1944825
Dirk Su (dirksu)
tags: added: originate-from-1945599
Jonathan Cave (jocave)
no longer affects: plainbox-provider-checkbox
Dirk Su (dirksu)
tags: added: originate-from-1945610
tags: added: originate-from-1968670
Andy Chi (andch)
tags: added: originate-from-1959208
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

what's the point of this bug? it's getting new 'originate-from-NN' tags

Changed in hwe-next:
status: New → Incomplete
Revision history for this message
jeremyszu (os369510) wrote :

I believe we were not meet this issue after moving DUTs from taipei-101 to eongher-lab.

Let's open this bug if it happens again.

BTW, reply to comment#14:
the tag is added by bot because we add this test case to a known-issue list.

Changed in oem-priority:
status: New → Won't Fix
Timo Aaltonen (tjaalton)
Changed in hwe-next:
status: Incomplete → Invalid
Cyrus Lien (cyruslien)
tags: added: originate-from-1929679
tags: added: originate-from-1981038
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.