os-autoinst-distri-rocky/tests/disk_custom_resize_lvm.pm
Adam Williamson b4f3e6ea5a Move install_blivet_resize_lvm, fix install_resize_lvm (#201)
This is the same thing we did for install_resize_lvm, to address
issue #201. We just didn't get around to doing it for the blivet
test yet. We also change the HDDSIZEGB for the parent test to
15GB so the resizing stuff actually works in both resize tests;
ever since we changed this the install_resize_lvm test has not
been working properly, it hasn't actually been doing any resize.
Also drop the swap partition stuff from that test as it's for
sure no longer needed.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2021-04-30 11:10:21 -07:00

89 lines
2.8 KiB
Perl

use base "anacondatest";
use strict;
use testapi;
use anaconda;
use utils;
sub goto_mountpoint {
send_key_until_needlematch("anaconda_part_mountpoint_selected", "tab", 20);
}
sub run {
my $self = shift;
# Navigate to "Installation destionation" and select blivet-gui
# to manipulate the partitions. This will be automatically
# done using the following method, because PARTITIONING starts
# with "custom_blivet".
select_disks();
assert_and_click "anaconda_spoke_done";
# The following procedure will use Custom Partitioning to resize the root partition from
# a previous Linux installation and prepare the disk for new installation
# which will be then followed through.
# Custom partitioning shows that an existing installations is there on the disk,
# we need to select it to proceed.
assert_and_click "anaconda_part_use_current";
# At first, we will recreate the /boot mountpoint in the existing installation
# and reformat it.
#
assert_and_click "anaconda_part_select_boot";
# navigate to "Mountpoint"
goto_mountpoint();
type_very_safely "/boot";
assert_and_click "anaconda_part_device_reformat";
assert_and_click "anaconda_part_update_settings";
# give it a few seconds to update
wait_still_screen 5;
# For UEFI based images, we need to reassign the efi boot
# mountpoint as well
if (get_var("UEFI") == 1) {
assert_and_click "anaconda_part_select_efiboot";
goto_mountpoint();
type_very_safely "/boot/efi";
assert_and_click "anaconda_part_device_reformat";
assert_and_click "anaconda_part_update_settings";
# give it a second or two to update
wait_still_screen 5;
}
# Now resize and format the current root partition
assert_and_click "anaconda_part_select_root";
# Navigate to Mountpoint
goto_mountpoint();
type_very_safely "/";
# Skip to the Size window
send_key "tab";
type_very_safely "13 GiB";
# Reformat and update the partition
assert_and_click "anaconda_part_device_reformat";
assert_and_click "anaconda_part_update_settings";
# give it a second or two to update
wait_still_screen 2;
# Add new /home partition into the emptied space.
assert_and_click "anaconda_part_add";
# The previous step brings us into a mountpoint field
# of the pop-up window, so we only need to fill the value in.
# Also, it seems that leaving the size field empty automatically
# suggests to use the remaining free space.
type_very_safely "/home";
send_key "tab";
assert_and_click "anaconda_part_add_mountpoint";
# Close the spoke.
assert_and_click "anaconda_spoke_done";
# Confirm changes
assert_and_click "anaconda_part_accept_changes";
}
sub test_flags {
return { fatal => 1 };
}
1;