From a868b1241a01953137ceaac97b9d19f4e2e66de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20R=C5=AF=C5=BEi=C4=8Dka?= Date: Mon, 7 Dec 2020 13:33:37 +0100 Subject: [PATCH] Create Blivet standard partitioning with ext4 testcase. This PR introduces a test case that uses the Blivet partitioning tool to create a standard partitioning layout with / and /boot (and specific partitions for UEFI and ARM64) using ext4 as the selected filesystem. It also adds a postinstallation test to check that the partitions have been created correctly. --- templates.fif.json | 12 ++++++ ...k_custom_blivet_standard_partition_ext4.pm | 39 +++++++++++++++++++ ...vet_standard_partition_ext4_postinstall.pm | 30 ++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 tests/disk_custom_blivet_standard_partition_ext4.pm create mode 100644 tests/disk_custom_blivet_standard_partition_ext4_postinstall.pm diff --git a/templates.fif.json b/templates.fif.json index 7afb8966..02762ae7 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -956,6 +956,18 @@ "ROOT_PASSWORD": "weakpassword" } }, + "install_blivet_standard_partition_ext4": { + "profiles": { + "fedora-Server-dvd-iso-aarch64-*-aarch64": 40, + "fedora-Server-dvd-iso-ppc64le-*-ppc64le": 40, + "fedora-Server-dvd-iso-x86_64-*-64bit": 40, + "fedora-Server-dvd-iso-x86_64-*-uefi": 41 + }, + "settings": { + "PARTITIONING": "custom_blivet_standard_partition_ext4", + "ROOT_PASSWORD": "weakpassword" + } + }, "install_blivet_with_swap": { "profiles": { "fedora-universal-aarch64-*-aarch64": 50, diff --git a/tests/disk_custom_blivet_standard_partition_ext4.pm b/tests/disk_custom_blivet_standard_partition_ext4.pm new file mode 100644 index 00000000..22fec1ff --- /dev/null +++ b/tests/disk_custom_blivet_standard_partition_ext4.pm @@ -0,0 +1,39 @@ +use base "anacondatest"; +use strict; +use testapi; +use anaconda; + +sub run { + my $self = shift; + # Go to INSTALLATION DESTINATION and ensure the disk is selected. + # Because PARTITIONING starts with 'custom_blivet', this will select blivet-gui. + select_disks(); + assert_and_click "anaconda_spoke_done"; + + if (get_var("UEFI")) { + # if we're running on UEFI, we need esp + custom_blivet_add_partition(size => 512, mountpoint => '/boot/efi', filesystem => 'efi_filesystem'); + } + if (get_var("OFW")) { + custom_blivet_add_partition(size => 4, filesystem => 'ppc_prep_boot'); + } + + #custom_blivet_add_partition(filesystem => 'ext4', mountpoint => '/'); + custom_blivet_add_partition(filesystem => 'ext4', size => 512, mountpoint => '/boot'); + custom_blivet_add_partition(filesystem => 'ext4', mountpoint => '/'); + + assert_and_click "anaconda_spoke_done"; + assert_and_click "anaconda_part_accept_changes"; + + # Anaconda hub + assert_screen "anaconda_main_hub", 300; # + +} + +sub test_flags { + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/disk_custom_blivet_standard_partition_ext4_postinstall.pm b/tests/disk_custom_blivet_standard_partition_ext4_postinstall.pm new file mode 100644 index 00000000..561bbaa9 --- /dev/null +++ b/tests/disk_custom_blivet_standard_partition_ext4_postinstall.pm @@ -0,0 +1,30 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + assert_screen "root_console"; + my $count = 3; + my $devroot = 'vda2'; + my $devboot = 'vda1'; + if (get_var('OFW') || get_var('UEFI')) { + $count = 4; # extra boot partition (PreP or ESP) + $devroot = 'vda3'; + $devboot = 'vda2'; + } + # check number of partitions + script_run 'fdisk -l | grep /dev/vda'; # debug + validate_script_output 'fdisk -l | grep /dev/vda | wc -l', sub { $_ =~ m/$count/ }; + # check mounted partitions are ext4 fs + script_run 'mount | grep /dev/vda'; # debug + validate_script_output "mount | grep /dev/$devboot", sub { $_ =~ m/on \/boot type ext4/ }; + validate_script_output "mount | grep /dev/$devroot", sub { $_ =~ m/on \/ type ext4/ }; +} + +sub test_flags { + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: