Test suite: reliably wait for post-Greeter hooks
I log in to a new session step we should do something which waits for all Tails Greeter post-hooks to finish so we can rid ourselves of steps like
Tails Greeter has dealt with the sudo password.
This may include making changes to Tails Greeter, e.g. having it create a file when it's done that we can wait for in the end of the
I log in to a new session step.
It may be that opening a new GNOME session (which happens right after tails-greeter is done IIRC) creates such a file that we could poll for.
Reliably wait for the Greeter's PostLogin script.
Historically we've tried to e.g. use the sudo password before it has
been properly set, so let's introduce a step that explicitly waits for
the PostLogin script to finish, which is implied by a logind session
having been opened for the LIVE_USER.
#15 Updated by intrigeri over 3 years ago
- Status changed from Confirmed to In Progress
- Target version changed from Tails_2.5 to Tails_2.6
- % Done changed from 0 to 10
It seems that a session being registered with
systemd-logind for the "amnesia" user is precisely the signal we must wait for, as GDM tells PAM that the session is open only after
PostLogin has exited:
Jul 21 13:13:33 amnesia gdm-session-worker: Leaving PostLogin Jul 21 13:13:33 amnesia gdm-autologin]: pam_unix(gdm-autologin:session): session opened for user amnesia by (unknown)(uid=0) Jul 21 13:13:33 amnesia systemd-logind: New session 1 of user amnesia.
Note that some PAM sessions are open earlier as user "amnesia", but they are non-interactive sudo calls, and are thus not registered with
We can either poll using
loginctl, or subscribe to some D-Bus signal.
Also, thanks to fc777723 that we did in May, the "Tails Greeter has dealt with the sudo password" step is now run from one single place, which eases reasoning about this problem a lot :)
#16 Updated by anonym over 3 years ago
- Assignee changed from anonym to intrigeri
- % Done changed from 10 to 50
- QA Check set to Ready for QA
- Feature Branch set to test/5666-wait-for-greeter-PostLogin
Thanks for the suggestion, intrigeri!
Since you proposed this approach (=> you know the details already and hence only have to check the implementation), would you mind review'n'merging? Otherwise please reassign it to me so I can find someone else (hah!).
#21 Updated by bertagaz over 3 years ago
- Assignee deleted (
- QA Check changed from Ready for QA to Pass
Applied in changeset 60140f3ca76aef3dce3fa48e06b6ba3b6c692c68.
Reassigning to bertagaz, who committed to do quick reviews for anonym's test suite stuff.
Ran it extensively and it does seem to work well. It does feel more robust. On Jenkins the only time there are related failures, that's because of #11816. So it's now merged, congrats!