From 1a8d8722068ef7e5f061336047a72d1a0f253b98 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 15 Oct 2024 20:57:02 +0200 Subject: [PATCH] tests: fix test_monitor on musl 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 --- tests/test_bluez5.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_bluez5.py b/tests/test_bluez5.py index a4d0520..786449e 100644 --- a/tests/test_bluez5.py +++ b/tests/test_bluez5.py @@ -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)