fingerprint_mcu¶
Source code: fingerprint_mcu.py
A factory test for the Fingerprint sensor.
Description¶
Tests that the fingerprint sensor is connected properly and has no defect by executing commands through the fingerprint micro-controller.
Test Procedure¶
The sensor must not be pressed until the test shows instruction on the UI.
Test performs automated test (e.g. pixel median) without user interaction.
If number_of_manual_captures is not 0, then an operator or a fixture must pressed a rubber finger or a real finger against the sensor.
If rubber_finger_present is true, then an operator or a fixture must pressed a rubber finger against the sensor to calculate the SNR.
The test fails if any of above three tests is marked as failed.
Dependency¶
The pytest supposes that the system as a fingerprint MCU exposed through the
kernel cros_ec driver as /dev/cros_fp
.
When available, it uses the vendor ‘libfputils’ shared library and its Python helper to display the captured image and compute the image quality signal-to-noise ratio.
Examples¶
Minimum runnable example to check if the fingerprint sensor is connected properly and fits the default quality settings:
{
"pytest_name": "fingerprint_mcu",
"label": "Fingerprint Sensor test",
"run_if": "device.component.has_fingerprint",
"related_components": [
"test_tags.TestCategory.FINGERPRINT_SENSOR"
],
"args": {
"fpframe_retry_count": 2
}
}
To check if the sensor has at most 10 dead pixels, with bounds for the pixel grayscale median values and finger detection zones, add this in test list:
{
"pytest_name": "fingerprint_mcu",
"label": "Fingerprint Sensor test plus pixel median test for Dartmonkey",
"run_if": "device.component.has_fingerprint",
"related_components": [
"test_tags.TestCategory.FINGERPRINT_SENSOR"
],
"args": {
"fpframe_retry_count": 2,
"max_dead_pixels": 10,
"pixel_median": {
"cb_type1": [
180,
220
],
"cb_type2": [
80,
120
],
"icb_type1": [
15,
70
],
"icb_type2": [
155,
210
]
},
"detect_zones": [
[
8,
16,
15,
23
],
[
24,
16,
31,
23
],
[
40,
16,
47,
23
],
[
8,
66,
15,
73
],
[
24,
66,
31,
73
],
[
40,
66,
47,
73
],
[
8,
118,
15,
125
],
[
24,
118,
31,
125
],
[
40,
118,
47,
125
],
[
8,
168,
15,
175
],
[
24,
168,
31,
175
],
[
40,
168,
47,
175
]
]
}
}
To show 10 captures on the screen:
{
"pytest_name": "fingerprint_mcu",
"label": "Fingerprint Sensor test plus manual test",
"run_if": "device.component.has_fingerprint",
"related_components": [
"test_tags.TestCategory.FINGERPRINT_SENSOR"
],
"args": {
"fpframe_retry_count": 2,
"number_of_manual_captures": 10
}
}
To test SNR value with a rubber stamp. Only work for Dartmonkey, see b/180757318 for more info:
{
"pytest_name": "fingerprint_mcu",
"label": "Fingerprint Sensor test plus rubber stamper test",
"run_if": "device.component.has_fingerprint",
"related_components": [
"test_tags.TestCategory.FINGERPRINT_SENSOR"
],
"args": {
"fpframe_retry_count": 2,
"rubber_finger_present": true
}
}
Test Arguments¶
Name |
Type |
Description |
---|---|---|
max_dead_pixels |
int |
(optional; default: |
max_dead_detect_pixels |
int |
(optional; default: |
max_pixel_dev |
int |
(optional; default: |
pixel_median |
dict |
(optional; default: |
detect_zones |
list |
(optional; default: |
min_snr |
float |
(optional; default: |
rubber_finger_present |
bool |
(optional; default: |
max_reset_pixel_dev |
int |
(optional; default: |
max_error_reset_pixels |
int |
(optional; default: |
fpframe_retry_count |
int |
(optional; default: |
number_of_manual_captures |
int |
(optional; default: |
timeout_secs |
int |
(optional; default: |
ignore_waitevent_timeout_error |
bool |
(optional; default: |