14 initialPassword = passwd;
16 expires = "1990-01-01";
19 initialPassword = passwd;
21 expires = "2990-01-01";
24 initialPassword = passwd;
32 def switch_to_tty(tty_number):
33 machine.fail(f"pgrep -f 'agetty.*tty{tty_number}'")
34 machine.send_key(f"alt-f{tty_number}")
35 machine.wait_until_succeeds(f"[ $(fgconsole) = {tty_number} ]")
36 machine.wait_for_unit(f"getty@tty{tty_number}.service")
37 machine.wait_until_succeeds(f"pgrep -f 'agetty.*tty{tty_number}'")
40 machine.wait_for_unit("multi-user.target")
41 machine.wait_for_unit("getty@tty1.service")
43 with subtest("${alice} cannot login"):
44 machine.wait_until_tty_matches("1", "login: ")
45 machine.send_chars("${alice}\n")
46 machine.wait_until_tty_matches("1", "Password: ")
47 machine.send_chars("${passwd}\n")
49 machine.wait_until_succeeds("journalctl --grep='account ${alice} has expired \\(account expired\\)'")
50 machine.wait_until_tty_matches("1", "login: ")
52 with subtest("${bob} can login"):
54 machine.wait_until_tty_matches("2", "login: ")
55 machine.send_chars("${bob}\n")
56 machine.wait_until_tty_matches("2", "Password: ")
57 machine.send_chars("${passwd}\n")
59 machine.wait_until_succeeds("pgrep -u ${bob} bash")
61 with subtest("${eve} can login"):
63 machine.wait_until_tty_matches("3", "login: ")
64 machine.send_chars("${eve}\n")
65 machine.wait_until_tty_matches("3", "Password: ")
66 machine.send_chars("${passwd}\n")
68 machine.wait_until_succeeds("pgrep -u ${eve} bash")