Replace blivet tests with custom GUI tests #51
@ -9,7 +9,7 @@ use testapi;
|
|||||||
use utils;
|
use utils;
|
||||||
use bugzilla;
|
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 {
|
sub select_disks {
|
||||||
# Handles disk selection. Has one optional argument - number of
|
# Handles disk selection. Has one optional argument - number of
|
||||||
@ -175,6 +175,65 @@ 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 => "",
|
||||||
|
raid1 => 0,
|
||||||
|
size => 0,
|
||||||
|
filesystem => "",
|
||||||
|
mountpoint => "",
|
||||||
|
@_
|
||||||
|
);
|
||||||
|
$args{devicetype} = "raid" if $args{raid1};
|
||||||
|
|
||||||
|
assert_and_click "anaconda_custom_part_add";
|
||||||
|
|
||||||
|
if ($args{mountpoint}) {
|
||||||
|
assert_and_click "anaconda_custom_mountpoint";
|
||||||
|
type_safely $args{mountpoint};
|
||||||
|
# esc to dismiss the dropdown that appears when we add a mountpoint
|
||||||
|
send_key "esc";
|
||||||
|
}
|
||||||
|
if ($args{size}) {
|
||||||
|
assert_and_click "anaconda_custom_size";
|
||||||
|
# size input can contain whole set of different values, so we can't match it with needle
|
||||||
|
type_safely $args{size};
|
||||||
|
}
|
||||||
|
assert_and_click "anaconda_custom_btn_add_mountpoint";
|
||||||
|
|
||||||
|
# if ($args{raid1}) {
|
||||||
|
# # for RAID1, two disks should be selected
|
||||||
|
# send_key "tab";
|
||||||
|
# send_key "down";
|
||||||
|
# send_key "spc";
|
||||||
|
# assert_screen "anaconda_custom_vdb_selected";
|
||||||
|
#
|
||||||
|
# assert_and_click "anaconda_custom_raidlevel_select";
|
||||||
|
# mouse_set(10, 10);
|
||||||
|
# assert_and_click "anaconda_custom_raidlevel_raid1";
|
||||||
|
# }
|
||||||
|
|
||||||
|
# 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)) {
|
||||||
|
assert_and_click "anaconda_custom_part_devicetype";
|
||||||
|
mouse_set(10, 10);
|
||||||
|
assert_and_click "anaconda_custom_part_devicetype_$args{devicetype}";
|
||||||
|
}
|
||||||
|
# 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)) {
|
||||||
|
assert_and_click "anaconda_custom_part_fs";
|
||||||
|
assert_and_click "anaconda_custom_part_fs_$args{filesystem}";
|
||||||
|
}
|
||||||
|
# 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 {
|
sub custom_blivet_format_partition {
|
||||||
# This subroutine formats a selected partition. To use it, you must select the
|
# This subroutine formats a selected partition. To use it, you must select the
|
||||||
# partition by other means before you format it using this routine.
|
# partition by other means before you format it using this routine.
|
||||||
|
@ -376,14 +376,14 @@
|
|||||||
"USER_LOGIN": "qwerty"
|
"USER_LOGIN": "qwerty"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"install_blivet_lvm_ext4": {
|
"install_custom_gui_lvm_ext4": {
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"rocky-dvd-iso-aarch64-*-aarch64": 40,
|
"rocky-dvd-iso-aarch64-*-aarch64": 40,
|
||||||
"rocky-dvd-iso-x86_64-*-64bit": 40,
|
"rocky-dvd-iso-x86_64-*-64bit": 40,
|
||||||
"rocky-dvd-iso-x86_64-*-uefi": 41
|
"rocky-dvd-iso-x86_64-*-uefi": 41
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"PARTITIONING": "custom_blivet_lvm_ext4",
|
"PARTITIONING": "custom_gui_lvm_ext4",
|
||||||
"POSTINSTALL": "disk_custom_lvm_ext4_postinstall",
|
"POSTINSTALL": "disk_custom_lvm_ext4_postinstall",
|
||||||
"ROOT_PASSWORD": "weakpassword"
|
"ROOT_PASSWORD": "weakpassword"
|
||||||
}
|
}
|
||||||
|
43
tests/disk_custom_gui_lvm_ext4.pm
Normal file
43
tests/disk_custom_gui_lvm_ext4.pm
Normal 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:
|
Loading…
Reference in New Issue
Block a user