1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-22 22:13:08 +00:00
os-autoinst-distri-fedora/tests/disk_custom_blivet_resize_lvm.pm

85 lines
3.0 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;
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. We will use it to recreate
2020-05-11 13:55:16 +00:00
# the "/boot" partition in there. In UEFI, we will need to deal with the /boot/efi
# partition first.
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.
activate("boot");
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;
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;