summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2016-11-29 23:58:21 -0500
committerGraham Christensen <graham@grahamc.com>2016-11-30 00:17:18 -0500
commitcb74fd75d700228b441b87a6dc46fba663821a97 (patch)
tree316a6017e5a07ebe0604476bdab940b138dcdcf9 /nixos/tests
parentb09435ea51caaae1865e667aaa32f7cba4cc4ff2 (diff)
downloadnixlib-cb74fd75d700228b441b87a6dc46fba663821a97.tar
nixlib-cb74fd75d700228b441b87a6dc46fba663821a97.tar.gz
nixlib-cb74fd75d700228b441b87a6dc46fba663821a97.tar.bz2
nixlib-cb74fd75d700228b441b87a6dc46fba663821a97.tar.lz
nixlib-cb74fd75d700228b441b87a6dc46fba663821a97.tar.xz
nixlib-cb74fd75d700228b441b87a6dc46fba663821a97.tar.zst
nixlib-cb74fd75d700228b441b87a6dc46fba663821a97.zip
login test: Create and use direct reads of the TTY contents.
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/login.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/nixos/tests/login.nix b/nixos/tests/login.nix
index e793d89567bf..a6a460fb0a7d 100644
--- a/nixos/tests/login.nix
+++ b/nixos/tests/login.nix
@@ -33,10 +33,11 @@ import ./make-test.nix ({ pkgs, latestKernel ? false, ... }:
 
       # Log in as alice on a virtual console.
       subtest "virtual console login", sub {
-          $machine->sleep(2); # urgh: wait for username prompt
+          $machine->waitUntilTTYMatches(2, "login: ");
           $machine->sendChars("alice\n");
+          $machine->waitUntilTTYMatches(2, "login: alice");
           $machine->waitUntilSucceeds("pgrep login");
-          $machine->sleep(2); # urgh: wait for `Password:'
+          $machine->waitUntilTTYMatches(2, "Password: ");
           $machine->sendChars("foobar\n");
           $machine->waitUntilSucceeds("pgrep -u alice bash");
           $machine->sendChars("touch done\n");