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;
|
2020-12-05 06:22:12 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-05 09:38:18 +00:00
|
|
|
sub run {
|
|
|
|
my $self = shift;
|
2022-07-28 20:32:57 +00:00
|
|
|
# Navigate to "Installation destionation" and select blivet-gui
|
2020-05-05 09:38:18 +00:00
|
|
|
# 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.
|
|
|
|
|
2020-12-05 06:22:12 +00:00
|
|
|
# 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.
|
2023-06-18 11:00:07 +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;
|
2021-06-22 10:38:26 +00:00
|
|
|
# Check that the partition has been correctly resized to 13G.
|
|
|
|
assert_screen "device_root_resized_thirteen";
|
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
|
2022-07-28 20:32:57 +00:00
|
|
|
# partition in the view, so we need to activate this again before we attempt to do
|
2020-05-11 13:55:16 +00:00
|
|
|
# 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 {
|
2022-07-28 20:32:57 +00:00
|
|
|
return {fatal => 1};
|
2020-05-05 09:38:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|