mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-06-11 02:28:05 +00:00
Merge tag 'v1.94.6' into tod
v1.94.6 Git-EVTag-v0-SHA512: e1afaf08552dd3bc8e20229f4e8e141236a2133ce69cd3c68332e68483fb80a471ac0d7da1eedd6e4b0944b729433ac26e86ec12ef3accc78f86b1331150e185
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
[Test]
|
||||
Type=session
|
||||
# We can't use TestEnvironment as per
|
||||
# https://gitlab.gnome.org/GNOME/gnome-desktop-testing/-/issues/1
|
||||
Exec=env @driver_env@ @installed_tests_execdir@/@umockdev_test_name@ @installed_tests_testdir@/@driver_test@
|
||||
Binary file not shown.
+80
-69
@@ -1,31 +1,30 @@
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1/1-3
|
||||
N: bus/usb/001/023=12010002EF000040C627966400010102030109022000010103A0320904000002FF0000040705830240000007050102400000
|
||||
E: DEVNAME=/dev/bus/usb/001/023
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb3/3-9
|
||||
N: bus/usb/003/004=12010002EF000040C627AC6300010102030109022000010103A0320904000002FF0000040705830240000007050102400000
|
||||
E: DEVNAME=/dev/bus/usb/003/004
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=27c6/6496/100
|
||||
E: PRODUCT=27c6/63ac/100
|
||||
E: TYPE=239/0/0
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=023
|
||||
E: BUSNUM=003
|
||||
E: DEVNUM=004
|
||||
E: MAJOR=189
|
||||
E: MINOR=22
|
||||
E: MINOR=259
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Goodix_Technology_Co.__Ltd.
|
||||
E: ID_VENDOR_ENC=Goodix\x20Technology\x20Co.\x2c\x20Ltd.
|
||||
E: ID_VENDOR_ID=27c6
|
||||
E: ID_MODEL=Goodix_USB2.0_MISC
|
||||
E: ID_MODEL_ENC=Goodix\x20USB2.0\x20MISC
|
||||
E: ID_MODEL_ID=6496
|
||||
E: ID_MODEL_ID=63ac
|
||||
E: ID_REVISION=0100
|
||||
E: ID_SERIAL=Goodix_Technology_Co.__Ltd._Goodix_USB2.0_MISC_XXXX_MOC_B0
|
||||
E: ID_SERIAL_SHORT=XXXX_MOC_B0
|
||||
E: ID_SERIAL=Goodix_Technology_Co.__Ltd._Goodix_USB2.0_MISC_UID4C77C784_XXXX_MOC_B0
|
||||
E: ID_SERIAL_SHORT=UID4C77C784_XXXX_MOC_B0
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:ff0000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Shenzhen Goodix Technology Co.,Ltd.
|
||||
E: ID_AUTOSUSPEND=1
|
||||
E: ID_PERSIST=0
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:3
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:9
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_9
|
||||
A: authorized=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
@@ -38,30 +37,34 @@ A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=0100\n
|
||||
A: bmAttributes=a0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=XXXX_MOC_B0\n
|
||||
H: descriptors=12010002EF000040C627966400010102030109022000010103A0320904000002FF0000040705830240000007050102400000
|
||||
A: dev=189:22\n
|
||||
A: devnum=23\n
|
||||
A: devpath=3\n
|
||||
A: busnum=3\n
|
||||
A: configuration=UID4C77C784_XXXX_MOC_B0\n
|
||||
H: descriptors=12010002EF000040C627AC6300010102030109022000010103A0320904000002FF0000040705830240000007050102400000
|
||||
A: dev=189:259\n
|
||||
A: devnum=4\n
|
||||
A: devpath=9\n
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d/device:20
|
||||
A: idProduct=6496\n
|
||||
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:13/device:14/device:1f
|
||||
A: idProduct=63ac\n
|
||||
A: idVendor=27c6\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Goodix Technology Co., Ltd.\n
|
||||
A: maxchild=0\n
|
||||
L: port=../1-0:1.0/usb1-port3
|
||||
A: power/active_duration=22667\n
|
||||
L: port=../3-0:1.0/usb3-port9
|
||||
A: power/active_duration=702588\n
|
||||
A: power/async=enabled\n
|
||||
A: power/autosuspend=2\n
|
||||
A: power/autosuspend_delay_ms=2000\n
|
||||
A: power/connected_duration=917616\n
|
||||
A: power/connected_duration=78973756\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/persist=1\n
|
||||
A: power/runtime_active_time=22809\n
|
||||
A: power/runtime_active_kids=0\n
|
||||
A: power/runtime_active_time=707156\n
|
||||
A: power/runtime_enabled=enabled\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=894564\n
|
||||
A: power/runtime_suspended_time=78265226\n
|
||||
A: power/runtime_usage=0\n
|
||||
A: power/wakeup=disabled\n
|
||||
A: power/wakeup_abort_count=\n
|
||||
A: power/wakeup_active=\n
|
||||
@@ -73,34 +76,34 @@ A: power/wakeup_max_time_ms=\n
|
||||
A: power/wakeup_total_time_ms=\n
|
||||
A: product=Goodix USB2.0 MISC\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=removable\n
|
||||
A: removable=fixed\n
|
||||
A: rx_lanes=1\n
|
||||
A: serial=XXXX_MOC_B0\n
|
||||
A: serial=UID4C77C784_XXXX_MOC_B0\n
|
||||
A: speed=12\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=298\n
|
||||
A: urbnum=5759\n
|
||||
A: version= 2.00\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1
|
||||
N: bus/usb/001/001=12010002090001406B1D020017050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb3
|
||||
N: bus/usb/003/001=12010002090001406B1D020015050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/003/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/517
|
||||
E: PRODUCT=1d6b/2/515
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=001
|
||||
E: BUSNUM=003
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: MINOR=256
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.17.12-300.fc36.x86_64_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.17.12-300.fc36.x86_64\x20xhci-hcd
|
||||
E: ID_VENDOR=Linux_5.15.0-57-generic_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.15.0-57-generic\x20xhci-hcd
|
||||
E: ID_VENDOR_ID=1d6b
|
||||
E: ID_MODEL=xHCI_Host_Controller
|
||||
E: ID_MODEL_ENC=xHCI\x20Host\x20Controller
|
||||
E: ID_MODEL_ID=0002
|
||||
E: ID_REVISION=0517
|
||||
E: ID_SERIAL=Linux_5.17.12-300.fc36.x86_64_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
|
||||
E: ID_REVISION=0515
|
||||
E: ID_SERIAL=Linux_5.15.0-57-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
|
||||
E: ID_SERIAL_SHORT=0000:00:14.0
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:090000:
|
||||
@@ -123,31 +126,35 @@ A: bMaxPacketSize0=64\n
|
||||
A: bMaxPower=0mA\n
|
||||
A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=0517\n
|
||||
A: bcdDevice=0515\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=1\n
|
||||
A: configuration=\n
|
||||
H: descriptors=12010002090001406B1D020017050302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:0\n
|
||||
A: busnum=3\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020015050302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:256\n
|
||||
A: devnum=1\n
|
||||
A: devpath=0\n
|
||||
L: driver=../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d
|
||||
L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:13/device:14
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 5.17.12-300.fc36.x86_64 xhci-hcd\n
|
||||
A: manufacturer=Linux 5.15.0-57-generic xhci-hcd\n
|
||||
A: maxchild=12\n
|
||||
A: power/active_duration=164289796\n
|
||||
A: power/active_duration=78971960\n
|
||||
A: power/async=enabled\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=164360220\n
|
||||
A: power/connected_duration=78974992\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_time=164331876\n
|
||||
A: power/runtime_active_kids=2\n
|
||||
A: power/runtime_active_time=78973899\n
|
||||
A: power/runtime_enabled=enabled\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=0\n
|
||||
A: power/runtime_usage=0\n
|
||||
A: power/wakeup=disabled\n
|
||||
A: power/wakeup_abort_count=\n
|
||||
A: power/wakeup_active=\n
|
||||
@@ -164,48 +171,52 @@ A: rx_lanes=1\n
|
||||
A: serial=0000:00:14.0\n
|
||||
A: speed=480\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=2097\n
|
||||
A: urbnum=1824\n
|
||||
A: version= 2.00\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0
|
||||
E: DRIVER=xhci_hcd
|
||||
E: PCI_CLASS=C0330
|
||||
E: PCI_ID=8086:9DED
|
||||
E: PCI_SUBSYS_ID=17AA:2292
|
||||
E: PCI_ID=8086:51ED
|
||||
E: PCI_SUBSYS_ID=1028:0B00
|
||||
E: PCI_SLOT_NAME=0000:00:14.0
|
||||
E: MODALIAS=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30
|
||||
E: MODALIAS=pci:v00008086d000051EDsv00001028sd00000B00bc0Csc03i30
|
||||
E: SUBSYSTEM=pci
|
||||
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
|
||||
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
|
||||
E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
|
||||
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
|
||||
E: ID_AUTOSUSPEND=1
|
||||
E: ID_MODEL_FROM_DATABASE=Cannon Point-LP USB 3.1 xHCI Controller
|
||||
A: ari_enabled=0\n
|
||||
A: broken_parity_status=0\n
|
||||
A: class=0x0c0330\n
|
||||
H: config=8680ED9D060490021130030C00008000040022EA000000000000000000000000000000000000000000000000AA179222000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F00000000F507312600000000316000000000000000000000000000000180C2C1080000000000000000000000059087001803E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000000000000000000008000000040000000000000000000000000000000000000000000000000000000800000004000000000000000000000000000000000000000000000000000000B50F320112000000
|
||||
H: config=8680ED51060490020130030C0000800004002A8F6200000000000000000000000000000000000000000000002810000B000000007000000000000000FF010000FD0134A089C27F8000000000000000003F6DD80F000000000000000000000000316000000000000000000000000000000180C2C1080000000000000000000000059087003808E0FE000000000000000009B014F01000400100000000C10A080000080E00001800008F50020000010000090000018680C00009001014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B50F100112000000
|
||||
A: consistent_dma_mask_bits=64\n
|
||||
A: d3cold_allowed=1\n
|
||||
A: dbc=disabled\n
|
||||
A: device=0x9ded\n
|
||||
A: device=0x51ed\n
|
||||
A: dma_mask_bits=64\n
|
||||
L: driver=../../../bus/pci/drivers/xhci_hcd
|
||||
A: driver_override=(null)\n
|
||||
A: enable=1\n
|
||||
L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c
|
||||
A: irq=128\n
|
||||
A: local_cpulist=0-7\n
|
||||
A: local_cpus=ff\n
|
||||
A: modalias=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30\n
|
||||
L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:13
|
||||
L: iommu=../../virtual/iommu/dmar1
|
||||
L: iommu_group=../../../kernel/iommu_groups/13
|
||||
A: irq=167\n
|
||||
A: local_cpulist=0-19\n
|
||||
A: local_cpus=fffff\n
|
||||
A: modalias=pci:v00008086d000051EDsv00001028sd00000B00bc0Csc03i30\n
|
||||
A: msi_bus=1\n
|
||||
A: msi_irqs/128=msi\n
|
||||
A: msi_irqs/167=msi\n
|
||||
A: numa_node=-1\n
|
||||
A: pools=poolinfo - 0.1\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0\nxHCI 1KB stream ctx arrays 0 0 1024 0\nxHCI 256 byte stream ctx arrays 0 0 256 0\nxHCI input/output contexts 11 12 2112 12\nxHCI ring segments 46 50 4096 50\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 6 32 128 1\nbuffer-32 0 0 32 0\n
|
||||
A: pools=poolinfo - 0.1\nxHCI 1KB stream ctx arrays 0 0 1024 0\nxHCI 256 byte stream ctx arrays 0 0 256 0\nxHCI input/output contexts 13 14 2112 14\nxHCI ring segments 38 42 4096 42\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 3 32 128 1\nbuffer-32 0 0 32 0\n
|
||||
A: power/async=enabled\n
|
||||
A: power/control=auto\n
|
||||
A: power/runtime_active_time=164332777\n
|
||||
A: power/runtime_active_kids=1\n
|
||||
A: power/runtime_active_time=78974886\n
|
||||
A: power/runtime_enabled=enabled\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=0\n
|
||||
A: power/runtime_usage=0\n
|
||||
A: power/wakeup=enabled\n
|
||||
A: power/wakeup_abort_count=0\n
|
||||
A: power/wakeup_active=0\n
|
||||
@@ -216,9 +227,9 @@ A: power/wakeup_last_time_ms=0\n
|
||||
A: power/wakeup_max_time_ms=0\n
|
||||
A: power/wakeup_total_time_ms=0\n
|
||||
A: power_state=D0\n
|
||||
A: resource=0x00000000ea220000 0x00000000ea22ffff 0x0000000000140204\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n
|
||||
A: revision=0x11\n
|
||||
A: subsystem_device=0x2292\n
|
||||
A: subsystem_vendor=0x17aa\n
|
||||
A: resource=0x000000628f2a0000 0x000000628f2affff 0x0000000000140204\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n
|
||||
A: revision=0x01\n
|
||||
A: subsystem_device=0x0b00\n
|
||||
A: subsystem_vendor=0x1028\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
|
||||
@@ -17,3 +17,10 @@
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
<ignore-g-thread-new-leak>
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
...
|
||||
fun:g_thread_new
|
||||
}
|
||||
|
||||
+114
-14
@@ -4,9 +4,9 @@ envs.set('G_DEBUG', 'fatal-warnings')
|
||||
envs.set('G_MESSAGES_DEBUG', 'all')
|
||||
|
||||
# Setup paths
|
||||
envs.set('MESON_SOURCE_ROOT', meson.source_root())
|
||||
envs.set('MESON_BUILD_ROOT', meson.build_root())
|
||||
envs.prepend('LD_LIBRARY_PATH', join_paths(meson.build_root(), 'libfprint'))
|
||||
envs.set('MESON_SOURCE_ROOT', meson.project_source_root())
|
||||
envs.set('MESON_BUILD_ROOT', meson.project_build_root())
|
||||
envs.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libfprint')
|
||||
|
||||
# Set FP_DEVICE_EMULATION so that drivers can adapt (e.g. to use fixed
|
||||
# random numbers rather than proper ones)
|
||||
@@ -19,8 +19,17 @@ envs.set('FP_DRIVERS_WHITELIST', ':'.join([
|
||||
'virtual_device_storage',
|
||||
]))
|
||||
|
||||
envs.set('FP_PRINTS_PATH', meson.project_source_root() / 'examples' / 'prints')
|
||||
|
||||
envs.set('NO_AT_BRIDGE', '1')
|
||||
|
||||
python3 = find_program('python3')
|
||||
|
||||
installed_tests = get_option('installed-tests')
|
||||
installed_tests_execdir = libexecdir / 'installed-tests' / versioned_libname
|
||||
installed_tests_testdir = datadir / 'installed-tests' / versioned_libname
|
||||
installed_tests_libdir = libdir
|
||||
|
||||
drivers_tests = [
|
||||
'aes2501',
|
||||
'aes3500',
|
||||
@@ -30,6 +39,7 @@ drivers_tests = [
|
||||
'elanspi',
|
||||
'synaptics',
|
||||
'upektc_img',
|
||||
'upektc_img-tcs1s',
|
||||
'uru4000-msv2',
|
||||
'uru4000-4500',
|
||||
'vfs0050',
|
||||
@@ -44,23 +54,33 @@ drivers_tests = [
|
||||
|
||||
if get_option('introspection')
|
||||
conf = configuration_data()
|
||||
conf.set('SRCDIR', meson.source_root())
|
||||
conf.set('BUILDDIR', meson.build_root())
|
||||
conf.set('SRCDIR', meson.project_source_root())
|
||||
conf.set('BUILDDIR', meson.project_build_root())
|
||||
configure_file(configuration: conf,
|
||||
input: 'create-driver-test.py.in',
|
||||
output: 'create-driver-test.py')
|
||||
endif
|
||||
|
||||
env_parser_cmd = '''
|
||||
import os;
|
||||
print(" ".join([f"{k}={v}" for k, v in os.environ.items()
|
||||
if k.startswith("FP_") or k.startswith("G_")]))
|
||||
'''
|
||||
|
||||
envs_str = run_command(python3, '-c', env_parser_cmd,
|
||||
env: envs,
|
||||
check: installed_tests).stdout().strip()
|
||||
|
||||
if get_option('introspection')
|
||||
envs.prepend('GI_TYPELIB_PATH', join_paths(meson.build_root(), 'libfprint'))
|
||||
envs.prepend('GI_TYPELIB_PATH', meson.project_build_root() / 'libfprint')
|
||||
virtual_devices_tests = [
|
||||
'virtual-image',
|
||||
'virtual-device',
|
||||
]
|
||||
|
||||
python3 = find_program('python3')
|
||||
unittest_inspector = find_program('unittest_inspector.py')
|
||||
umockdev_test = find_program('umockdev-test.py')
|
||||
umockdev_test_name = 'umockdev-test.py'
|
||||
umockdev_test = find_program(umockdev_test_name)
|
||||
|
||||
foreach vdtest: virtual_devices_tests
|
||||
driver_name = '_'.join(vdtest.split('-'))
|
||||
@@ -92,6 +112,31 @@ if get_option('introspection')
|
||||
env: envs,
|
||||
)
|
||||
endforeach
|
||||
|
||||
if installed_tests
|
||||
install_data(base_args,
|
||||
install_dir: installed_tests_execdir,
|
||||
install_mode: 'rwxr-xr-x',
|
||||
)
|
||||
|
||||
configure_file(
|
||||
input: 'test.in',
|
||||
output: vdtest + '.test',
|
||||
install_dir: installed_tests_testdir,
|
||||
configuration: {
|
||||
# FIXME: use fs.name() on meson 0.58
|
||||
'exec': installed_tests_execdir / '@0@'.format(base_args[0]).split('/')[-1],
|
||||
'env': ' '.join([
|
||||
envs_str,
|
||||
'LD_LIBRARY_PATH=' + installed_tests_libdir,
|
||||
'FP_PRINTS_PATH=' + installed_tests_testdir / 'prints',
|
||||
# FIXME: Adding this requires gnome-desktop-testing!12
|
||||
# 'GI_TYPELIB_PATH=' + installed_tests_libdir / 'girepository-1.0',
|
||||
]),
|
||||
'extra_content': '',
|
||||
},
|
||||
)
|
||||
endif
|
||||
else
|
||||
test(vdtest,
|
||||
find_program('sh'),
|
||||
@@ -100,6 +145,7 @@ if get_option('introspection')
|
||||
endif
|
||||
endforeach
|
||||
|
||||
driver_tests_enabled = false
|
||||
foreach driver_test: drivers_tests
|
||||
driver_name = driver_test.split('-')[0]
|
||||
driver_envs = envs
|
||||
@@ -107,6 +153,7 @@ if get_option('introspection')
|
||||
|
||||
if (driver_name in supported_drivers and
|
||||
gusb_dep.version().version_compare('>= 0.3.0'))
|
||||
driver_tests_enabled = true
|
||||
test(driver_test,
|
||||
python3,
|
||||
args: [
|
||||
@@ -118,6 +165,32 @@ if get_option('introspection')
|
||||
timeout: 15,
|
||||
depends: libfprint_typelib,
|
||||
)
|
||||
|
||||
if installed_tests
|
||||
driver_envs_str = run_command(python3, '-c', env_parser_cmd,
|
||||
env: driver_envs,
|
||||
check: true).stdout().strip()
|
||||
|
||||
configure_file(
|
||||
input: 'driver.test.in',
|
||||
output: 'driver-' + driver_test + '.test',
|
||||
install_dir: installed_tests_testdir,
|
||||
configuration: {
|
||||
'installed_tests_execdir': installed_tests_execdir,
|
||||
'installed_tests_testdir': installed_tests_testdir,
|
||||
'umockdev_test_name': umockdev_test_name,
|
||||
'driver_test': driver_test,
|
||||
'driver_env': ' '.join([
|
||||
driver_envs_str,
|
||||
'LD_LIBRARY_PATH=' + installed_tests_libdir,
|
||||
# FIXME: Adding this requires gnome-desktop-testing!12
|
||||
# 'GI_TYPELIB_PATH=' + installed_tests_libdir / 'girepository-1.0',
|
||||
]),
|
||||
},
|
||||
)
|
||||
|
||||
install_subdir(driver_test, install_dir: installed_tests_testdir)
|
||||
endif
|
||||
else
|
||||
test(driver_test,
|
||||
find_program('sh'),
|
||||
@@ -125,6 +198,17 @@ if get_option('introspection')
|
||||
)
|
||||
endif
|
||||
endforeach
|
||||
|
||||
if installed_tests and driver_tests_enabled
|
||||
install_data(umockdev_test.full_path(),
|
||||
install_dir: installed_tests_execdir,
|
||||
install_mode: 'rwxr-xr-x',
|
||||
)
|
||||
install_data('capture.py',
|
||||
install_dir: installed_tests_execdir,
|
||||
install_mode: 'rwxr-xr-x',
|
||||
)
|
||||
endif
|
||||
else
|
||||
warning('Skipping all driver tests as introspection bindings are missing')
|
||||
test('virtual-image',
|
||||
@@ -164,7 +248,7 @@ endif
|
||||
unit_tests_deps = { 'fpi-assembling' : [cairo_dep] }
|
||||
|
||||
test_config = configuration_data()
|
||||
test_config.set_quoted('SOURCE_ROOT', meson.source_root())
|
||||
test_config.set_quoted('SOURCE_ROOT', meson.project_source_root())
|
||||
test_config_h = configure_file(output: 'test-config.h', configuration: test_config)
|
||||
|
||||
foreach test_name: unit_tests
|
||||
@@ -197,13 +281,28 @@ foreach test_name: unit_tests
|
||||
sources: [basename + '.c', test_config_h],
|
||||
dependencies: [ libfprint_private_dep ] + extra_deps,
|
||||
c_args: common_cflags,
|
||||
link_with: test_utils,
|
||||
link_whole: test_utils,
|
||||
install: installed_tests,
|
||||
install_dir: installed_tests_execdir,
|
||||
)
|
||||
test(test_name,
|
||||
test_exe,
|
||||
suite: ['unit-tests'],
|
||||
env: envs,
|
||||
)
|
||||
|
||||
configure_file(
|
||||
input: 'test.in',
|
||||
output: test_name + '.test',
|
||||
install: installed_tests,
|
||||
install_dir: installed_tests_testdir,
|
||||
configuration: {
|
||||
'exec': installed_tests_execdir / basename,
|
||||
'env': envs_str,
|
||||
'extra_content': 'TestEnvironment=LD_LIBRARY_PATH=' +
|
||||
installed_tests_libdir,
|
||||
},
|
||||
)
|
||||
endforeach
|
||||
|
||||
# Run udev rule generator with fatal warnings
|
||||
@@ -217,7 +316,7 @@ test('udev-hwdb',
|
||||
gdb = find_program('gdb', required: false)
|
||||
if gdb.found()
|
||||
libfprint_wrapper = [
|
||||
gdb.path(),
|
||||
gdb.full_path(),
|
||||
'-batch',
|
||||
'-ex', 'run',
|
||||
'--args',
|
||||
@@ -234,12 +333,12 @@ valgrind = find_program('valgrind', required: false)
|
||||
if valgrind.found()
|
||||
glib_share = glib_dep.get_pkgconfig_variable('prefix') / 'share' / glib_dep.name()
|
||||
glib_suppressions = glib_share + '/valgrind/glib.supp'
|
||||
libfprint_suppressions = '@0@/@1@'.format(meson.source_root(),
|
||||
libfprint_suppressions = '@0@/@1@'.format(meson.project_source_root(),
|
||||
files('libfprint.supp')[0])
|
||||
python_suppressions = '@0@/@1@'.format(meson.source_root(),
|
||||
python_suppressions = '@0@/@1@'.format(meson.project_source_root(),
|
||||
files('valgrind-python.supp')[0])
|
||||
libfprint_wrapper = [
|
||||
valgrind.path(),
|
||||
valgrind.full_path(),
|
||||
'--tool=memcheck',
|
||||
'--leak-check=full',
|
||||
'--leak-resolution=high',
|
||||
@@ -248,6 +347,7 @@ if valgrind.found()
|
||||
'--track-origins=yes',
|
||||
'--show-leak-kinds=definite,possible',
|
||||
'--show-error-list=yes',
|
||||
'--gen-suppressions=all',
|
||||
'--suppressions=' + libfprint_suppressions,
|
||||
'--suppressions=' + glib_suppressions,
|
||||
'--suppressions=' + python_suppressions,
|
||||
|
||||
@@ -144,8 +144,10 @@ tod_check_device_version (FpDevice *device_class,
|
||||
}
|
||||
|
||||
/* gcc 12.0.1 is complaining about dangling pointers in the auto_close* functions */
|
||||
#if G_GNUC_CHECK_VERSION (12, 0)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdangling-pointer"
|
||||
#endif
|
||||
|
||||
/* Utility functions */
|
||||
|
||||
@@ -187,7 +189,9 @@ auto_close_fake_device_free (FpAutoCloseDevice *device)
|
||||
}
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FpAutoCloseDevice, auto_close_fake_device_free)
|
||||
|
||||
#if G_GNUC_CHECK_VERSION (12, 0)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
typedef FpDeviceClass FpAutoResetClass;
|
||||
static FpAutoResetClass default_fake_dev_class = {0};
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
[Test]
|
||||
Type=session
|
||||
# We can't use TestEnvironment as per
|
||||
# https://gitlab.gnome.org/GNOME/gnome-desktop-testing/-/issues/1
|
||||
Exec=env @env@ @exec@
|
||||
@extra_content@
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
File diff suppressed because one or more lines are too long
@@ -40,6 +40,20 @@
|
||||
fun:_Py*
|
||||
}
|
||||
|
||||
{
|
||||
ignore__py_addr32
|
||||
Memcheck:Addr32
|
||||
...
|
||||
fun:_Py*
|
||||
}
|
||||
|
||||
{
|
||||
ignore__py_addr32
|
||||
Memcheck:Addr32
|
||||
...
|
||||
fun:Py*
|
||||
}
|
||||
|
||||
{
|
||||
ignore_py_leaks
|
||||
Memcheck:Leak
|
||||
|
||||
+132
-75
@@ -59,6 +59,17 @@ class GLibErrorMessage:
|
||||
|
||||
class VirtualDeviceBase(unittest.TestCase):
|
||||
|
||||
DEFAULT_ENROLL_STEPS = 5
|
||||
USE_CLASS_DEVICE = True
|
||||
|
||||
@classmethod
|
||||
def get_device(cls, ctx):
|
||||
for dev in ctx.get_devices():
|
||||
# We might have a USB device in the test system that needs skipping
|
||||
if dev.get_driver() == cls._driver_name:
|
||||
return dev
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
unittest.TestCase.setUpClass()
|
||||
@@ -73,26 +84,28 @@ class VirtualDeviceBase(unittest.TestCase):
|
||||
cls.sockaddr = os.path.join(cls.tmpdir, '{}.socket'.format(sock_name))
|
||||
os.environ['FP_{}'.format(driver_name.upper())] = cls.sockaddr
|
||||
|
||||
cls.ctx = FPrint.Context()
|
||||
cls._driver_name = driver_name
|
||||
|
||||
cls.dev = None
|
||||
for dev in cls.ctx.get_devices():
|
||||
# We might have a USB device in the test system that needs skipping
|
||||
if dev.get_driver() == driver_name:
|
||||
cls.dev = dev
|
||||
break
|
||||
|
||||
assert cls.dev is not None, "You need to compile with {} for testing".format(driver_name)
|
||||
if cls.USE_CLASS_DEVICE:
|
||||
cls.ctx = FPrint.Context()
|
||||
cls.dev = cls.get_device(cls.ctx)
|
||||
assert cls.dev is not None, "You need to compile with {} for testing".format(
|
||||
driver_name)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
shutil.rmtree(cls.tmpdir)
|
||||
del cls.dev
|
||||
del cls.ctx
|
||||
if cls.USE_CLASS_DEVICE:
|
||||
del cls.dev
|
||||
del cls.ctx
|
||||
unittest.TestCase.tearDownClass()
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
if not self.USE_CLASS_DEVICE:
|
||||
self.ctx = FPrint.Context()
|
||||
self.dev = self.get_device(self.ctx)
|
||||
self.assertIsNotNone(self.dev)
|
||||
self._close_on_teardown = True
|
||||
self.assertFalse(self.dev.is_open())
|
||||
self.dev.open_sync()
|
||||
@@ -101,8 +114,13 @@ class VirtualDeviceBase(unittest.TestCase):
|
||||
def tearDown(self):
|
||||
if self._close_on_teardown:
|
||||
self.assertTrue(self.dev.is_open())
|
||||
self.set_keep_alive(False)
|
||||
self.send_command('SET_ENROLL_STAGES', self.DEFAULT_ENROLL_STEPS)
|
||||
self.dev.close_sync()
|
||||
self.assertFalse(self.dev.is_open())
|
||||
if not self.USE_CLASS_DEVICE:
|
||||
del self.dev
|
||||
del self.ctx
|
||||
super().tearDown()
|
||||
|
||||
def wait_timeout(self, interval):
|
||||
@@ -331,6 +349,107 @@ class VirtualDeviceBase(unittest.TestCase):
|
||||
self.assertEqual(self._verify_fp.props.fpi_data.get_string(), scan_nick)
|
||||
|
||||
|
||||
class VirtualDeviceUnplugging(VirtualDeviceBase):
|
||||
|
||||
driver_name = 'virtual_device'
|
||||
USE_CLASS_DEVICE = False
|
||||
|
||||
def test_device_unplug(self):
|
||||
self._close_on_teardown = False
|
||||
notified_spec = None
|
||||
def on_removed_notify(dev, spec):
|
||||
nonlocal notified_spec
|
||||
notified_spec = spec
|
||||
|
||||
removed = False
|
||||
ctx_removed = False
|
||||
|
||||
def on_ctx_removed(ctx, dev):
|
||||
nonlocal ctx_removed
|
||||
ctx_removed = dev == self.dev
|
||||
self.assertEqual(removed, ctx_removed)
|
||||
|
||||
def on_removed(dev):
|
||||
nonlocal removed
|
||||
removed = dev.props.removed
|
||||
self.assertNotEqual(removed, ctx_removed)
|
||||
|
||||
self.assertFalse(self.dev.props.removed)
|
||||
|
||||
self.dev.connect('notify::removed', on_removed_notify)
|
||||
self.ctx.connect('device-removed', on_ctx_removed)
|
||||
self.dev.connect('removed', on_removed)
|
||||
self.send_command('UNPLUG')
|
||||
self.assertEqual(notified_spec.name, 'removed')
|
||||
self.assertTrue(self.dev.props.removed)
|
||||
self.assertIn(self.dev, self.ctx.get_devices())
|
||||
self.assertTrue(removed)
|
||||
|
||||
with self.assertRaises(GLib.GError) as error:
|
||||
self.dev.close_sync()
|
||||
self.assertTrue(error.exception.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.REMOVED))
|
||||
|
||||
while not ctx_removed:
|
||||
ctx.iteration(True)
|
||||
|
||||
self.assertNotIn(self.dev, self.ctx.get_devices())
|
||||
|
||||
def test_device_unplug_during_verify(self):
|
||||
self._close_on_teardown = False
|
||||
self._destroy_on_teardown = True
|
||||
|
||||
notified_spec = None
|
||||
def on_removed_notify(dev, spec):
|
||||
nonlocal notified_spec
|
||||
notified_spec = spec
|
||||
|
||||
removed = False
|
||||
ctx_removed = False
|
||||
|
||||
def on_ctx_removed(ctx, dev):
|
||||
nonlocal ctx_removed
|
||||
ctx_removed = dev == self.dev
|
||||
self.assertEqual(removed, ctx_removed)
|
||||
|
||||
def on_removed(dev):
|
||||
nonlocal removed
|
||||
removed = dev.props.removed
|
||||
self.assertNotEqual(removed, ctx_removed)
|
||||
|
||||
self.assertFalse(self.dev.props.removed)
|
||||
self.dev.connect('notify::removed', on_removed_notify)
|
||||
self.ctx.connect('device-removed', on_ctx_removed)
|
||||
self.dev.connect('removed', on_removed)
|
||||
|
||||
self.start_verify(FPrint.Print.new(self.dev),
|
||||
identify=self.dev.supports_identify())
|
||||
|
||||
self.send_command('UNPLUG')
|
||||
self.assertEqual(notified_spec.name, 'removed')
|
||||
self.assertTrue(self.dev.props.removed)
|
||||
self.assertIn(self.dev, self.ctx.get_devices())
|
||||
self.assertFalse(removed)
|
||||
|
||||
with self.assertRaises(GLib.GError) as error:
|
||||
self.complete_verify()
|
||||
self.assertTrue(error.exception.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.REMOVED))
|
||||
|
||||
self.assertTrue(removed)
|
||||
self.assertIn(self.dev, self.ctx.get_devices())
|
||||
|
||||
with self.assertRaises(GLib.GError) as error:
|
||||
self.dev.close_sync()
|
||||
self.assertTrue(error.exception.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.REMOVED))
|
||||
|
||||
while not ctx_removed:
|
||||
ctx.iteration(True)
|
||||
|
||||
self.assertNotIn(self.dev, self.ctx.get_devices())
|
||||
|
||||
|
||||
class VirtualDevice(VirtualDeviceBase):
|
||||
|
||||
def test_device_properties(self):
|
||||
@@ -339,7 +458,8 @@ class VirtualDevice(VirtualDeviceBase):
|
||||
self.assertEqual(self.dev.get_name(), 'Virtual device for debugging')
|
||||
self.assertTrue(self.dev.is_open())
|
||||
self.assertEqual(self.dev.get_scan_type(), FPrint.ScanType.SWIPE)
|
||||
self.assertEqual(self.dev.get_nr_enroll_stages(), 5)
|
||||
self.assertEqual(self.dev.get_nr_enroll_stages(),
|
||||
self.DEFAULT_ENROLL_STEPS)
|
||||
self.assertFalse(self.dev.supports_identify())
|
||||
self.assertFalse(self.dev.supports_capture())
|
||||
self.assertFalse(self.dev.has_storage())
|
||||
@@ -700,69 +820,6 @@ class VirtualDevice(VirtualDeviceBase):
|
||||
self.assertEqual(self.dev.get_scan_type(), FPrint.ScanType.SWIPE)
|
||||
self.assertIsNone(notified_spec)
|
||||
|
||||
def test_device_unplug(self):
|
||||
self._close_on_teardown = False
|
||||
notified_spec = None
|
||||
def on_removed_notify(dev, spec):
|
||||
nonlocal notified_spec
|
||||
notified_spec = spec
|
||||
|
||||
removed = False
|
||||
def on_removed(dev):
|
||||
nonlocal removed
|
||||
removed = True
|
||||
|
||||
self.assertFalse(self.dev.props.removed)
|
||||
|
||||
self.dev.connect('notify::removed', on_removed_notify)
|
||||
self.dev.connect('removed', on_removed)
|
||||
self.send_command('UNPLUG')
|
||||
self.assertEqual(notified_spec.name, 'removed')
|
||||
self.assertTrue(self.dev.props.removed)
|
||||
self.assertTrue(removed)
|
||||
|
||||
with self.assertRaises(GLib.GError) as error:
|
||||
self.dev.close_sync()
|
||||
self.assertTrue(error.exception.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.REMOVED))
|
||||
|
||||
def test_device_unplug_during_verify(self):
|
||||
self._close_on_teardown = False
|
||||
|
||||
notified_spec = None
|
||||
def on_removed_notify(dev, spec):
|
||||
nonlocal notified_spec
|
||||
notified_spec = spec
|
||||
|
||||
removed = False
|
||||
def on_removed(dev):
|
||||
nonlocal removed
|
||||
removed = True
|
||||
|
||||
self.assertFalse(self.dev.props.removed)
|
||||
self.dev.connect('notify::removed', on_removed_notify)
|
||||
self.dev.connect('removed', on_removed)
|
||||
|
||||
self.start_verify(FPrint.Print.new(self.dev),
|
||||
identify=self.dev.supports_identify())
|
||||
|
||||
self.send_command('UNPLUG')
|
||||
self.assertEqual(notified_spec.name, 'removed')
|
||||
self.assertTrue(self.dev.props.removed)
|
||||
self.assertFalse(removed)
|
||||
|
||||
with self.assertRaises(GLib.GError) as error:
|
||||
self.complete_verify()
|
||||
self.assertTrue(error.exception.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.REMOVED))
|
||||
|
||||
self.assertTrue(removed)
|
||||
|
||||
with self.assertRaises(GLib.GError) as error:
|
||||
self.dev.close_sync()
|
||||
self.assertTrue(error.exception.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.REMOVED))
|
||||
|
||||
def test_device_sleep(self):
|
||||
self.send_sleep(1500)
|
||||
|
||||
|
||||
+10
-5
@@ -46,12 +46,15 @@ def load_image(img):
|
||||
|
||||
return img
|
||||
|
||||
if hasattr(os.environ, 'MESON_SOURCE_ROOT'):
|
||||
root = os.environ['MESON_SOURCE_ROOT']
|
||||
if 'FP_PRINTS_PATH' in os.environ:
|
||||
prints_path = os.environ['FP_PRINTS_PATH']
|
||||
else:
|
||||
root = os.path.join(os.path.dirname(__file__), '..')
|
||||
if 'MESON_SOURCE_ROOT' in os.environ:
|
||||
root = os.environ['MESON_SOURCE_ROOT']
|
||||
else:
|
||||
root = os.path.join(os.path.dirname(__file__), '..')
|
||||
|
||||
imgdir = os.path.join(root, 'examples', 'prints')
|
||||
prints_path = os.path.join(root, 'examples', 'prints')
|
||||
|
||||
ctx = GLib.main_context_default()
|
||||
|
||||
@@ -76,10 +79,12 @@ class VirtualImage(unittest.TestCase):
|
||||
assert cls.dev is not None, "You need to compile with virtual_image for testing"
|
||||
|
||||
cls.prints = {}
|
||||
for f in glob.glob(os.path.join(imgdir, '*.png')):
|
||||
for f in glob.glob(os.path.join(prints_path, '*.png')):
|
||||
n = os.path.basename(f)[:-4]
|
||||
cls.prints[n] = load_image(f)
|
||||
|
||||
assert cls.prints, "No prints found in " + prints_path
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
shutil.rmtree(cls.tmpdir)
|
||||
|
||||
Reference in New Issue
Block a user