Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix change_password and snapper_rollback failure #12965

Merged
merged 1 commit into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 1 addition & 7 deletions lib/services/users.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,7 @@ sub logout_and_login {
my $test_user = $login_user // $username;
my $test_pw = $login_pw // $newpwd;
handle_logout;
send_key_until_needlematch 'displaymanager', 'esc', 9, 10;
mouse_hide();
wait_still_screen;
assert_and_click "displaymanager-$test_user";
assert_screen 'displaymanager-password-prompt', no_wait => 1;
type_password "$test_pw\n";
assert_screen 'generic-desktop', 120;
handle_login($test_user, 0, $test_pw);
}

sub switch_user {
Expand Down
29 changes: 27 additions & 2 deletions lib/x11utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ our @EXPORT = qw(
untick_welcome_on_next_startup
start_root_shell_in_xterm
workaround_boo1170586
handle_gnome_activities
);

=head1 X11_UTILS
Expand Down Expand Up @@ -200,8 +201,9 @@ Example:

=cut
sub handle_login {
my ($myuser, $user_selected) = @_;
my ($myuser, $user_selected, $mypwd) = @_;
$myuser //= $username;
$mypwd //= $testapi::password;
$user_selected //= 0;

save_screenshot();
Expand Down Expand Up @@ -229,7 +231,7 @@ sub handle_login {
}
}
assert_screen 'displaymanager-password-prompt';
type_password;
type_password($mypwd);
send_key 'ret';
assert_screen([qw(generic-desktop gnome-activities opensuse-welcome)], 60);
if (match_has_tag('gnome-activities')) {
Expand Down Expand Up @@ -419,4 +421,27 @@ sub start_root_shell_in_xterm {
become_root;
}

=head2 handle_gnome_activities

handle_gnome_activities()

handle_gnome_activities
=cut
sub handle_gnome_activities {
my @tags = 'generic-desktop';
my $timeout = 600;

push(@tags, 'gnome-activities') if check_var('DESKTOP', 'gnome');

assert_screen \@tags, $timeout;
# Starting with GNOME 40, upon login, the activities screen is open (assuming the
# user will want to start something. For openQA, we simply press 'esc' to close
# it again and really end up on the desktop
if (match_has_tag('gnome-activities')) {
send_key 'esc';
@tags = grep { !/gnome-activities/ } @tags;
assert_screen \@tags, $timeout;
}
}

1;
3 changes: 2 additions & 1 deletion tests/boot/snapper_rollback.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ use migration 'check_rollback_system';
use power_action_utils 'power_action';
use Utils::Backends 'is_pvm';
use version_utils;
use x11utils 'handle_gnome_activities';

sub run {
my ($self) = @_;
if ((is_leap_migration || is_opensuse) && (check_var('DESKTOP', 'gnome') || check_var('DESKTOP', 'kde'))) {
assert_screen 'generic-desktop', 90;
handle_gnome_activities;
}
else {
assert_screen [qw(linux-login displaymanager)], 300;
Expand Down