summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatoro <matoro@users.noreply.github.com>2022-09-17 13:56:00 -0400
committerSam James <sam@gentoo.org>2022-09-17 19:24:03 +0100
commiteec9cbb0fb0073fd1c407f98e5307ff3bfcf01c9 (patch)
treebbab7ae1ac2c9ec6d5963539f5a1d31a5fe09c85 /sys-auth/fprintd
parentmail-filter/mailfilter: fix build with -Werror=strict-prototypes (Clang 15+) (diff)
downloadgentoo-eec9cbb0fb0073fd1c407f98e5307ff3bfcf01c9.tar.gz
gentoo-eec9cbb0fb0073fd1c407f98e5307ff3bfcf01c9.tar.bz2
gentoo-eec9cbb0fb0073fd1c407f98e5307ff3bfcf01c9.zip
sys-auth/fprintd: fix tests
No revbump since this affects tests only. See: https://bugs.launchpad.net/ubuntu/+source/fprintd/+bug/1976256 See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009395 See: https://salsa.debian.org/debian/fprintd/-/blob/debian/debian/patches/tests-Fix-dbusmock-AddDevice-calls-to-include-optional-ar.patch See: https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/ae04fa98 Bug: https://bugs.gentoo.org/764554 Closes: https://github.com/gentoo/gentoo/pull/27309 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-auth/fprintd')
-rw-r--r--sys-auth/fprintd/files/tests-Fix-dbusmock-AddDevice-calls-to-include-optional-ar.patch68
-rw-r--r--sys-auth/fprintd/fprintd-1.94.1.ebuild1
2 files changed, 69 insertions, 0 deletions
diff --git a/sys-auth/fprintd/files/tests-Fix-dbusmock-AddDevice-calls-to-include-optional-ar.patch b/sys-auth/fprintd/files/tests-Fix-dbusmock-AddDevice-calls-to-include-optional-ar.patch
new file mode 100644
index 000000000000..409c18ea0d7b
--- /dev/null
+++ b/sys-auth/fprintd/files/tests-Fix-dbusmock-AddDevice-calls-to-include-optional-ar.patch
@@ -0,0 +1,68 @@
+https://bugs.launchpad.net/ubuntu/+source/fprintd/+bug/1976256
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009395
+https://salsa.debian.org/debian/fprintd/-/blob/debian/debian/patches/tests-Fix-dbusmock-AddDevice-calls-to-include-optional-ar.patch
+
+From: Benjamin Berg <bberg@redhat.com>
+Date: Tue, 3 May 2022 12:01:37 +0200
+Subject: tests: Fix dbusmock AddDevice calls to include optional argument
+
+The dbusmock code checks that all parameters wanted by the dbus
+signature are given. As such, pass them, even though the parameters is
+optional on the python side.
+
+Origin: https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/ae04fa98
+---
+ tests/pam/test_pam_fprintd.py | 8 ++++----
+ tests/test_fprintd_utils.py | 2 +-
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/tests/pam/test_pam_fprintd.py b/tests/pam/test_pam_fprintd.py
+index 99f8259..bd43497 100644
+--- a/tests/pam/test_pam_fprintd.py
++++ b/tests/pam/test_pam_fprintd.py
+@@ -82,7 +82,7 @@ class TestPamFprintd(dbusmock.DBusTestCase):
+ self.p_mock.wait()
+
+ def setup_device(self):
+- device_path = self.obj_fprintd_mock.AddDevice('FDO Trigger Finger Laser Reader', 3, 'swipe')
++ device_path = self.obj_fprintd_mock.AddDevice('FDO Trigger Finger Laser Reader', 3, 'swipe', False)
+ self.device_mock = self.dbus_con.get_object('net.reactivated.Fprint', device_path)
+ self.device_mock.SetEnrolledFingers('toto', ['left-little-finger', 'right-little-finger'])
+
+@@ -232,7 +232,7 @@ class TestPamFprintd(dbusmock.DBusTestCase):
+ self.assertRegex(res.errors[0], r'Failed to match fingerprint')
+
+ def test_pam_fprintd_dual_reader_auth(self):
+- device_path = self.obj_fprintd_mock.AddDevice('FDO Sandpaper Reader', 3, 'press')
++ device_path = self.obj_fprintd_mock.AddDevice('FDO Sandpaper Reader', 3, 'press', False)
+ sandpaper_device_mock = self.dbus_con.get_object('net.reactivated.Fprint', device_path)
+ sandpaper_device_mock.SetEnrolledFingers('toto', ['left-middle-finger', 'right-middle-finger'])
+ script = [
+@@ -251,12 +251,12 @@ class TestPamFprintd(dbusmock.DBusTestCase):
+
+ def test_pam_fprintd_multi_reader_not_all_enrolled(self):
+ # Add a 1st device with actual enrolled prints
+- device_path = self.obj_fprintd_mock.AddDevice('FDO Empty reader', 3, 'press')
++ device_path = self.obj_fprintd_mock.AddDevice('FDO Empty reader', 3, 'press', False)
+ empty_reader = self.dbus_con.get_object('net.reactivated.Fprint', device_path)
+ empty_reader.SetEnrolledFingers('toto', dbus.Array(set([]), signature='s'))
+
+ # Add a 2nd device with actual enrolled prints
+- device_path = self.obj_fprintd_mock.AddDevice('FDO Most Used Reader', 3, 'press')
++ device_path = self.obj_fprintd_mock.AddDevice('FDO Most Used Reader', 3, 'press', False)
+ sandpaper_device_mock = self.dbus_con.get_object('net.reactivated.Fprint', device_path)
+ sandpaper_device_mock.SetEnrolledFingers('toto', ['left-middle-finger', 'right-middle-finger'])
+ script = [
+diff --git a/tests/test_fprintd_utils.py b/tests/test_fprintd_utils.py
+index f10d4b0..efa5893 100755
+--- a/tests/test_fprintd_utils.py
++++ b/tests/test_fprintd_utils.py
+@@ -88,7 +88,7 @@ class TestFprintdUtilsBase(dbusmock.DBusTestCase):
+
+ def setup_device(self):
+ self.device_path = self.obj_fprintd_mock.AddDevice(
+- 'FDO Trigger Finger Laser Reader', 3, 'swipe')
++ 'FDO Trigger Finger Laser Reader', 3, 'swipe', False)
+ self.device_mock = self.dbus_con.get_object('net.reactivated.Fprint',
+ self.device_path)
+ self.set_enrolled_fingers(['left-little-finger', 'right-little-finger'])
diff --git a/sys-auth/fprintd/fprintd-1.94.1.ebuild b/sys-auth/fprintd/fprintd-1.94.1.ebuild
index af41129c2d67..cca15ee2f37a 100644
--- a/sys-auth/fprintd/fprintd-1.94.1.ebuild
+++ b/sys-auth/fprintd/fprintd-1.94.1.ebuild
@@ -54,6 +54,7 @@ PATCHES=(
"${FILESDIR}/${PN}-1.90.7_0001-add-test-feature-and-make-tests-optional.patch"
"${FILESDIR}/${PN}-1.90.8_0002-add-configure-option-for-libsystemd-provider.patch"
"${FILESDIR}/${P}-fix-meson-0.61-build.patch"
+ "${FILESDIR}/tests-Fix-dbusmock-AddDevice-calls-to-include-optional-ar.patch"
)
S="${WORKDIR}/${MY_P}"