From ecca7d3c01485c882e5297acac15aaef1989b528 Mon Sep 17 00:00:00 2001 From: Lukáš Růžička Date: Jan 28 2021 08:51:32 +0000 Subject: Create testcase to recreate Btrfs layout using Blivet and preserve home. This PR uses the Anaconda Blivet partitioning to recreate a partition layout while preserving the content of the /home subvolume. It also adds the postinstall test to check that the home has been preserved. --- diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint-20201216.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint-20201216.json new file mode 100644 index 0000000..2c899ec --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint-20201216.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "ypos": 435, + "height": 24, + "width": 215, + "type": "match", + "xpos": 413 + } + ], + "properties": [], + "tags": [ + "LANGUAGE-english", + "anaconda_blivet_mountpoint" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint-20201216.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint-20201216.png new file mode 100644 index 0000000..a8355ed Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint-20201216.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint_selected.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint_selected.json new file mode 100644 index 0000000..0ac8159 --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint_selected.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 413, + "ypos": 435, + "width": 158, + "height": 22, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_mountpoint_selected" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint_selected.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint_selected.png new file mode 100644 index 0000000..8a5cdb7 Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_mountpoint_selected.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_boot_selected.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_boot_selected.json new file mode 100644 index 0000000..19c93bb --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_boot_selected.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 342, + "ypos": 307, + "width": 112, + "height": 18, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_boot_selected" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_boot_selected.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_boot_selected.png new file mode 100644 index 0000000..8992307 Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_boot_selected.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_delete.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_delete.json new file mode 100644 index 0000000..5d1adbc --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_delete.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 277, + "ypos": 249, + "width": 18, + "height": 15, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_delete" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_delete.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_delete.png new file mode 100644 index 0000000..3552c93 Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_delete.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_efi_selected.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_efi_selected.json new file mode 100644 index 0000000..d63e94a --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_efi_selected.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 341, + "ypos": 304, + "width": 104, + "height": 21, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_efi_selected" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_efi_selected.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_efi_selected.png new file mode 100644 index 0000000..d9373b4 Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_efi_selected.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_format_button-20201216.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_format_button-20201216.json new file mode 100644 index 0000000..c5f75a8 --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_format_button-20201216.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 332, + "ypos": 309, + "height": 16, + "width": 49, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_format_button" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_format_button-20201216.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_format_button-20201216.png new file mode 100644 index 0000000..4fb5c06 Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_format_button-20201216.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_home_selected.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_home_selected.json new file mode 100644 index 0000000..a5719df --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_home_selected.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 264, + "height": 19, + "ypos": 330, + "width": 40, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_home_selected" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_home_selected.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_home_selected.png new file mode 100644 index 0000000..27fc6d9 Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_home_selected.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_boot-20201216.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_boot-20201216.json new file mode 100644 index 0000000..f6ce9cd --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_boot-20201216.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 338, + "ypos": 331, + "height": 19, + "width": 114, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_inactive_boot" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_boot-20201216.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_boot-20201216.png new file mode 100644 index 0000000..3c360ec Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_boot-20201216.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_efi.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_efi.json new file mode 100644 index 0000000..ea4fac9 --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_efi.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "height": 17, + "width": 108, + "ypos": 308, + "type": "match", + "xpos": 340 + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_inactive_efi" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_efi.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_efi.png new file mode 100644 index 0000000..c5c879c Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_efi.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_home.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_home.json new file mode 100644 index 0000000..4d1993d --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_home.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 262, + "ypos": 331, + "width": 58, + "height": 17, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_inactive_home" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_home.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_home.png new file mode 100644 index 0000000..9fdb0df Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_inactive_home.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_name_selected.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_name_selected.json new file mode 100644 index 0000000..e4a26fd --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_name_selected.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 357, + "ypos": 446, + "width": 66, + "height": 20, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_name_selected" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_name_selected.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_name_selected.png new file mode 100644 index 0000000..6d64241 Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_name_selected.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists.json new file mode 100644 index 0000000..c71908e --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 286, + "width": 36, + "height": 18, + "ypos": 377, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_root_exists" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists.png new file mode 100644 index 0000000..9fdb0df Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists_alt.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists_alt.json new file mode 100644 index 0000000..4799351 --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists_alt.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 265, + "width": 36, + "height": 18, + "ypos": 353, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_root_exists" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists_alt.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists_alt.png new file mode 100644 index 0000000..9fdb0df Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_root_exists_alt.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint.json new file mode 100644 index 0000000..3afd7e5 --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 331, + "ypos": 359, + "width": 101, + "height": 19, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_part_setmountpoint" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint.png new file mode 100644 index 0000000..45ad868 Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint.png differ diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint_button.json b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint_button.json new file mode 100644 index 0000000..d73e4f1 --- /dev/null +++ b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint_button.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "xpos": 560, + "ypos": 426, + "width": 105, + "height": 24, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_blivet_btn_setmountpoint", + "anaconda_blivet_part_setmountpoint_button" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint_button.png b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint_button.png new file mode 100644 index 0000000..a987ca8 Binary files /dev/null and b/needles/anaconda/partitioning/blivet/anaconda_blivet_part_setmountpoint_button.png differ diff --git a/templates.fif.json b/templates.fif.json index a59f5bb..cff4712 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -932,6 +932,30 @@ "ROOT_PASSWORD": "weakpassword" } }, + "install_blivet_btrfs_preserve_home": { + "profiles": { + "fedora-Server-dvd-iso-ppc64le-*-ppc64le": 40, + "fedora-Server-dvd-iso-x86_64-*-64bit": 40 + }, + "settings": { + "PARTITIONING": "custom_blivet_btrfs_preserve_home", + "HDD_1": "disk_f%CURRREL%_desktop_4_%ARCH%.img", + "POSTINSTALL": "btrfs_preserve_home_check_content", + "ROOT_PASSWORD": "weakpassword" + } + }, + "install_blivet_btrfs_preserve_home_uefi": { + "profiles": { + "fedora-Server-dvd-iso-aarch64-*-aarch64": 40, + "fedora-Server-dvd-iso-x86_64-*-uefi": 41 + }, + "settings": { + "PARTITIONING": "custom_blivet_btrfs_preserve_home", + "HDD_1": "disk_f%CURRREL%_minimal-uefi_3_%ARCH%.img", + "POSTINSTALL": "btrfs_preserve_home_check_content", + "ROOT_PASSWORD": "weakpassword" + } + }, "install_blivet_with_swap": { "profiles": { "fedora-universal-aarch64-*-aarch64": 50, diff --git a/tests/disk_custom_blivet_btrfs_preserve_home.pm b/tests/disk_custom_blivet_btrfs_preserve_home.pm new file mode 100644 index 0000000..9193680 --- /dev/null +++ b/tests/disk_custom_blivet_btrfs_preserve_home.pm @@ -0,0 +1,121 @@ +use base "anacondatest"; +use strict; +use utils; +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, let us reformat the UEFI first + # Select the UEFI partition if it is not selected by default + if (not (check_screen "anaconda_blivet_part_efi_selected", 30)) { + assert_and_click "anaconda_blivet_part_inactive_efi"; + wait_still_screen 5; + } + + # Go to the partition settings + assert_and_click "anaconda_blivet_part_edit"; + # Select the Format option + assert_and_click "anaconda_blivet_part_format"; + if (not (check_screen "anaconda_blivet_part_fs_efi_filesystem_selected", 30)) { + assert_and_click "anaconda_blivet_part_fs_select"; + assert_and_click "anaconda_blivet_part_fs_efi_filesystem"; + } + # Select the mountpoint field + + send_key_until_needlematch("anaconda_blivet_mountpoint_selected", "tab", 3, 5); + # Fill in the mountpoint + type_very_safely "/boot/efi"; + # Confirm the settings + assert_and_click "anaconda_blivet_part_format_button"; + } + + # Reformat the /boot partition + if (check_screen "anaconda_blivet_part_boot_selected", 30) { + assert_and_click "anaconda_blivet_part_boot_selected"; + } + else { + assert_and_click "anaconda_blivet_part_inactive_boot"; + wait_still_screen 5; + } + + # Go to the partition settings + assert_and_click "anaconda_blivet_part_edit"; + # Select the Format option + assert_and_click "anaconda_blivet_part_format"; + # Open the filesystem types and select ext4, if not selected + if (not (check_screen "anaconda_blivet_part_fs_ext4_selected",30)) { + assert_and_click "anaconda_blivet_part_fs_select"; + assert_and_click "anaconda_blivet_part_fs_ext4"; + } + # Select the mountpoint field + send_key_until_needlematch("anaconda_blivet_mountpoint_selected", "tab", 3, 5); + # Fill in the mountpoint + type_very_safely "/boot"; + # Confirm the settings + assert_and_click "anaconda_blivet_part_format_button"; + + # Select the BTRFS part + assert_and_click "anaconda_blivet_volumes_icon"; + + # Select the home partition + if (not (check_screen "anaconda_blivet_part_home_selected")) { + assert_and_click "anaconda_blivet_part_inactive_home"; + } + # Go to the partition settings + assert_and_click "anaconda_blivet_part_edit"; + # Select the Set mountpoint option + assert_and_click "anaconda_blivet_part_setmountpoint"; + # Type the mountpoint + type_very_safely "/home"; + # Confirm + assert_and_click "anaconda_blivet_part_setmountpoint_button"; + # Wait some time for the pane to settle, without this, + # the needle boolean check will fade too fast without actually + # taking any effect. + sleep 5; + + # While there are some root subvolumes (it seems that there can be more than one) + # continue to delete them. + while (check_screen "anaconda_blivet_part_root_exists", 2) { + assert_and_click "anaconda_blivet_part_root_exists"; + assert_and_click "anaconda_blivet_part_delete"; + assert_and_click "anaconda_blivet_btn_ok"; + sleep 5; + } + + # Add new root partition + assert_and_click "anaconda_blivet_part_add"; + # Select the name textfield + send_key_until_needlematch("anaconda_blivet_part_name_selected", "tab", 3, 5); + # type the new name + type_very_safely "newroot"; + # Go to next field + send_key "tab"; + # Type the mountpoint + type_very_safely "/"; + # Confirm settings + assert_and_click "anaconda_blivet_btn_ok"; + + # Confirm everything and close the hub + 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: