os-autoinst-distri-rocky/tests/desktop_terminal.pm
Adam Williamson e7853a56a8 Wait for screen change in desktop_terminal before typing pw
Sigh I hate this test. We seem to be typing root pw before the
terminal is ready for us:
https://openqa.fedoraproject.org/tests/745007#step/desktop_terminal/3
Let's try this. Hopefully it'll wait for the Password: prompt
before typing, without us having to actually add a needle...

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-12-21 09:27:39 -08:00

34 lines
927 B
Perl

use base "installedtest";
use strict;
use testapi;
use utils;
sub run {
my $self=shift;
check_desktop;
menu_launch_type('terminal');
assert_screen "apps_run_terminal";
wait_still_screen 5;
# need to be root
my $rootpass = get_var("ROOT_PASSWORD", "weakpassword");
wait_screen_change { type_string "su\n", 20; };
wait_still_screen 3;
# can't use type_safely for now as current implementation relies
# on screen change checks, and there is no screen change here
type_string "$rootpass\n", 1;
wait_still_screen 3;
# if we can run something successfully, we're at a console;
# we're reinventing assert_script_run instead of using it so
# we can type safely
type_very_safely "ls && echo 'ls OK' > /dev/${serialdev}\n";
die "terminal command failed" unless defined wait_serial "ls OK";
}
sub test_flags {
return { fatal => 1 };
}
1;
# vim: set sw=4 et: