Skip to content

Conversation

@binli
Copy link
Contributor

@binli binli commented Nov 6, 2023

$ sudo env | grep SUDO
SUDO_COMMAND=/usr/bin/env
SUDO_USER=ubuntu
SUDO_UID=1001
SUDO_GID=1001

when running checkbox with sudo, it will 'fprintd-enroll 1001' and the test case will lock screen to let 'ubuntu' user to login, but at that time, it will not work because the user is not 'ubuntu'.

Description

Resolved issues

Documentation

Tests

@codecov
Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Merging #813 (bf2d4f3) into main (219a9de) will not change coverage.
Report is 1 commits behind head on main.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #813   +/-   ##
=======================================
  Coverage   35.25%   35.25%           
=======================================
  Files         302      302           
  Lines       34173    34173           
  Branches     5907     5907           
=======================================
  Hits        12048    12048           
  Misses      21559    21559           
  Partials      566      566           
Flag Coverage Δ
provider-base 4.16% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@binli binli force-pushed the fprintd-uid branch 4 times, most recently from e352a03 to b5a58ef Compare November 7, 2023 07:24
@pieqq
Copy link
Collaborator

pieqq commented Nov 7, 2023

/canonical/self-hosted-runners/run-workflows b5a58ef

@pieqq pieqq changed the title fprintd should enroll to a user while not uid. fprintd should enroll a user, not a uid (BugFix) Nov 7, 2023
@binli
Copy link
Contributor Author

binli commented Nov 7, 2023

/canonical/self-hosted-runners/run-workflows bf2d4f3

@binli
Copy link
Contributor Author

binli commented Nov 7, 2023

@pieqq hi, the title sounds good in my side, do you know why the failure of 'PR Validation'? Thanks!

$ echo "fprintd should enroll a user, not a uid (BugFix)" | grep -iP "((infra|bugfix|new|breaking))$"
fprintd should enroll a user, not a uid (BugFix)

$ sudo env | grep SUDO
SUDO_COMMAND=/usr/bin/env
SUDO_USER=ubuntu
SUDO_UID=1001
SUDO_GID=1001

when running checkbox with sudo, it will 'fprintd-enroll 1001'
and the test case will lock screen to let 'ubuntu' user to login,
but at that time, it will not work because the user is not 'ubuntu'.
@pieqq
Copy link
Collaborator

pieqq commented Nov 7, 2023

/canonical/self-hosted-runners/run-workflows bf2d4f3

@pieqq
Copy link
Collaborator

pieqq commented Nov 7, 2023

It's because we use self-hosted runners and they require some manual steps from people in the Cert team when someone submits their first PR... It should be fixed now.

I tried your PR with a laptop, but I couldn't get the fingerprint tests to work. I'll check again with another laptop tomorrow.

Quick question, what do you mean when you say "when running checkbox with sudo"? Do you run sudo checkbox-cli? Or do you run the job, and the job is using user: root so you know Checkbox runs this as sudo?

@binli
Copy link
Contributor Author

binli commented Nov 7, 2023

@pieqq Oh, got it, thanks! And we met this issue when QA do finger printer test by manual, I need confirm with @eugene-yujinwu .
@eugene-yujinwu Do you run sudo checkbox-cli?

@eugene-yujinwu
Copy link
Contributor

@binli @pieqq , actually this test case always run by root,
"id: fingerprint/detect
flags: also-after-suspend
user: root
command: fprintd-list "${SUDO_UID:-$NORMAL_USER}"
so it will always use SUDO_UID other than NORMAL_USER.

@binli
Copy link
Contributor Author

binli commented Nov 7, 2023

@pieqq
I enrolled the right-inde-finger and the original test result sounds not correct.

$ checkbox-cli run com.canonical.certification::fingerprint-full

------------[ Check if at least one fingerprint reader is detected ]------------                                                        
ID: com.canonical.certification::fingerprint/detect                                                                                     
Category: com.canonical.plainbox::fingerprint                       
... 8< -------------------------------------------------------------------------
Enter sudo password:                                                                                                                    
                                  
found 1 devices
Device at /net/reactivated/Fprint/Device/0
Using device /net/reactivated/Fprint/Device/0                       
User 1000 has no fingers enrolled for Synaptics Sensors.            
------------------------------------------------------------------------- >8 ---
Outcome: job passed      
Finalizing session that hasn't been submitted anywhere: checkbox-run-2023-11-07T11.47.29

With this patch, the result will be good.

Outcome: job passed
==============[ Running job 2 / 2. Estimated time left: 0:00:01 ]===============
------------[ Check if at least one fingerprint reader is detected ]------------
ID: com.canonical.certification::fingerprint/detect
Category: com.canonical.plainbox::fingerprint
... 8< -------------------------------------------------------------------------
Enter sudo password:

found 1 devices
Device at /net/reactivated/Fprint/Device/0
Using device /net/reactivated/Fprint/Device/0
Fingerprints for user binli on Synaptics Sensors (press):
 - #0: right-index-finger

Copy link
Collaborator

@pieqq pieqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the look of it and the outcome provided, it looks all good. Sorry for the long delay in approving this!

@pieqq pieqq merged commit 72fbb87 into canonical:main Jan 10, 2024
LiaoU3 pushed a commit to LiaoU3/checkbox that referenced this pull request Mar 20, 2024
fprintd should enroll to a user while not uid. (BugFix) (canonical#813)
$ sudo env | grep SUDO
SUDO_COMMAND=/usr/bin/env
SUDO_USER=ubuntu
SUDO_UID=1001
SUDO_GID=1001

when running checkbox with sudo, it will 'fprintd-enroll 1001'
and the test case will lock screen to let 'ubuntu' user to login,
but at that time, it will not work because the user is not 'ubuntu'.
binli added a commit to binli/checkbox that referenced this pull request Mar 22, 2024
fprintd should enroll to a user while not uid. (BugFix) (canonical#813)
$ sudo env | grep SUDO
SUDO_COMMAND=/usr/bin/env
SUDO_USER=ubuntu
SUDO_UID=1001
SUDO_GID=1001

when running checkbox with sudo, it will 'fprintd-enroll 1001'
and the test case will lock screen to let 'ubuntu' user to login,
but at that time, it will not work because the user is not 'ubuntu'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants