Skip to content

Commit

Permalink
Split actions at the Agama reboot screen from rest
Browse files Browse the repository at this point in the history
* agama contains now installation until the congrats screne
* agama_reboot contains the rest
* remove unused edit_grub function
  • Loading branch information
lkocman committed Sep 10, 2024
1 parent 00a2f11 commit 3ae719a
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 23 deletions.
26 changes: 3 additions & 23 deletions tests/installation/agama.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

# Setting agama live media root password
# https://github.com/openSUSE/agama/blob/master/doc/live_iso.md#the-access-password

# This test suite handles basic installation of Leap and Tumbleweed with Agama
# Actions past install-screen with reboot button ara handled separately in agama_reboot.pm
# Maintainer: Lubos Kocman <[email protected]>,

use strict;
Expand All @@ -19,15 +22,6 @@ use utils;
use Utils::Logging qw(export_healthcheck_basic);
use x11utils 'ensure_unlocked_desktop';

# Borrowed from grub2_tests.pm
sub edit_cmdline {
send_key 'e';
my $jump_down = is_sle('<15-sp4') ? '12' : '8';
send_key 'down' for (1 .. $jump_down);
send_key_until_needlematch 'grub2-edit-linux-line', 'down';
send_key 'end';
}

sub agama_set_root_password_dialog {
wait_still_screen 5;

Expand Down Expand Up @@ -183,20 +177,6 @@ sub run {
last;
}
}

assert_screen('agama-congratulations');
console('installation')->set_tty(get_agama_install_console_tty());
upload_agama_logs();
select_console('installation', await_console => 0);
# make sure newly booted system does not expect we're still logged in console
reset_consoles();
assert_and_click('agama-reboot-after-install');

# workaround for lack of disable bootloader timeout
# https://github.com/openSUSE/agama/issues/1594
# simply send space until we hit grub2
send_key_until_needlematch("bootloader-grub2", 'spc', 50, 3);

}

=head2 post_fail_hook
Expand Down
78 changes: 78 additions & 0 deletions tests/installation/agama_reboot.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# oSUSE's openQA tests

Check failure on line 1 in tests/installation/agama_reboot.pm

View workflow job for this annotation

GitHub Actions / CI: Running static tests with perl v5.32

File tests/installation/agama_reboot.pm needs tidying
#
# Copyright 2024 SUSE LLC
# SPDX-License-Identifier: FSFAP

# Summary: Installation of Leap or Tumbleweed with Agama
# https://github.com/openSUSE/agama/

# Exepcted to be executed right after agama.pm
# This test handles actions that happen once we see the reboot button after install
# 1) Switch from installer to console to Upload logs
# 2) Switch back to X11/Wayland and reset_console s
# so newly booted system does not think that we're still logged in console
# 3) workaround for no ability to disable grub timeout in agama
# https://github.com/openSUSE/agama/issues/1594
# grub_test() is too slow to catch boot screen for us
# Maintainer: Lubos Kocman <[email protected]>,

use strict;
use warnings;
use base "installbasetest";
use testapi;
use version_utils qw(is_leap is_sle);
use utils;
use Utils::Logging qw(export_healthcheck_basic);
use x11utils 'ensure_unlocked_desktop';

sub upload_agama_logs {
return if (get_var('NOLOGS'));
select_console("root-console");
# stores logs in /tmp/agma-logs.tar.gz
script_run('agama logs store');
upload_logs('/tmp/agama-logs.tar.gz');
}

sub get_agama_install_console_tty {
# get_x11_console_tty would otherwise autodetermine 2
return 7;
}

sub run {
my ($self) = @_;

assert_screen('agama-congratulations');
console('installation')->set_tty(get_agama_install_console_tty());
upload_agama_logs();
select_console('installation', await_console => 0);
# make sure newly booted system does not expect we're still logged in console
reset_consoles();
assert_and_click('agama-reboot-after-install');

# workaround for lack of disable bootloader timeout
# https://github.com/openSUSE/agama/issues/1594
# simply send space until we hit grub2
send_key_until_needlematch("bootloader-grub2", 'spc', 50, 3);

}

=head2 post_fail_hook
post_fail_hook();
When the test module fails, this method will be called.
It will try to fetch logs from agama.
=cut

sub post_fail_hook {
my ($self) = @_;

return if (get_var('NOLOGS'));

select_console("root-console");
export_healthcheck_basic();
upload_agama_logs();
}

1;

0 comments on commit 3ae719a

Please sign in to comment.