Skip to content

Commit

Permalink
tests/shadow: Improve
Browse files Browse the repository at this point in the history
On slow hardware, the test was flaky.
This improves it.
  • Loading branch information
NeQuissimus committed Dec 23, 2020
1 parent 9f371ad commit 1d364e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nixos/tests/shadow.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ in import ./make-test-python.nix ({ pkgs, ... }: {
shadow.send_chars("emma\n")
shadow.wait_until_tty_matches(2, "login: emma")
shadow.wait_until_succeeds("pgrep login")
shadow.sleep(2)
shadow.send_chars("${password1}\n")
shadow.send_chars("whoami > /tmp/1\n")
shadow.wait_for_file("/tmp/1")
Expand All @@ -49,6 +50,7 @@ in import ./make-test-python.nix ({ pkgs, ... }: {
shadow.send_chars("emma\n")
shadow.wait_until_tty_matches(3, "login: emma")
shadow.wait_until_succeeds("pgrep login")
shadow.sleep(2)
shadow.send_chars("${password1}\n")
shadow.send_chars("passwd\n")
shadow.sleep(2)
Expand All @@ -66,12 +68,14 @@ in import ./make-test-python.nix ({ pkgs, ... }: {
shadow.send_chars("emma\n")
shadow.wait_until_tty_matches(4, "login: emma")
shadow.wait_until_succeeds("pgrep login")
shadow.sleep(2)
shadow.send_chars("${password1}\n")
shadow.wait_until_tty_matches(4, "Login incorrect")
shadow.wait_until_tty_matches(4, "login:")
shadow.send_chars("emma\n")
shadow.wait_until_tty_matches(4, "login: emma")
shadow.wait_until_succeeds("pgrep login")
shadow.sleep(2)
shadow.send_chars("${password3}\n")
shadow.send_chars("whoami > /tmp/2\n")
shadow.wait_for_file("/tmp/2")
Expand Down

0 comments on commit 1d364e5

Please sign in to comment.