-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20158 from lkocman/grub_test_leap16
Add grub_tests into agama_install schedule
- Loading branch information
Showing
3 changed files
with
85 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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; | ||
|
||
|
@@ -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 | ||
|
@@ -213,4 +198,5 @@ sub post_fail_hook { | |
upload_agama_logs(); | ||
} | ||
|
||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |