Deal with console login properly
This commit is contained in:
parent
939f19a0b4
commit
2ee527fd3a
1 changed files with 9 additions and 3 deletions
|
|
@ -16,9 +16,15 @@ sub run {
|
|||
# Remove the user clear the system and force the gnome-initial-setup
|
||||
# to start on new boot.
|
||||
assert_script_run("loginctl kill-user $username", timeout => 120);
|
||||
# closing the user might switch us back to GDM, switch away if so
|
||||
#$self->root_console(tty => 3) if (check_screen 'graphical_login', timeout => 30);
|
||||
$self->root_console(tty => 3);
|
||||
# closing the user might switch us back to GDM, or log us out from the console
|
||||
# make sure we come back from either of options
|
||||
if (check_screen 'graphical_login', timeout => 30) {
|
||||
$self->root_console(tty => 3);
|
||||
}
|
||||
elsif (check_screen 'text_console_login', timeout => 30) {
|
||||
console_login();
|
||||
sleep(2);
|
||||
}
|
||||
# check until all user processes are terminated, then proceed and delete the user
|
||||
assert_script_run("for i in {1..30}; do ! pgrep -u $username >/dev/null && exit 0; sleep 1; done; pgrep -au $username; exit 1");
|
||||
assert_script_run("userdel -r $username");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue