Feature #5666

Test suite: reliably wait for post-Greeter hooks

Added by Tails 2013-07-18 07:44:16 . Updated 2020-04-15 06:05:21 .

Status:
Resolved
Priority:
High
Assignee:
Category:
Test suite
Target version:
Start date:
Due date:
2016-07-31
% Done:

100%

Feature Branch:
test/5666-wait-for-greeter-PostLogin
Type of work:
Code
Blueprint:

Starter:
0
Affected tool:
Welcome Screen
Deliverable for:
270

Description

In the 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.


Subtasks


History

#1 Updated by intrigeri 2013-10-04 07:21:00

  • Category set to Test suite
  • Starter set to No

#2 Updated by BitingBird 2014-06-09 11:02:22

  • Subject changed from test suite: reliably wait for post tails-greeter hooks to Test suite: reliably wait for post tails-greeter hooks

#3 Updated by intrigeri 2014-07-19 20:13:02

  • Subject changed from Test suite: reliably wait for post tails-greeter hooks to Test suite: reliably wait for post-Greeter hooks

#4 Updated by BitingBird 2015-01-07 18:14:39

  • Affected tool set to Greeter

#5 Updated by anonym 2015-01-10 06:39:47

  • Target version set to Tails_2.4

#6 Updated by anonym 2015-01-10 17:16:55

  • blocks #8668 added

#7 Updated by intrigeri 2015-08-02 11:07:22

  • Due date set to 2016-07-31

#9 Updated by anonym 2015-09-26 08:55:10

  • Assignee set to anonym

Alternatively we modify these tests so they are done as a user would do them, i.e. not via the remote shell, but via gnome-terminal. Or we do it with the remote shell, but after the the Tails desktop is ready step.

#10 Updated by anonym 2016-05-10 07:35:53

  • Deliverable for changed from 270 to SponsorS_Internal

#11 Updated by intrigeri 2016-05-10 07:41:55

  • Priority changed from Normal to Elevated
  • Deliverable for changed from SponsorS_Internal to 270

#13 Updated by intrigeri 2016-05-18 13:20:07

  • Priority changed from Elevated to High

#14 Updated by anonym 2016-06-08 01:34:51

  • Target version changed from Tails_2.4 to Tails_2.5

#15 Updated by intrigeri 2016-07-21 06:22:16

  • 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[2144]: Leaving PostLogin
Jul 21 13:13:33 amnesia gdm-autologin][2144]: pam_unix(gdm-autologin:session): session opened for user amnesia by (unknown)(uid=0)
Jul 21 13:13:33 amnesia systemd-logind[1692]: 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 logind.

We can either poll using loginctl, or subscribe to some D-Bus signal.

Also, thanks to commit: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 2016-09-02 02:48:03

  • 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!).

#17 Updated by intrigeri 2016-09-02 03:24:44

  • Assignee changed from intrigeri to bertagaz

Reassigning to bertagaz, who committed to do quick reviews for anonym’s test suite stuff.

#18 Updated by intrigeri 2016-09-09 14:48:52

Ping?

#19 Updated by anonym 2016-09-20 16:53:33

  • Target version changed from Tails_2.6 to Tails_2.7

#20 Updated by bertagaz 2016-10-08 13:03:29

  • Status changed from In Progress to Fix committed
  • % Done changed from 50 to 100

Applied in changeset commit:60140f3ca76aef3dce3fa48e06b6ba3b6c692c68.

#21 Updated by bertagaz 2016-10-08 13:05:47

  • Assignee deleted (bertagaz)
  • QA Check changed from Ready for QA to Pass

bertagaz wrote:
> Applied in changeset commit:60140f3ca76aef3dce3fa48e06b6ba3b6c692c68.

intrigeri wrote:
> 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 Bug #11816. So it’s now merged, congrats!

#22 Updated by bertagaz 2016-11-15 18:23:30

  • Status changed from Fix committed to Resolved

#23 Updated by intrigeri 2020-04-15 06:05:21

  • Affected tool changed from Greeter to Welcome Screen