canonical / checkbox

Checkbox is a testing framework used to validate device compatibility with Ubuntu Linux. It’s the testing tool developed for the purposes of the Ubuntu Certification program.
https://checkbox.readthedocs.io
GNU General Public License v3.0
34 stars 50 forks source link

beacon_eddystone_url test run w/o requirements and hangs the session #1332

Open p-gentili opened 4 months ago

p-gentili commented 4 months ago

Bug Description

Running latest beta (4.0.0-dev333), the beacon_eddystone_url test runs even when bluetooth/detect fails. And while doing so, it crashes hanging the session (similar to https://github.com/canonical/checkbox/issues/1263).

Same environment as https://github.com/canonical/checkbox/issues/1331.

To Reproduce

Run the beacon_eddystone_url on a device w/o a bluetooth module or enough permissions to control it.

Environment

Core20 4.0.0-dev333-1878

Relevant log output

http://10.102.156.15:8080/job/cert-tillamook-pls62-uc20-cascade-kernel-20-beta/23

18:30:13 ----------------------------[ Running job 14 / 29 ]-----------------------------
18:30:13 [ Test system can get beacon EddyStone URL advertisements on the hci0 adapter ]-
18:30:13 ID: com.canonical.certification::bluetooth4/beacon_eddystone_url_hci0
18:30:13 Category: Bluetooth tests
18:30:13 --------------------------------------------------------------------------------
18:30:36 Exception in thread Thread-1:
18:30:36 Traceback (most recent call last):
18:30:36   File "/snap/checkbox-tillamook/56/checkbox-runtime/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
18:30:36     self.run()
18:30:36   File "/snap/checkbox-tillamook/56/checkbox-runtime/lib/python3.8/site-packages/checkbox_support/vendor/beacontools/scanner.py", line 146, in run
18:30:36     self.socket = self.backend.open_dev(self.bt_device_id)
18:30:36   File "/snap/checkbox-tillamook/56/checkbox-runtime/lib/python3.8/site-packages/checkbox_support/vendor/beacontools/backend/linux.py", line 13, in open_dev
18:30:36     socket.setsockopt(bluez.SOL_HCI, bluez.HCI_FILTER, filtr)
18:30:36 _bluetooth.error: (9, 'Bad file descriptor')
19:30:36 
19:30:36 ERROR: Output timeout reached! (3600s)


### Additional context

_No response_
syncronize-issues-to-jira[bot] commented 4 months ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CHECKBOX-1487.

This message was autogenerated

pieqq commented 4 months ago

Could you point to the C3 submission where this fails?

We could indeed add a dependency for the beacon/eddystone tests to bluetooth/detect, but there is already a template filter on device.category == 'BLUETOOTH', which means some BT device has been identified, which means these jobs should be able to run...

I searched for the device you mentioned (based on this submission from 202302-31257), I can see this info extracted from udev:

P: /devices/platform/soc/2100000.bus/21ec000.serial/tty/ttymxc2/hci0
L: 0
E: DEVPATH=/devices/platform/soc/2100000.bus/21ec000.serial/tty/ttymxc2/hci0
E: SUBSYSTEM=bluetooth
E: DEVTYPE=host
E: USEC_INITIALIZED=1652210709
E: SYSTEMD_ALIAS=/sys/subsystem/bluetooth/devices/hci0
E: SYSTEMD_WANTS=bluetooth.target
E: SYSTEMD_USER_WANTS=bluetooth.target
E: TAGS=:systemd:

and the bluetooth/detect job passed.

p-gentili commented 4 months ago

There's no C3 submission since the testplan was stuck.

http://10.102.156.15:8080/job/cert-tillamook-pls62-uc20-cascade-kernel-20-beta/23

18:30:13 ----------------------------[ Running job 13 / 29 ]-----------------------------
18:30:13 ------------[ Make sure at least one bluetooth device is detected ]-------------
18:30:13 ID: com.canonical.certification::bluetooth/detect
18:30:13 Category: Bluetooth tests
18:30:13 --------------------------------------------------------------------------------
18:30:13 --------------------------------------------------------------------------------
18:30:13 Outcome: job cannot be started
18:30:13 ----------------------------[ Running job 14 / 29 ]-----------------------------
18:30:13 [ Test system can get beacon EddyStone URL advertisements on the hci0 adapter ]-
18:30:13 ID: com.canonical.certification::bluetooth4/beacon_eddystone_url_hci0
18:30:13 Category: Bluetooth tests
18:30:13 --------------------------------------------------------------------------------
18:30:36 Exception in thread Thread-1:
18:30:36 Traceback (most recent call last):
18:30:36   File "/snap/checkbox-tillamook/56/checkbox-runtime/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
18:30:36     self.run()
18:30:36   File "/snap/checkbox-tillamook/56/checkbox-runtime/lib/python3.8/site-packages/checkbox_support/vendor/beacontools/scanner.py", line 146, in run
18:30:36     self.socket = self.backend.open_dev(self.bt_device_id)
18:30:36   File "/snap/checkbox-tillamook/56/checkbox-runtime/lib/python3.8/site-packages/checkbox_support/vendor/beacontools/backend/linux.py", line 13, in open_dev
18:30:36     socket.setsockopt(bluez.SOL_HCI, bluez.HCI_FILTER, filtr)
18:30:36 _bluetooth.error: (9, 'Bad file descriptor')
19:30:36 
19:30:36 ERROR: Output timeout reached! (3600s)

It says bluetooth/detect cannot be started, not failed, sorry for the confusion.

omar-selo commented 1 month ago

I'm seeing the same problem on tillamook-pls62-uc20 and tillamook-pls63-uc20

nancyc12 commented 1 month ago

Same problem on tillamook-pls63-uc20 in the latest run.