Merge ~andch/plainbox-provider-pc-sanity:check-fingerprint-device into plainbox-provider-pc-sanity:master

Proposed by Andy Chi
Status: Needs review
Proposed branch: ~andch/plainbox-provider-pc-sanity:check-fingerprint-device
Merge into: plainbox-provider-pc-sanity:master
Diff against target: 89 lines (+59/-0)
3 files modified
bin/detect-fingerprint.sh (+46/-0)
units/pc-sanity/pc-sanity-fingerprint.pxu (+11/-0)
units/pc-sanity/pc-sanity.pxu (+2/-0)
Reviewer Review Type Date Requested Status
jeremyszu (community) Needs Fixing
Alex Tu Pending
Kai-Chuan Hsieh Pending
OEM Solutions Group: Engineers Pending
Review via email: mp+416203@code.launchpad.net

Commit message

Add test case to check if USB fingerprint device is supported in upstream and ubuntu release libfprint or not.

Test on Synaptics DUT.

Case 1: Upstream supported but not in ubuntu release package
Category: com.canonical.plainbox::miscellanea
... 8< -------------------------------------------------------------------------
--2022-03-01 22:56:41-- https://raw.githubusercontent.com/freedesktop/libfprint/master/data/autosuspend.hwdb
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 2606:50c0:8003::154, 2606:50c0:8002::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5720 (5.6K) [text/plain]
Saving to: ‘/tmp/autosuspend.hwdb’

     0K ..... 100% 37.4M=0s

2022-03-01 22:56:41 (37.4 MB/s) - ‘/tmp/autosuspend.hwdb’ saved [5720/5720]

Device ID 06cbp00f0 is supported in upstream
Please start SRU process to land the ID into current Release version
------------------------------------------------------------------------- >8 ---
Outcome: job failed
Finalizing session that hasn't been submitted anywhere: checkbox-run-2022-03-01T14.56.41
==================================[ Results ]===================================
 ☑ : Collect information about installed software packages
 ☒ : Check USB fingerprint device is supported or not.

Case 2: upstream supported and also ubuntu release package
--2022-03-01 22:58:20-- https://raw.githubusercontent.com/freedesktop/libfprint/master/data/autosuspend.hwdb
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.108.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5720 (5.6K) [text/plain]
Saving to: ‘/tmp/autosuspend.hwdb’

     0K ..... 100% 36.8M=0s

2022-03-01 22:58:21 (36.8 MB/s) - ‘/tmp/autosuspend.hwdb’ saved [5720/5720]

Device ID 27c6p63ac is supported in upstream
ID is supported in current libfprint
------------------------------------------------------------------------- >8 ---
Outcome: job passed
Finalizing session that hasn't been submitted anywhere: checkbox-run-2022-03-01T14.58.20
==================================[ Results ]===================================
 ☑ : Collect information about installed software packages
 ☑ : Check USB fingerprint device is supported or not.

To post a comment you must log in.
Revision history for this message
jeremyszu (os369510) wrote :

Please also ensure the variable is there before use.

review: Needs Fixing
Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :
Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :
Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
blame: .
badpkg: rules build failed with exit code 2
erroneous package: rules build failed with exit code 2

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/plainbox-provider-pc-sanity/plainbox-provider-pc-sanity-1.0.1ubuntu1-b2d8b91-in-linux-container-jammy

Unmerged commits

b2d8b91... by Andy Chi

Add test case to check if device support fingerprint or not.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/detect-fingerprint.sh b/bin/detect-fingerprint.sh
0new file mode 1007550new file mode 100755
index 0000000..0e314e4
--- /dev/null
+++ b/bin/detect-fingerprint.sh
@@ -0,0 +1,46 @@
1#!/bin/bash
2
3UPSTREAM_SUPPORT=0
4UBUNTU_RELEASE_SUPPORT=0
5FINGERPRINT_ID=$(lsusb | grep -E "Goodix|Synaptics|Elan" | cut -d " " -f 6 | tr ':' 'p')
6LIBFPRINT_VERSION=$(dpkg -l | grep libfprint-2-2 | awk '{print $3}')
7
8# Clone get device list from libfprint upstream
9wget --tries=5 --timeout=60 https://raw.githubusercontent.com/freedesktop/libfprint/master/data/autosuspend.hwdb -P /tmp
10[ ! -f /tmp/autosuspend.hwdb ] && echo "No upstream file" && exit 0
11
12if [[ "$LIBFPRINT_VERSION" =~ "1:1.90.2+tod1-0ubuntu1".* ]]; then
13 LIBFPRINT_SUPPORT_LIST=$(< /lib/udev/rules.d/60-libfprint-2.rules grep "ENV{LIBFPRINT_DRIVER}" | cut -d ',' -f 3 | cut -d '=' -f 3 | sed 's/"//g' | tr '[:upper:]' '[:lower:]')
14else
15 LIBFPRINT_SUPPORT_LIST=$(< /lib/udev/hwdb.d/60-autosuspend-libfprint-2.hwdb grep usb | cut -d ":" -f 2 | cut -d "p" -f 2 | sed 's/*$//g' | tr '[:upper:]' '[:lower:]')
16fi
17
18for upstream_support_id in $(< /tmp/autosuspend.hwdb grep usb | cut -d ":" -f 2 | tr '[:upper:]' '[:lower:]')
19do
20 if [ "${upstream_support_id:1:9}" = "${FINGERPRINT_ID}" ]; then
21 UPSTREAM_SUPPORT=1
22 echo "Device ID ${FINGERPRINT_ID} is supported in upstream"
23 fi
24done
25
26for local_support_id in ${LIBFPRINT_SUPPORT_LIST}
27do
28 if [ "${local_support_id}" = "${FINGERPRINT_ID:5:4}" ]; then
29 UBUNTU_RELEASE_SUPPORT=1
30 echo "ID is supported in current libfprint"
31 fi
32done
33
34rm -rf /tmp/autosuspend.hwdb
35
36if [ $UPSTREAM_SUPPORT -eq 1 ] && [ $UBUNTU_RELEASE_SUPPORT -eq 1 ]; then
37 exit 0
38
39elif [ $UPSTREAM_SUPPORT -eq 1 ] && [ $UBUNTU_RELEASE_SUPPORT -eq 0 ]; then
40 echo "Please start SRU process to land the ID into current Release version"
41 exit 1
42
43elif [ $UPSTREAM_SUPPORT -eq 0 ]; then
44 echo "Please ask ODM to request fingerprint vendor to support in upstream"
45 exit 1
46fi
diff --git a/units/pc-sanity/pc-sanity-fingerprint.pxu b/units/pc-sanity/pc-sanity-fingerprint.pxu
0new file mode 10064447new file mode 100644
index 0000000..f25bc9c
--- /dev/null
+++ b/units/pc-sanity/pc-sanity-fingerprint.pxu
@@ -0,0 +1,11 @@
1plugin: shell
2category_id: com.canonical.plainbox::miscellanea
3id: miscellanea/fingerprint-id-support
4requires:
5 package.name == 'libfprint-2-2'
6 package.name == 'wget'
7command: detect-fingerprint.sh
8_summary: Check USB fingerprint device is supported or not.
9_description:
10 Check USB fingerprint device is supported or not. Start SRU process or need
11 ODM to ask vendor to upstream their device.
diff --git a/units/pc-sanity/pc-sanity.pxu b/units/pc-sanity/pc-sanity.pxu
index bdf203d..db0546c 100644
--- a/units/pc-sanity/pc-sanity.pxu
+++ b/units/pc-sanity/pc-sanity.pxu
@@ -48,6 +48,7 @@ include:
48 com.canonical.certification::miscellanea/check_.*_start_rt_ucode_failed48 com.canonical.certification::miscellanea/check_.*_start_rt_ucode_failed
49 com.canonical.certification::miscellanea/check_.*_start_wm_firmware_failed49 com.canonical.certification::miscellanea/check_.*_start_wm_firmware_failed
50 com.canonical.certification::miscellanea/check_.*_wifi6e_enabled50 com.canonical.certification::miscellanea/check_.*_wifi6e_enabled
51 com.canonical.certification::miscellanea/fingerprint-id-support
51exclude:52exclude:
52 com.canonical.certification::suspend/bluetooth_obex_send_before_suspend53 com.canonical.certification::suspend/bluetooth_obex_send_before_suspend
53 com.canonical.certification::suspend/bluetooth_obex_send_after_suspend_auto54 com.canonical.certification::suspend/bluetooth_obex_send_after_suspend_auto
@@ -111,6 +112,7 @@ include:
111 com.canonical.certification::miscellanea/check_.*_start_rt_ucode_failed112 com.canonical.certification::miscellanea/check_.*_start_rt_ucode_failed
112 com.canonical.certification::miscellanea/check_.*_start_wm_firmware_failed113 com.canonical.certification::miscellanea/check_.*_start_wm_firmware_failed
113 com.canonical.certification::miscellanea/check_.*_wifi6e_enabled114 com.canonical.certification::miscellanea/check_.*_wifi6e_enabled
115 com.canonical.certification::miscellanea/fingerprint-id-support
114exclude:116exclude:
115 com.canonical.certification::after-suspend-bluetooth4/beacon_.*117 com.canonical.certification::after-suspend-bluetooth4/beacon_.*
116 com.canonical.certification::bluetooth4/beacon_eddystone.*118 com.canonical.certification::bluetooth4/beacon_eddystone.*

Subscribers

People subscribed via source and target branches