Skip to content

Commit

Permalink
Unify interactive installations in tests/yam/agama and its respective…
Browse files Browse the repository at this point in the history
… schedules
  • Loading branch information
openQA web UI committed Aug 25, 2023
1 parent 241c52f commit bb9620f
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 8 deletions.
2 changes: 0 additions & 2 deletions lib/Yam/agama/agama_base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ sub post_run_hook {
reset_consoles;
$testapi::username = "bernhard";
$testapi::password = 'nots3cr3t';
select_serial_terminal();
ensure_serialdev_permissions;
}

sub test_flags {
Expand Down
4 changes: 3 additions & 1 deletion schedule/yam/agama/agama_encrypted_lvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: agama_dolomite_encrypted_lvm
description: >
Playwright test on agama dolomite for installation with fully encrypted disk,
with LVM in use.
vars:
AGAMA_TEST: 'encrypted_lvm'
schedule:
- installation/bootloader_start
- yam/agama/patch_agama
- yam/agama/agama_encrypted_lvm
- yam/agama/agama
- installation/boot_encrypt
- installation/first_boot
- console/validate_encrypt
Expand Down
4 changes: 3 additions & 1 deletion schedule/yam/agama/agama_full_disk_encryption.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
name: agama_install_full_disk_encryption.yaml
description: >
Playwright test on agama
vars:
AGAMA_TEST: 'full-disk-encryption'
schedule:
- installation/bootloader_start
- yam/agama/patch_agama
- yam/agama/agama_full_disk_encryption
- yam/agama/agama
- installation/boot_encrypt
- installation/first_boot
- console/validate_encrypt
5 changes: 4 additions & 1 deletion schedule/yam/agama/agama_installation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
name: agama_installation
description: >
Playwright test on agama
vars:
AGAMA_TEST: 'take_screenshots'
schedule:
- installation/bootloader_start
- yam/agama/patch_agama
- yam/agama/agama_installation
- yam/agama/agama
- yam/agama/agama_first_boot
5 changes: 4 additions & 1 deletion schedule/yam/agama/agama_lvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
name: agama_lvm
description: >
Playwright use lvm test on agama
vars:
AGAMA_TEST: 'lvm'
schedule:
- installation/bootloader_start
- yam/agama/patch_agama
- yam/agama/agama_lvm
- yam/agama/agama
- yam/agama/agama_first_boot
- console/validate_lvm
32 changes: 32 additions & 0 deletions tests/yam/agama/agama.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Copyright 2023 SUSE LLC
# SPDX-License-Identifier: GPL-2.0-or-later

# Summary: Run interactive installation with Agama,
# run playwright tests directly from the Live ISO.
# Maintainer: QE YaST and Migration (QE Yam) <qe-yam at suse de>

#use base 'y2_installbase';
use base Yam::agama::agama_base;
use strict;
use warnings;

use testapi; qw(
assert_script_run
get_required_var
upload_logs
);

sub run {
my $test = get_required_var('AGAMA_TEST');
my $cmd;
if ($test =~ /take_screenshots/) {
$cmd = 'RUN_INSTALLATION=1';
}

assert_script_run($cmd . " playwright test --trace on --project chromium --config /usr/share/e2e-agama-playwright tests/" . $test . ".spec.ts", timeout => 1200);

$testapi::password = 'nots3cr3t';
enter_cmd 'reboot';
}

1;
25 changes: 25 additions & 0 deletions tests/yam/agama/agama_first_boot.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Copyright 2023 SUSE LLC
# SPDX-License-Identifier: GPL-2.0-or-later

# Summary: Run interactive installation with Agama,
# run playwright tests directly from the Live ISO.
# Maintainer: QE YaST and Migration (QE Yam) <qe-yam at suse de>

use base Yam::agama::agama_base;
use strict;
use warnings;

use testapi qw(
assert_screen
enter_cmd
);

sub run {
# For agama test, it is too short time to match the grub2, so we create
# a new needle to avoid too much needles loaded.
assert_screen('grub2-agama', 120);
my @tags = ("welcome-to", "login");
assert_screen(\@tags, 300);
}

1;
2 changes: 0 additions & 2 deletions tests/yam/agama/patch_agama.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ sub run {

my ($repo, $branch) = split /#/, get_required_var('YUPDATE_GIT');
assert_script_run("yupdate patch $repo $branch", timeout => 60);

select_console 'installation';
}

1;

0 comments on commit bb9620f

Please sign in to comment.