#208 Add several tests to test QA:Testcase_partitioning_custom_btrfs_preserve_home.
Merged 3 years ago by adamwill. Opened 3 years ago by lruzicka.

file modified
+1 -1
@@ -78,7 +78,7 @@ 

      testliterals.append(f"user_confirm_{user}")

  # partitioning stuff, there's a bunch of this, all in anaconda.pm

  # multiple things use this

- for part in ("swap", "root", "efi", "boot", "vda2"):

+ for part in ("swap", "root", "efi", "boot", "home", "vda2"):

      testliterals.append(f"anaconda_part_select_{part}")

      testliterals.append(f"anaconda_blivet_part_inactive_{part}")

  # select_disks

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 669,

+       "ypos": 398,

+       "width": 56,

+       "height": 16,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "anaconda_part_confirm_delete"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 49,

+       "ypos": 370,

+       "width": 56,

+       "height": 22,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "anaconda_part_select_home"

+   ]

+ } 

\ No newline at end of file

file modified
+14
@@ -984,6 +984,20 @@ 

                  "ROOT_PASSWORD": "weakpassword"

              }

          },

+         "install_btrfs_preserve_home": {

+             "profiles": {

+                 "fedora-Server-dvd-iso-aarch64-*-aarch64": 10,

+                 "fedora-Server-dvd-iso-ppc64le-*-ppc64le": 10,

+                 "fedora-Server-dvd-iso-x86_64-*-64bit": 10

+             },

+             "settings": {

+                 "PARTITIONING": "custom_btrfs_preserve_home",

+                 "INSTALL": 1,

+                 "ROOT_PASSWORD": "weakpassword",

+                 "POSTINSTALL": "btrfs_preserve_home_check_content",

+                 "HDD_1": "disk_f%CURRREL%_desktop_4_%ARCH%.img"

+             }

+         },

          "install_cyrillic_language": {

              "profiles": {

                  "fedora-universal-aarch64-*-aarch64": 40,

@@ -0,0 +1,24 @@ 

+ use base "installedtest";

+ use strict;

+ use testapi;

+ use utils;

+ 

+ sub run {

+     my $self=shift;

+     bypass_1691487 unless (get_var("DESKTOP"));

+     # switch to TTY3 for both, graphical and console tests

+     $self->root_console(tty=>3);

+     # The pre-created image has a special file left in the home

+     # directory. This checks that the file has been left there 

+     # correctly after system reinstall.

+     assert_script_run "ls /home/home_preserved";

+ }

+ 

+ 

+ sub test_flags {

+     return { fatal => 1 };

+ }

+ 

+ 1;

+ 

+ # vim: set sw=4 et:

@@ -1,6 +1,7 @@ 

  use base "anacondatest";

  use strict;

  use testapi;

+ use utils;

  use anaconda;

  

  sub run {

@@ -0,0 +1,75 @@ 

+ use base "anacondatest";

+ use strict;

+ use testapi;

+ use utils;

+ use anaconda;

+ 

+ 

+ sub use_current_partition {

+     my ($partition, $reformat) = @_;

+ 

+     # Select the partition

+     assert_and_click "anaconda_part_select_$partition";

+     # Select the mountpoint field

+     send_key_until_needlematch("anaconda_part_mountpoint_selected", "tab", 20);

+     # Type in the mountpoint

+     if ($partition eq "root") {

+         type_very_safely "/";

+     }

+     else {

+         type_very_safely "/$partition";

+     }

+     # Click on reformat if we so wish

+     if ($reformat == 1) {

+         assert_and_click "anaconda_part_device_reformat";

+     }

+     # Update chosen settings

+     assert_and_click "anaconda_part_update_settings";

+     # Wait for the UI to settle down.

+     wait_still_screen 5;

+ }

+ 

+ sub run {

+     my $self = shift;

+     # Go to INSTALLATION DESTINATION and ensure the disk is selected.

+     # Because PARTITIONING starts with 'custom_', this will select custom.

+     select_disks();

+     assert_and_click "anaconda_spoke_done";

+ 

+     # Manual partitioning spoke should be displayed. Select BTRFS

+     # partitioning scheme

+     custom_scheme_select("btrfs");

+     # Select the currently installed system

+     assert_and_click "anaconda_part_use_current";

+ 

+     # Use the home partition from the current scheme

+     use_current_partition("home", 0);

+     # Use the boot partition from the current scheme

+     use_current_partition("boot", 1);

+ 

+     # Select the root partition from the current scheme

+     # and delete it

+     assert_and_click "anaconda_part_select_root";

+     assert_and_click "anaconda_part_delete";

+     assert_and_click "anaconda_part_confirm_delete";

+ 

+     # Add the new root partition to the scheme

+     assert_and_click "anaconda_part_add";

+     type_very_safely "/\n";

+ 

+     # Confirm changes

+     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:

This PR adds the install_btrfs_upload to install the btrfs based
image, the btrfs_preserve_home_extras to prepare and test the data
on the home partition, as well as the custom_btrfs_preserve_home that
uses the preinstalled btrfs image and uses its current partitioning to
preserve the home partition and the data on it.

Build succeeded.

rebased onto 9df4e8654d1e2648d381428047856387f0a3b313

3 years ago

we already do this two different ways in disk_custom_with_swap.pm and disk_custom_resize_lvm.pm, it seems. Could we perhaps make disk_custom_resize_lvm.pm use send_key_until_needlematch like _with_swap.pm does, and do that here too, for consistency?

Build succeeded.

can you please put spaces in things like this? it just reads awkwardly without them, for me...

this use of "reformat" and "dontformat" strings seems weird. can't we just use something booleanish? just 1 or 0 or something?

Overall this seems mostly okay, it just feels kind of inefficient. Did you look at whether it'd be feasible to use a pre-canned base image rather than always doing an initial install on the fly? If we have to do an initial install on the fly, can we at least roll it all into a single test (that runs two installs) rather than having the overhead of a disk image upload in the middle?

1 new commit added

  • Make fixed according to the review.
3 years ago

Build failed.

1 new commit added

  • Erase unused needle.
3 years ago

Build succeeded.

I fixed the PR according to the review, as far as simple code changes are concerned.

Overall this seems mostly okay, it just feels kind of inefficient. Did you look at whether it'd be feasible to use a pre-canned base image rather than always doing an initial install on the fly?

I did not, because my motivation was to make this as easy as possible using the installation magic and the templates, while keeping the tests as short as possible. Which, I believe I mostly achieved.

Also, I did not calculated with a pre-created image because a couple of months ago, there was not enough place to store such images. Using the 15 extra minutes of computer time did not seem too bad to me, in this case it would only run once a compose.

If we have to do an initial install on the fly, can we at least roll it all into a single test (that runs two installs) rather than having the overhead of a disk image upload in the middle?

Well, this was the first idea I had, but the test would have to be much more complicated, and I was not sure I knew how to reboot and initiate another installation from within one single test.

I have run the install_default_upload on Workstation image and realized that it creates the btrfs scheme with the home subvolume, so it could be a good trick to move the test case into the Workstation realm and use the image from install_default_upload which is created anyway.

However, if you want me to play with one of the methods that you have suggested, I will. Please, let me know.

Now, I am thinking if the workstation install_default_upload produces the correct btrfs layout, maybe the disk_f??_desktop_4_arch.img might have the same qualities and could be used instead. I am investigating it.

Now, I am thinking if the workstation install_default_upload produces the correct btrfs layout, maybe the disk_f??_desktop_4_arch.img might have the same qualities and could be used instead. I am investigating it.

So, yeah this seems to be possible. I could use that image for it. WIll have to figure out how I manipulate the content of the home partition to check it is preserved.

Yeah, I think either of those two options sounds good. We could always just tweak the desktop base image definition in createhdds to include some dummy files, that should be possible and I think should not affect any other tests.

rebased onto d30922f5da83193ce927262b16205034710af18e

3 years ago

Build succeeded.

19 new commits added

  • Erase unused needle.
  • Add several tests to test QA:Testcase_partitioning_custom_btrfs_preserve_home.
  • Give module test a bit longer to run
  • Add a wait to custom_change_fs
  • Extend ext4_postinstall conditional for UEFI
  • Bump some wait_still_screen in custom_resize_lvm for aarch64
  • Allow lm_sensors service to fail on aarch64
  • apps_run_terminal: match window area too
  • desktop_terminal: assert we actually see terminal app
  • desktop_login: just reboot from console after user creation
  • desktop_login: don't use solidify_wallpaper, use a hack instead
  • desktop_login: tweak password typing so we wait after enter
  • desktop_login: use chpasswd not passwd to set user password
  • Try hitting enter a few times at GNOME login screen if necessary
  • desktop_notifications: wait longer at login screen
  • desktop_login: do console stuff at a VT, not a desktop terminal
  • desktop_browser: wait out animations a bit longer when launching
  • Enable several desktop tests on Workstation aarch64 disk image
  • Actually bump podman build timeout
3 years ago

Build failed.

rebased onto 5b32f8b790e6f99e65a0ddcad405aa1d36c89d54

3 years ago

Build failed.

1 new commit added

  • Change templates to make tests time efficient.
3 years ago

Build failed.

1 new commit added

  • Shorten the test to check the presence of the test file.
3 years ago

Build failed.

rebased onto d42f5c8e7cc821a9eee00d134ee000e2cf3d9e5a

3 years ago

Build failed.

I have reworked this commit to perform the following:

  • it uses the underlying disk_f??_desktop_4_x86_64.img - this image has the standard btrfs layout with the home subvolume and no other settings are needed.
  • this image will have a home_preserved file in /home by default (see https://pagure.io/fedora-qa/createhdds/pull-request/13)
  • The install_btrfs_preserve_home will run and perform another installation over the original image preserving the home subvolume.
  • The btrfs_preserve_home_check_content will run to check that the home_preserved file is still present in the location.

rebased onto 6a8b5a43bc5d3aa9887ca4ffa67252ef02eb9fee

3 years ago

Build failed.

rebased onto ce40ec14c02bda536bc1c5d2ac4e16ac266be55e

3 years ago

Build succeeded.

I don't think we need this any more, do we? Any of this - the whole set of changes to this file?

Other than that I think this looks good to me now. Thanks!

1 new commit added

  • Delete changes as per review.
3 years ago

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.

rebased onto d756599534e4ed24543d6b61b7f0f697380d43bb

3 years ago

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.

rebased onto 1dffb9ceb5a4e75b1ebb12b0c2c76db4e707ebc2

3 years ago

Build succeeded.

rebased onto ba90c70

3 years ago

Pull-Request has been merged by adamwill

3 years ago

Build succeeded.