mirror of
https://github.com/rocky-linux/os-autoinst-distri-rocky.git
synced 2024-11-25 06:31:26 +00:00
desktop_login: do console stuff at a VT, not a desktop terminal
Typing into a desktop terminal is a lot less reliable than typing into a VT. We're seeing failures here quite often on aarch64, so let's try doing this stuff in a VT instead. Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
a30c01ea9a
commit
cb001da6e6
@ -21,19 +21,11 @@ sub type_password {
|
|||||||
sub adduser {
|
sub adduser {
|
||||||
# Add user to the system.
|
# Add user to the system.
|
||||||
my %args = @_;
|
my %args = @_;
|
||||||
$args{termstart} //= 1;
|
|
||||||
$args{termstop} //= 1;
|
$args{termstop} //= 1;
|
||||||
my $name = $args{name};
|
my $name = $args{name};
|
||||||
my $login = $args{login};
|
my $login = $args{login};
|
||||||
my $password = $args{password};
|
my $password = $args{password};
|
||||||
|
|
||||||
if ($args{termstart}) {
|
|
||||||
menu_launch_type $term;
|
|
||||||
wait_still_screen 2;
|
|
||||||
assert_screen "apps_run_terminal";
|
|
||||||
type_very_safely "sudo -i\n";
|
|
||||||
type_password $syspwd;
|
|
||||||
}
|
|
||||||
assert_script_run "useradd -c '$name' $login";
|
assert_script_run "useradd -c '$name' $login";
|
||||||
if ($password ne "askuser") {
|
if ($password ne "askuser") {
|
||||||
# If we want to create a user with a defined password.
|
# If we want to create a user with a defined password.
|
||||||
@ -58,8 +50,7 @@ sub adduser {
|
|||||||
assert_script_run "restorecon -vr /home/$login/.config";
|
assert_script_run "restorecon -vr /home/$login/.config";
|
||||||
}
|
}
|
||||||
if ($args{termstop}) {
|
if ($args{termstop}) {
|
||||||
type_very_safely "exit\n";
|
desktop_vt;
|
||||||
send_key 'alt-f4';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,31 +200,21 @@ sub run {
|
|||||||
solidify_wallpaper;
|
solidify_wallpaper;
|
||||||
# also get rid of the wallpaper on SDDM screen. This is system
|
# also get rid of the wallpaper on SDDM screen. This is system
|
||||||
# wide so we only need do it once
|
# wide so we only need do it once
|
||||||
menu_launch_type $term;
|
$self->root_console(tty=>3);
|
||||||
wait_still_screen 2;
|
|
||||||
assert_screen "apps_run_terminal";
|
|
||||||
type_very_safely "sudo -i\n";
|
|
||||||
type_password $syspwd;
|
|
||||||
assert_script_run "sed -i -e 's,image,solid,g' /usr/share/sddm/themes/01-breeze-fedora/theme.conf.user";
|
assert_script_run "sed -i -e 's,image,solid,g' /usr/share/sddm/themes/01-breeze-fedora/theme.conf.user";
|
||||||
}
|
}
|
||||||
if ($desktop eq "kde") {
|
$self->root_console(tty=>3);
|
||||||
# we're already at a terminal! EFFICIENCY!
|
adduser(name=>"Jack Sparrow", login=>"jack", password=>$jackpass, termstop=>0);
|
||||||
adduser(name=>"Jack Sparrow", login=>"jack", password=>$jackpass, termstart=>0, termstop=>0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
# gotta start the terminal
|
|
||||||
adduser(name=>"Jack Sparrow", login=>"jack", password=>$jackpass, termstart=>1, termstop=>0);
|
|
||||||
}
|
|
||||||
if ($desktop eq "gnome") {
|
if ($desktop eq "gnome") {
|
||||||
# In Gnome, we can create a passwordless user that can provide his password upon
|
# In Gnome, we can create a passwordless user that can provide his password upon
|
||||||
# the first login. So we can create the second user in this way to test this feature
|
# the first login. So we can create the second user in this way to test this feature
|
||||||
# later.
|
# later.
|
||||||
adduser(name=>"Jim Eagle", login=>"jim", password=>"askuser", termstart=>0, termstop=>1);
|
adduser(name=>"Jim Eagle", login=>"jim", password=>"askuser", termstop=>1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# In KDE, we can also create a passwordless user, but we cannot log into the system
|
# In KDE, we can also create a passwordless user, but we cannot log into the system
|
||||||
# later, so we will create the second user the standard way.
|
# later, so we will create the second user the standard way.
|
||||||
adduser(name=>"Jim Eagle", login=>"jim", password=>$jimpass, termstart=>0, termstop=>1);
|
adduser(name=>"Jim Eagle", login=>"jim", password=>$jimpass, termstop=>1);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Clean boot the system, and note what accounts are listed on the login screen.
|
# Clean boot the system, and note what accounts are listed on the login screen.
|
||||||
|
Loading…
Reference in New Issue
Block a user