1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-10-31 21:44:23 +00:00
os-autoinst-distri-fedora/tests/disk_custom_blivet_resize_lvm.pm

93 lines
3.3 KiB
Perl
Raw Normal View History

use base "anacondatest";
use strict;
use testapi;
use anaconda;
use utils;
2020-05-11 13:55:16 +00:00
sub activate {
# This subroutine activates a partition in Blivet environment.
# Due to some failures on different architectures, probably caused by their
# slowliness, we will need to do the partition activation proces several
# times to make sure the proper partition gets activated.
my $partition = shift;
my $count = 12;
assert_screen 'anaconda_blivet_disk_logical_view';
2020-05-11 13:55:16 +00:00
while (check_screen "anaconda_blivet_part_inactive_$partition" and $count > 0) {
assert_and_click "anaconda_blivet_part_inactive_$partition";
sleep 5;
$count -= 1;
}
}
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 Blivet to resize the root partition from
# a previous Linux installation and prepare the disk for new installation
# which will be then followed through.
# Partitioning starts out of the LVM on VD1 or VD2 (for ppc64le)
# We will use it to recreate the "/boot" partition in there.
# In UEFI, we will need to deal with the /boot/efi partition first.
2020-05-11 13:55:16 +00:00
if (get_var("UEFI") == 1) {
#The efi partition should be already activated. So reformat it and remount.
2020-05-27 09:16:42 +00:00
custom_blivet_format_partition(type => 'efi_filesystem', label => 'efiboot', mountpoint => '/boot/efi');
2020-05-11 13:55:16 +00:00
wait_still_screen 5;
}
# Select the boot partition and reformat it and remount.
my $devboot = 'boot';
if (get_var('OFW')) {
# for PowerPC vda1 is PreP partition.
$devboot = 'vda2';
}
activate($devboot);
2020-05-11 13:55:16 +00:00
# Boot is the only ext4 partition on that scheme, so we will use that to make a needle.
wait_still_screen 5;
custom_blivet_format_partition(type => 'ext4', label => 'boot', mountpoint => '/boot');
2020-05-11 13:55:16 +00:00
wait_still_screen 5;
# Select the LVM root partition, resize it, and format it.
assert_and_click "anaconda_blivet_volumes_icon";
2020-05-11 13:55:16 +00:00
wait_still_screen 5;
# Activate root partition if not active already
activate("root");
custom_blivet_resize_partition(size => '13', units => 'GiB');
2020-05-11 13:55:16 +00:00
wait_still_screen 5;
# Check that the partition has been correctly resized to 13G.
assert_screen "device_root_resized_thirteen";
2020-05-11 13:55:16 +00:00
# Now format the resized root partition. It seems that the focus returns to the first
# partition in the view, so we need to activate this again before we attempt to do
# anything to the partition.
activate("root");
custom_blivet_format_partition(type => 'ext4', label => 'root', mountpoint => '/');
2020-05-11 13:55:16 +00:00
wait_still_screen 5;
# Select the newly created free space
assert_and_click "anaconda_blivet_free_space";
# Create a partition and format it.
custom_blivet_add_partition(filesystem => 'ext4', mountpoint => '/home');
2020-05-11 13:55:16 +00:00
wait_still_screen 5;
# Close the spoke.
assert_and_click "anaconda_spoke_done";
2020-05-11 13:55:16 +00:00
wait_still_screen 5;
# Confirm changes
assert_and_click "anaconda_part_accept_changes";
}
sub test_flags {
return { fatal => 1 };
}
1;