diff --git a/lib/Yam/Agama/Pom/AgamaUpAndRunningBasePage.pm b/lib/Yam/Agama/Pom/AgamaUpAndRunningBasePage.pm index 05d28999c252..6964ce74ea05 100644 --- a/lib/Yam/Agama/Pom/AgamaUpAndRunningBasePage.pm +++ b/lib/Yam/Agama/Pom/AgamaUpAndRunningBasePage.pm @@ -17,7 +17,7 @@ sub new { my ($class, $args) = @_; return bless { tag_array_ref_any_first_screen_shown => [], - timeout_expect_is_shown => $args->{timeout_expect_is_shown} // 90 + timeout_expect_is_shown => $args->{timeout_expect_is_shown} // 120 }, $class; } diff --git a/lib/Yam/Agama/Pom/RebootPage.pm b/lib/Yam/Agama/Pom/RebootPage.pm index 383c6c251719..0027cc5cb3ca 100644 --- a/lib/Yam/Agama/Pom/RebootPage.pm +++ b/lib/Yam/Agama/Pom/RebootPage.pm @@ -21,26 +21,15 @@ sub new { } sub expect_is_shown { - my ($self, %args) = @_; - my $timeout = $args{timeout}; - if ($timeout <= 1200) { - assert_screen($self->{tag_installation_complete}, ${timeout}); - } else { - my $mouse_x = 1; - while (1) { - die "timeout ($timeout) hit on during installation" if $timeout <= 0; - if (check_screen $self->{tag_installation_complete}, 30) { - last; - } else { - $timeout -= 30; - diag("left total timeout: $timeout"); - diag('installation not finished, move mouse around a bit to keep screen unlocked'); - mouse_set(($mouse_x + 10) % 1024, 1); - sleep 1; - mouse_set($mouse_x, 1); - next; - } - } + my $self = shift; + my $timeout = 2400; + + while ($timeout > 0) { + my $ret = check_screen($self->{tag_installation_complete}, 30); + $timeout -= 30; + diag("left total await_install timeout: $timeout"); + last if $ret; + die "timeout ($timeout) hit awaiting installation to be finished" if $timeout <= 0; } } diff --git a/lib/Yam/Agama/agama_base.pm b/lib/Yam/Agama/agama_base.pm index c1d21ab03459..9672d325bc30 100644 --- a/lib/Yam/Agama/agama_base.pm +++ b/lib/Yam/Agama/agama_base.pm @@ -12,17 +12,13 @@ use testapi; use Utils::Logging 'save_and_upload_log'; sub post_fail_hook { - select_console 'root-console'; upload_agama_logs(); - upload_system_logs(); upload_browser_automation_dumps(); } sub upload_agama_logs { + select_console 'root-console'; save_and_upload_log('agama logs store', "/tmp/agama-logs.tar.gz"); -} - -sub upload_system_logs { save_and_upload_log('journalctl -b > /tmp/journal.log', "/tmp/journal.log"); } diff --git a/tests/yam/agama/agama.pm b/tests/yam/agama/agama.pm index f6ffc8637a53..f7f0d442cdad 100644 --- a/tests/yam/agama/agama.pm +++ b/tests/yam/agama/agama.pm @@ -29,6 +29,7 @@ sub pre_run_hook { } sub run { + my $self = shift; my $test = get_required_var('AGAMA_TEST'); my $test_options = get_required_var('AGAMA_TEST_OPTIONS'); my $reboot_page = $testapi::distri->get_reboot(); @@ -38,9 +39,7 @@ sub run { $test_options, timeout => 1200); script_run("dmesg --console-on"); - Yam::Agama::agama_base::upload_agama_logs(); - Yam::Agama::agama_base::upload_system_logs(); - + $self->upload_agama_logs(); $reboot_page->reboot(); } diff --git a/tests/yam/agama/agama_auto.pm b/tests/yam/agama/agama_auto.pm index 4a28036aa72b..22f2c4821a2a 100644 --- a/tests/yam/agama/agama_auto.pm +++ b/tests/yam/agama/agama_auto.pm @@ -12,14 +12,11 @@ use warnings; use testapi; sub run { + my $self = shift; my $reboot_page = $testapi::distri->get_reboot(); - $reboot_page->expect_is_shown(timeout => ((get_var('DESKTOP') eq 'gnome') ? 2400 : 1200)); - - select_console 'root-console'; - Yam::Agama::agama_base::upload_agama_logs(); - Yam::Agama::agama_base::upload_system_logs(); - + $reboot_page->expect_is_shown(); + $self->upload_agama_logs(); $reboot_page->reboot(); }