Replace blivet tests with custom GUI tests #51

Merged
akatch merged 15 commits from issue_9 into develop 2021-10-26 15:56:01 +00:00
42 changed files with 574 additions and 62 deletions

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 check_help_on_pane get_mirrorlist_url crash_anaconda_text report_bug_text/;
our @EXPORT = qw/select_disks custom_scheme_select custom_add_partition 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 check_help_on_pane get_mirrorlist_url crash_anaconda_text report_bug_text/;
sub select_disks {
# Handles disk selection. Has one optional argument - number of
@ -175,6 +175,76 @@ sub custom_blivet_add_partition {
}
}
sub custom_add_partition {
# Used to add partition on Rocky custom-gui partitioning screen
# in Anaconda. Should be called when custom-gui is displayed and free space is selected.
# You can pass device type for partition (needle tagged anaconda_custom_devicetype_$devicetype should exist), size of that partition in MiBs, desired filesystem of that partition
# (anaconda_custom_part_fs_$filesystem should exist) and mountpoint of that partition (e. g. string "/boot").
my %args = (
devicetype => "",
raidlevel => 0,
size => 0,
filesystem => "",
mountpoint => "",
@_
);
$args{devicetype} = "raid" if $args{raidlevel};
# send tab until 'add' button is selected, then press
# the number of tabs needed seems to depend on whether a partition has already been added
send_key_until_needlematch("anaconda_custom_part_add", "tab");
send_key "spc";
# supply the mountpoint
assert_screen "anaconda_custom_mountpoint";
type_safely $args{mountpoint};
send_key "tab";
send_key "tab";
send_key "tab";
assert_screen "anaconda_custom_size";
# supply the desired size
# if size is not provided, leave empty to use the remaining disk space
if ($args{size}) {
type_safely $args{size};
}
send_key "tab";
send_key "tab";
assert_screen "anaconda_custom_btn_add_mountpoint";
send_key "spc";
# if no devicetype was specified or devicetype is already selected, do nothing
if (($args{devicetype} && !check_screen("anaconda_custom_part_fs_$args{devicetype}_selected", 5))) {
# send 'tab' until the Device Type dropdown is selected
send_key_until_needlematch("anaconda_custom_part_devicetype_selected", "tab");
send_key "spc";
# send 'down' until the correct devicetype is selected
send_key_until_needlematch("anaconda_custom_part_devicetype_$args{devicetype}", "down");
send_key "spc";
}
# if no filesystem was specified or filesystem is already selected, do nothing
if ($args{filesystem} && !check_screen("anaconda_custom_part_fs_$args{filesystem}_selected", 5)) {
# send 'tab' until the File System dropdown is selected
send_key_until_needlematch("anaconda_custom_part_fs_selected", "tab");
send_key "spc";
# send 'down' until the correct filesystem is selected
send_key_until_needlematch("anaconda_custom_part_fs_$args{filesystem}_selected", "down");
send_key "spc";
}
if ($args{raidlevel}) {
# send 'tab' until Raid Level dropdown is selected
send_key_until_needlematch("anaconda_custom_part_raidlevel_selected", "tab");
send_key "spc";
#choose RAID level from dropdown
send_key_until_needlematch("anaconda_custom_part_raid_1_selected", "down");
send_key "spc";
}
# select "free space" in custom-gui if it exists, so we could run this function again to add another partition
if (check_screen("anaconda_custom_free_space", 15)) {
assert_and_click "anaconda_custom_free_space";
}
}
sub custom_blivet_format_partition {
# This subroutine formats a selected partition. To use it, you must select the
# partition by other means before you format it using this routine.

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 548,
"ypos": 463,
"width": 109,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_btn_add_mountpoint"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 352,
"ypos": 355,
"width": 317,
"height": 46,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_mountpoint"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -0,0 +1,21 @@
{
"area": [
{
"width": 131,
"type": "match",
"xpos": 352,
"ypos": 367,
"height": 22,
"click_point": {
"xpos": 131,
"ypos": 12
}
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_mountpoint"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 33,
"ypos": 617,
"width": 38,
"height": 34,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_add"
tcooper commented 2021-10-25 04:57:05 +00:00 (Migrated from github.com)
Review

Not critical but you didn't specify LANGUAGE-english in this needle.

Not critical but you didn't specify `LANGUAGE-english` in this needle.
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -0,0 +1,21 @@
{
"area": [
{
"height": 34,
"ypos": 263,
"type": "match",
"width": 168,
"xpos": 497,
"click_point": {
"xpos": 118,
"ypos": 34
}
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_devicetype"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 509,
"ypos": 300,
"width": 48,
"height": 13,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_devicetype_lvmlv"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 511,
"ypos": 330,
"width": 33,
"height": 10,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_devicetype_raid"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 503,
"ypos": 269,
"width": 76,
"height": 27,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_devicetype_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 510,
"ypos": 300,
"width": 112,
"height": 14,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_devicetype_standard_partition"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 507,
"ypos": 359,
"width": 120,
"height": 15,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_fs_efi_filesystem_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 509,
"ypos": 275,
"width": 36,
"height": 10,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_fs_ext4_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"height": 26,
"type": "match",
"ypos": 351,
"width": 71,
"xpos": 504
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_fs_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 506,
"ypos": 364,
"width": 45,
"height": 10,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_fs_swap_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 779,
"ypos": 304,
"width": 40,
"height": 14,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_raid_1_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 775,
"ypos": 335,
"width": 45,
"height": 10,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_raid_4_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -0,0 +1,18 @@
{
"area": [
{
"height": 26,
"width": 66,
"xpos": 773,
"type": "match",
"ypos": 276,
"match": 98
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_raidlevel_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -0,0 +1,21 @@
{
"area": [
{
"ypos": 404,
"type": "match",
"xpos": 352,
"width": 112,
"height": 24,
"click_point": {
"xpos": 134,
"ypos": 10
}
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_size"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 506,
"ypos": 361,
"width": 32,
"height": 14,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_fs_xfs_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -316,20 +316,6 @@
"USER_LOGIN": "false"
}
},
"install_blivet_resize_lvm": {
"profiles": {
"rocky-dvd-iso-aarch64-*-aarch64": 40,
"rocky-dvd-iso-x86_64-*-64bit": 40
},
"settings": {
"PARTITIONING": "custom_blivet_resize_lvm",
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
"INSTALL": "1",
"POSTINSTALL": "disk_custom_resize_lvm_postinstall",
"ROOT_PASSWORD": "weakpassword",
"START_AFTER_TEST": "install_lvm_ext4"
}
},
"install_resize_lvm": {
"profiles": {
"rocky-dvd-iso-aarch64-*-aarch64": 40,
@ -390,54 +376,30 @@
"USER_LOGIN": "qwerty"
}
},
"install_blivet_lvmthin": {
"profiles": {
"rocky-universal-aarch64-*-aarch64": 40,
"rocky-universal-x86_64-*-64bit": 40,
"rocky-universal-x86_64-*-uefi": 41
},
"settings": {
"PARTITIONING": "custom_blivet_lvmthin",
"POSTINSTALL": "disk_custom_lvmthin_postinstall",
"ROOT_PASSWORD": "weakpassword"
}
},
"install_blivet_lvm_ext4": {
"install_custom_gui_lvm_ext4": {
"profiles": {
"rocky-dvd-iso-aarch64-*-aarch64": 40,
"rocky-dvd-iso-x86_64-*-64bit": 40,
"rocky-dvd-iso-x86_64-*-uefi": 41
},
"settings": {
"PARTITIONING": "custom_blivet_lvm_ext4",
"PARTITIONING": "custom_gui_lvm_ext4",
"POSTINSTALL": "disk_custom_lvm_ext4_postinstall",
"ROOT_PASSWORD": "weakpassword"
}
},
"install_blivet_standard_partition_ext4": {
"install_custom_gui_standard_partition_ext4": {
"profiles": {
"rocky-dvd-iso-aarch64-*-aarch64": 40,
"rocky-dvd-iso-x86_64-*-64bit": 40,
"rocky-dvd-iso-x86_64-*-uefi": 41
},
"settings": {
"PARTITIONING": "custom_blivet_standard_partition_ext4",
"PARTITIONING": "custom_gui_standard_partition_ext4",
"ROOT_PASSWORD": "weakpassword"
}
},
"install_blivet_with_swap": {
"profiles": {
"rocky-universal-aarch64-*-aarch64": 50,
"rocky-universal-x86_64-*-64bit": 50,
"rocky-universal-x86_64-*-uefi": 51
},
"settings": {
"PARTITIONING": "custom_blivet_with_swap",
"POSTINSTALL": "disk_custom_with_swap_postinstall",
"ROOT_PASSWORD": "weakpassword"
}
},
"install_blivet_software_raid": {
"install_custom_gui_software_raid": {
"profiles": {
"rocky-universal-aarch64-*-aarch64": 40,
"rocky-universal-x86_64-*-64bit": 40,
@ -445,19 +407,19 @@
},
"settings": {
"NUMDISKS": "2",
"PARTITIONING": "custom_blivet_software_raid",
"PARTITIONING": "custom_gui_software_raid",
"POSTINSTALL": "disk_custom_software_raid_postinstall",
"ROOT_PASSWORD": "weakpassword"
}
},
"install_blivet_xfs": {
"install_custom_gui_xfs": {
"profiles": {
"rocky-universal-aarch64-*-aarch64": 40,
"rocky-universal-x86_64-*-64bit": 40,
"rocky-universal-x86_64-*-uefi": 41
},
"settings": {
"PARTITIONING": "custom_blivet_xfs",
"PARTITIONING": "custom_gui_xfs",
"POSTINSTALL": "disk_custom_xfs_postinstall",
"ROOT_PASSWORD": "weakpassword"
}

View File

@ -0,0 +1,43 @@
use base "anacondatest";
use strict;
use testapi;
use anaconda;
sub run {
my $self = shift;
# Go to INSTALLATION DESTINATION and ensure the disk is selected.
# Because PARTITIONING starts with 'custom_', this will select custom.
select_disks();
assert_and_click "anaconda_spoke_done";
if (get_var("UEFI")) {
# if we're running on UEFI, we need esp
custom_add_partition(size => 512, mountpoint => '/boot/efi', filesystem => 'efi_filesystem');
}
if (get_var("OFW")) {
custom_add_partition(size => 4, filesystem => 'ppc_prep_boot');
}
custom_add_partition(size => 512, mountpoint => '/boot', filesystem => 'ext4');
custom_add_partition(size => 512, mountpoint => 'swap', filesystem => 'swap');
# LVM vg already exists, so just add a volume
# add lvm LV with ext4 and mount it as /
custom_add_partition(devicetype => 'lvmlv', filesystem => 'ext4', mountpoint => '/');
# Confirm changes
assert_and_click "anaconda_spoke_done";
assert_and_click "anaconda_part_accept_changes";
# Anaconda hub
assert_screen "anaconda_main_hub", 300; #
}
sub test_flags {
return { fatal => 1 };
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,39 @@
use base "anacondatest";
use strict;
use testapi;
use anaconda;
sub run {
my $self = shift;
# Go to INSTALLATION DESTINATION and ensure two disks are selected.
# Because PARTITIONING starts with 'custom', this will select blivet-gui.
select_disks(disks=>2);
assert_and_click "anaconda_spoke_done";
if (get_var("UEFI")) {
# if we're running on UEFI, we need esp
custom_add_partition(size => 512, mountpoint => '/boot/efi', filesystem => 'efi_filesystem');
}
if (get_var("OFW")) {
custom_add_partition(size => 4, filesystem => 'ppc_prep_boot');
}
custom_add_partition(size => 512, mountpoint => '/boot');
custom_add_partition(filesystem => 'swap', size => 512, mountpoint => 'swap');
custom_add_partition(raidlevel => 1, mountpoint => '/');
assert_and_click "anaconda_spoke_done";
assert_and_click "anaconda_part_accept_changes";
# Anaconda hub
assert_screen "anaconda_main_hub", 300; #
}
sub test_flags {
return { fatal => 1 };
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,40 @@
use base "anacondatest";
use strict;
use testapi;
use anaconda;
sub run {
my $self = shift;
# Go to INSTALLATION DESTINATION and ensure the disk is selected.
# Because PARTITIONING starts with 'custom', this will select custom-gui.
select_disks();
assert_and_click "anaconda_spoke_done";
if (get_var("UEFI")) {
# if we're running on UEFI, we need esp
custom_add_partition(size => 512, mountpoint => '/boot/efi', filesystem => 'efi_filesystem');
}
if (get_var("OFW")) {
custom_add_partition(size => 4, filesystem => 'ppc_prep_boot');
}
#custom_add_partition(filesystem => 'ext4', mountpoint => '/');
custom_add_partition(filesystem => 'ext4', size => 512, mountpoint => '/boot', devicetype => 'standard_partition');
custom_add_partition(filesystem => 'swap', size => 512, mountpoint => 'swap');
custom_add_partition(filesystem => 'ext4', mountpoint => '/', devicetype => 'standard_partition');
assert_and_click "anaconda_spoke_done";
assert_and_click "anaconda_part_accept_changes";
# Anaconda hub
assert_screen "anaconda_main_hub", 300; #
}
sub test_flags {
return { fatal => 1 };
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,39 @@
use base "anacondatest";
use strict;
use testapi;
use anaconda;
sub run {
my $self = shift;
# Go to INSTALLATION DESTINATION and ensure the disk is selected.
# Because PARTITIONING starts with 'custom', this will select custom-gui.
select_disks();
assert_and_click "anaconda_spoke_done";
if (get_var("UEFI")) {
# if we're running on UEFI, we need esp
custom_add_partition(size => 512, mountpoint => '/boot/efi', filesystem => 'efi_filesystem');
}
if (get_var("OFW")) {
custom_add_partition(size => 4, filesystem => 'ppc_prep_boot');
}
custom_add_partition(filesystem => 'xfs', size => 512, mountpoint => '/boot');
custom_add_partition(filesystem => 'swap', size => 512, mountpoint => 'swap');
custom_add_partition(filesystem => 'xfs', mountpoint => '/');
assert_and_click "anaconda_spoke_done";
assert_and_click "anaconda_part_accept_changes";
# Anaconda hub
assert_screen "anaconda_main_hub", 300; #
}
sub test_flags {
return { fatal => 1 };
}
1;
# vim: set sw=4 et: