From 45cf63d589aca64aa8cd5b953f0c7fbe669ee091 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 30 Nov 2020 16:17:30 +0100 Subject: [PATCH] tests: Skip hotplug test if "removed" property does not exist The test requires libfprint 1.90.4 to work, otherwise it will just hang forever. --- tests/fprintd.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/fprintd.py b/tests/fprintd.py index bfb6a1a..8efa6f4 100644 --- a/tests/fprintd.py +++ b/tests/fprintd.py @@ -138,6 +138,8 @@ class FPrintdTest(dbusmock.DBusTestCase): fprintd = None cls._polkitd = None + cls._has_hotplug = FPrint.Device.find_property("removed") is not None + if 'FPRINT_BUILD_DIR' in os.environ: print('Testing local build') build_dir = os.environ['FPRINT_BUILD_DIR'] @@ -688,6 +690,9 @@ class FPrintdVirtualDeviceTest(FPrintdVirtualDeviceBaseTest): time.sleep(1) def test_removal_during_enroll(self): + if not self._has_hotplug: + self.skipTest("libfprint is too old for hotplug") + self._polkitd_obj.SetAllowed(['net.reactivated.fprint.device.setusername', 'net.reactivated.fprint.device.enroll']) self.device.Claim('(s)', 'testuser')