From cb74fd75d700228b441b87a6dc46fba663821a97 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Tue, 29 Nov 2016 23:58:21 -0500 Subject: login test: Create and use direct reads of the TTY contents. --- nixos/tests/login.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nixos/tests') diff --git a/nixos/tests/login.nix b/nixos/tests/login.nix index e793d89567b..a6a460fb0a7 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"); -- cgit 1.4.1