Skip to content

Commit

Permalink
Merge pull request #20158 from lkocman/grub_test_leap16
Browse files Browse the repository at this point in the history
Add grub_tests into agama_install schedule
  • Loading branch information
lkocman authored Sep 10, 2024
2 parents a3c273b + d0f2ef5 commit 516eed5
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 18 deletions.
2 changes: 2 additions & 0 deletions schedule/install/agama_install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ description: >
schedule:
- installation/bootloader
- installation/agama
- installation/agama_reboot
- installation/grub_test
- installation/first_boot
- installation/opensuse_welcome
- console/system_prepare
22 changes: 4 additions & 18 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,15 +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');

}

=head2 post_fail_hook
Expand All @@ -213,4 +198,5 @@ sub post_fail_hook {
upload_agama_logs();
}


1;
79 changes: 79 additions & 0 deletions tests/installation/agama_reboot.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# oSUSE's openQA tests
#
# 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 516eed5

Please sign in to comment.