1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-01-17 14:13:23 +00:00

Add initial webUI custom install tests (xfs, ext4)

This adds two initial custom layout install tests for webUI, and
wires up some library functions for other tests to use. They may
need refining over time but this should be good enough for a
start.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2025-01-08 15:06:37 -08:00
parent 5aad236882
commit cc24b6dfeb
47 changed files with 476 additions and 3 deletions

View File

@ -147,7 +147,13 @@ for scheme in ("standard", "lvmthin", "btrfs", "lvm"):
# custom_blivet_add_partition
for dtype in ("lvmvg", "lvmlv", "lvmthin", "raid"):
testtags.append(f"anaconda_blivet_part_devicetype_{dtype}")
for fsys in ("ext4", "xfs", "btrfs", "ppc_prep_boot", "swap", "efi_filesystem", "biosboot"):
# these are in webui already...
for fsys in ("ext4", "xfs", "efi_filesystem", "biosboot"):
testtags.append(f"anaconda_blivet_part_fs_{fsys}")
testtags.append(f"anaconda_blivet_part_fs_{fsys}_selected")
testtags.append(f"anaconda_webui_custom_fs_{fsys}")
# ...these aren't yet
for fsys in ("btrfs", "ppc_prep_boot", "swap"):
testtags.append(f"anaconda_blivet_part_fs_{fsys}")
testtags.append(f"anaconda_blivet_part_fs_{fsys}_selected")
# this is variable-y in custom_blivet_resize_partition but we only

View File

@ -9,7 +9,7 @@ use testapi;
use utils;
use bugzilla;
our @EXPORT = qw/select_disks custom_scheme_select custom_blivet_add_partition custom_blivet_format_partition custom_blivet_resize_partition custom_change_type custom_change_fs custom_change_device custom_delete_part get_full_repo get_mirrorlist_url crash_anaconda_text report_bug_text/;
our @EXPORT = qw/select_disks custom_scheme_select custom_blivet_add_partition custom_blivet_format_partition custom_blivet_resize_partition custom_change_type custom_change_fs custom_change_device custom_delete_part webui_custom_start webui_custom_create_disklabel webui_custom_add_partition webui_custom_boot_partitions get_full_repo get_mirrorlist_url crash_anaconda_text report_bug_text/;
sub select_disks {
# Handles disk selection. Has one optional argument - number of
@ -308,6 +308,82 @@ sub custom_delete_part {
assert_and_click "anaconda_part_delete";
}
sub webui_custom_start {
# enter webui's custom partitioning flow
# workaround https://bugzilla.redhat.com/show_bug.cgi?id=2336488
# by proceeding to step 2 then going back to step 1
assert_and_click "anaconda_webui_next";
assert_and_click "anaconda_webui_back";
# ok now do what we meant to do
assert_and_click "anaconda_webui_kebab_blue";
assert_and_click "anaconda_webui_storage_editor";
assert_and_click "anaconda_webui_storage_editor_confirm";
}
sub webui_custom_create_disklabel {
# create partition table on a blank disk
assert_and_click "anaconda_webui_custom_unformatted";
assert_and_click "anaconda_webui_custom_create_table";
assert_and_click "anaconda_webui_custom_initialize";
}
sub webui_custom_add_partition {
# create a new partition in webui's custom interface
my %args = (
devicetype => "",
size => 0,
filesystem => "",
mountpoint => "",
@_
);
my $pname = "";
if ($args{mountpoint}) {
$pname = $args{mountpoint};
$pname =~ s,/,,g;
}
assert_and_click "anaconda_webui_custom_freespace";
assert_and_click "anaconda_webui_custom_create_partition";
assert_screen "anaconda_webui_custom_partition_creation";
type_very_safely $pname if ($args{mountpoint});
send_key 'tab';
type_very_safely $args{mountpoint} if ($args{mountpoint});
send_key 'tab';
if ($args{filesystem}) {
assert_and_click "anaconda_webui_active_downcaret";
assert_and_click "anaconda_webui_custom_fs_$args{filesystem}";
}
wait_still_screen 2;
send_key 'tab';
wait_still_screen 2;
send_key 'tab';
wait_still_screen 2;
type_very_safely $args{size} if ($args{size});
send_key 'tab';
# select MB (size should always be in MB)
send_key 'up' if ($args{size});
wait_still_screen 2;
assert_and_click "anaconda_webui_custom_create";
wait_still_screen 5;
}
sub webui_custom_boot_partitions {
# standard steps to create /boot/efi, /boot, bios boot, PRePboot etc.
if (get_var("UEFI")) {
# if we're running on UEFI, we need esp
webui_custom_add_partition(size => 512, mountpoint => '/boot/efi', filesystem => 'efi_filesystem');
}
elsif (get_var("OFW")) {
webui_custom_add_partition(size => 4, filesystem => 'ppc_prep_boot');
}
else {
# from anaconda-37.12.1 onwards, GPT is default for BIOS
# installs, so we need a biosboot partition
webui_custom_add_partition(size => 1, filesystem => 'biosboot');
}
webui_custom_add_partition(size => 512, mountpoint => '/boot');
}
sub get_full_repo {
my ($repourl) = @_;
# trivial thing we kept repeating: fill out an HTTP or HTTPS

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 677,
"ypos": 323,
"width": 21,
"height": 46,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_active_downcaret"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 279,
"ypos": 727,
"width": 41,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_back"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"ypos": 727,
"height": 17,
"xpos": 364,
"width": 43,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-fedora",
"LANGUAGE-english",
"anaconda_webui_begin_installation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 272,
"ypos": 315,
"width": 66,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_continue"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 90,
"ypos": 511,
"width": 53,
"height": 16,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_create"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 589,
"ypos": 393,
"width": 51,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_create_partition"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 550,
"ypos": 409,
"width": 51,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_create_table"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,19 @@
{
"area": [
{
"xpos": 51,
"ypos": 339,
"width": 651,
"height": 29,
"type": "match",
"click_point": {
"xpos": 645.5,
"ypos": 14.5
}
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_freespace"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -0,0 +1,19 @@
{
"area": [
{
"xpos": 53,
"ypos": 447,
"width": 653,
"height": 29,
"type": "match",
"click_point": {
"xpos": 641.5,
"ypos": 17.5
}
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_freespace"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 241,
"ypos": 541,
"width": 35,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_fs_biosboot"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 239,
"ypos": 540,
"width": 79,
"height": 22,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_fs_efi_filesystem"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 240,
"ypos": 401,
"width": 38,
"height": 16,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_fs_ext4"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 240,
"ypos": 372,
"width": 28,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_fs_xfs"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 91,
"ypos": 327,
"width": 59,
"height": 15,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_initialize"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 94,
"ypos": 161,
"width": 176,
"height": 31,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_partition_creation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 56,
"ypos": 694,
"width": 17,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_return"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@ -0,0 +1,19 @@
{
"area": [
{
"xpos": 53,
"ypos": 252,
"width": 668,
"height": 38,
"type": "match",
"click_point": {
"xpos": 642,
"ypos": 1
}
}
],
"properties": [],
"tags": [
"anaconda_webui_custom_unformatted"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 973,
"ypos": 52,
"width": 21,
"height": 28,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_kebab_blue"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 834,
"ypos": 105,
"width": 160,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_storage_editor"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 272,
"ypos": 486,
"width": 159,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_storage_editor_confirm"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -2305,6 +2305,28 @@
"WORKER_CLASS": "tap"
}
},
"install_webui_ext4": {
"profiles": {
"fedora-Workstation-live-iso-x86_64-*-64bit": 10,
"fedora-Workstation-live-iso-x86_64-*-bios": 11
},
"settings": {
"PARTITIONING": "webui_ext4",
"POSTINSTALL": "disk_custom_blivet_standard_partition_ext4_postinstall",
"ROOT_PASSWORD": "weakpassword"
}
},
"install_webui_xfs": {
"profiles": {
"fedora-Workstation-live-iso-x86_64-*-64bit": 10,
"fedora-Workstation-live-iso-x86_64-*-bios": 11
},
"settings": {
"PARTITIONING": "webui_xfs",
"POSTINSTALL": "disk_custom_xfs_postinstall",
"ROOT_PASSWORD": "weakpassword"
}
},
"install_xfs": {
"profiles": {
"fedora-Server-dvd-iso-aarch64-*-aarch64": 40,

View File

@ -3,6 +3,8 @@ use strict;
use testapi;
sub run {
my $self = shift;
$self->root_console(tty => 3, timeout => 30);
assert_screen "root_console";
# check number of partitions
script_run 'fdisk -l | grep /dev/vda'; # debug

View File

@ -3,7 +3,8 @@ use strict;
use testapi;
sub run {
assert_screen "root_console";
my $self = shift;
$self->root_console(tty => 3, timeout => 30);
# check that xfs is used on root partition
assert_script_run "mount | grep 'on / type xfs'";
}

26
tests/disk_webui_ext4.pm Normal file
View File

@ -0,0 +1,26 @@
use base "anacondatest";
use strict;
use testapi;
use anaconda;
sub run {
my $self = shift;
webui_custom_start;
webui_custom_create_disklabel;
webui_custom_boot_partitions;
webui_custom_add_partition(filesystem => 'ext4', mountpoint => '/');
assert_and_click "anaconda_webui_custom_return";
assert_and_click "anaconda_webui_continue";
assert_screen "anaconda_webui_welcome";
assert_and_click "anaconda_webui_next";
}
sub test_flags {
return {fatal => 1};
}
1;
# vim: set sw=4 et:

26
tests/disk_webui_xfs.pm Normal file
View File

@ -0,0 +1,26 @@
use base "anacondatest";
use strict;
use testapi;
use anaconda;
sub run {
my $self = shift;
webui_custom_start;
webui_custom_create_disklabel;
webui_custom_boot_partitions;
webui_custom_add_partition(filesystem => 'xfs', mountpoint => '/');
assert_and_click "anaconda_webui_custom_return";
assert_and_click "anaconda_webui_continue";
assert_screen "anaconda_webui_welcome";
assert_and_click "anaconda_webui_next";
}
sub test_flags {
return {fatal => 1};
}
1;
# vim: set sw=4 et: