2020-05-05 09:38:18 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-05 09:38:18 +00:00
|
|
|
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.
|
2020-05-26 16:05:38 +00:00
|
|
|
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;
|
2020-05-05 09:38:18 +00:00
|
|
|
custom_blivet_format_partition(type => 'ext4', label => 'boot', mountpoint => '/boot');
|
2020-05-11 13:55:16 +00:00
|
|
|
wait_still_screen 5;
|
2020-05-05 09:38:18 +00:00
|
|
|
|
|
|
|
# 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");
|
2020-05-05 09:38:18 +00:00
|
|
|
custom_blivet_resize_partition(size => '13', units => 'GiB');
|
2020-05-11 13:55:16 +00:00
|
|
|
wait_still_screen 5;
|
2020-05-05 09:38:18 +00:00
|
|
|
|
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");
|
2020-05-05 09:38:18 +00:00
|
|
|
custom_blivet_format_partition(type => 'ext4', label => 'root', mountpoint => '/');
|
2020-05-11 13:55:16 +00:00
|
|
|
wait_still_screen 5;
|
2020-05-05 09:38:18 +00:00
|
|
|
|
|
|
|
# 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;
|
2020-05-05 09:38:18 +00:00
|
|
|
|
|
|
|
# Close the spoke.
|
|
|
|
assert_and_click "anaconda_spoke_done";
|
2020-05-11 13:55:16 +00:00
|
|
|
wait_still_screen 5;
|
2020-05-05 09:38:18 +00:00
|
|
|
|
|
|
|
# Confirm changes
|
|
|
|
assert_and_click "anaconda_part_accept_changes";
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_flags {
|
|
|
|
return { fatal => 1 };
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|