Skip to content

Commit

Permalink
tests: fix test_monitor on musl
Browse files Browse the repository at this point in the history
It is probably a Glibc bug that sscanf as used by bluez accepts 0x01
for this value[1].  For portability, use the unprefixed hex value.
Based on bluez's own documentation, I don't think the 0x is
required[2].

[1]: https://www.openwall.com/lists/libc-coord/2024/10/15/2
[2]: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/client/bluetoothctl-monitor.rst?id=3d9900eb754d277ef6abf21bed827cdc9e79ddb4
  • Loading branch information
alyssais authored and martinpitt committed Oct 16, 2024
1 parent 4b99cff commit 1a8d872
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_bluez5.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def test_monitor(self):
adapter = self.dbus_con.get_object("org.bluez", path)

# When an advertisement monitor is configured via bluetoothctl
out = _run_bluetoothctl("monitor.add-or-pattern 0 255 0x01")
out = _run_bluetoothctl("monitor.add-or-pattern 0 255 01")

# Then bluetoothctl reports success
self.assertIn("Advertisement Monitor 0 added", out)
Expand Down

0 comments on commit 1a8d872

Please sign in to comment.