#138 Create a test to test unmount errors during reboot (aka Reboot Testcase)
Merged 4 years ago by adamwill. Opened 4 years ago by lruzicka.

file modified
+103
@@ -251,6 +251,50 @@ 

                      },

                      {

                        machine    => { name => "64bit" },

+                       prio       => 50,

+                       product    => {

+                                       arch    => "x86_64",

+                                       distri  => "fedora",

+                                       flavor  => "Server-dvd-iso",

+                                       version => "*",

+                                     },

+                       test_suite => { name => "base_reboot_unmount" },

+                     },

+                     {

+                       machine    => { name => "64bit" },

+                       prio       => 50,

+                       product    => {

+                                       arch    => "x86_64",

+                                       distri  => "fedora",

+                                       flavor  => "KDE-live-iso",

+                                       version => "*",

+                                     },

+                       test_suite => { name => "base_reboot_unmount" },

+                     },

+                     {

+                       machine    => { name => "64bit" },

+                       prio       => 50,

+                       product    => {

+                                       arch    => "x86_64",

+                                       distri  => "fedora",

+                                       flavor  => "Workstation-live-iso",

+                                       version => "*",

+                                     },

+                       test_suite => { name => "base_reboot_unmount" },

+                     },

+                     {

+                       machine    => { name => "64bit" },

+                       prio       => 50,

+                       product    => {

+                                       arch    => "x86_64",

+                                       distri  => "fedora",

+                                       flavor  => "Silverblue-dvd_ostree-iso",

+                                       version => "*",

+                                     },

+                       test_suite => { name => "base_reboot_unmount" },

+                     },

+                     {

+                       machine    => { name => "64bit" },

                        prio       => 40,

                        product    => {

                                        arch    => "x86_64",
@@ -1895,6 +1939,18 @@ 

                      {

                        group_name => "Fedora PowerPC",

                        machine    => { name => "ppc64le" },

+                       prio       => 20,

+                       product    => {

+                                       arch    => "ppc64le",

+                                       distri  => "fedora",

+                                       flavor  => "Workstation-live-iso",

+                                       version => "*",

+                                     },

+                       test_suite => { name => "base_reboot_unmount" },

+                     },

+                     {

+                       group_name => "Fedora PowerPC",

+                       machine    => { name => "ppc64le" },

                        prio       => 40,

                        product    => {

                                        arch    => "ppc64le",
@@ -2087,6 +2143,18 @@ 

                      {

                        group_name => "Fedora PowerPC",

                        machine    => { name => "ppc64le" },

+                       prio       => 20,

+                       product    => {

+                                       arch    => "ppc64le",

+                                       distri  => "fedora",

+                                       flavor  => "Server-dvd-iso",

+                                       version => "*",

+                                     },

+                       test_suite => { name => "base_reboot_unmount" },

+                     },

+                     {

+                       group_name => "Fedora PowerPC",

+                       machine    => { name => "ppc64le" },

                        prio       => 40,

                        product    => {

                                        arch    => "ppc64le",
@@ -3083,6 +3151,18 @@ 

                      {

                        group_name => "Fedora PowerPC",

                        machine    => { name => "ppc64le" },

+                       prio       => 20,

+                       product    => {

+                                       arch    => "ppc64le",

+                                       distri  => "fedora",

+                                       flavor  => "Silverblue-dvd_ostree-iso",

+                                       version => "*",

+                                     },

+                       test_suite => { name => "base_reboot_unmount" },

+                     },

+                     {

+                       group_name => "Fedora PowerPC",

+                       machine    => { name => "ppc64le" },

                        prio       => 50,

                        product    => {

                                        arch    => "ppc64le",
@@ -3210,6 +3290,18 @@ 

                                        flavor  => "Server-dvd-iso",

                                        version => "*",

                                      },

+                       test_suite => { name => "base_reboot_unmount" },

+                     },

+                     {

+                       group_name => "Fedora AArch64",

+                       machine    => { name => "aarch64" },

+                       prio       => 40,

+                       product    => {

+                                       arch    => "aarch64",

+                                       distri  => "fedora",

+                                       flavor  => "Server-dvd-iso",

+                                       version => "*",

+                                     },

                        test_suite => { name => "base_service_manipulation" },

                      },

                      {
@@ -5080,6 +5172,17 @@ 

                        ],

                      },

                      {

+                       name => "base_reboot_unmount",

+                       settings => [

+                         { key => "POSTINSTALL", value => "base_reboot_unmount" },

+                         { key => "USER_LOGIN", value => "false" },

+                         { key => "ROOT_PASSWORD", value => "weakpassword" },

+                         { key => "START_AFTER_TEST", value => "install_default_upload" },

+                         { key => "BOOTFROM", value => "c" },

+                         { key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" },

+                       ],

+                     },

+                     {

                        name => "modularity_tests",

                        settings => [

                          { key => "POSTINSTALL", value => "modularity_module_list modularity_enable_disable_module modularity_install_module modularity_checkdefaults" },

@@ -0,0 +1,42 @@ 

+ use base "installedtest";

+ use strict;

+ use testapi;

+ use utils;

+ 

+ 

+ sub test_routine {

+     my $self = shift;

+     # Save the result of the error tracking grep operation on journalctl output.

+     script_run 'journalctl -b | grep -E "dirty bit|data may be corrupt|recovery|unmounted|recovering" > errors.txt';

+     # Count the number of errors.

+     my $errors_count = script_run "cat errors.txt | wc -l";

+     # Die, if errors have been found.

+     if ($errors_count != 0) {

+         die "Unmount errors have been found in journalctl.";

+     }

+ 

+ }

+ 

+ sub run {

+     # Seems that the first login is handled by the _console_wait_login(), so

+     # we can start with testing right away.

+ 

+     # Run test for the first time

+     test_routine();

+     # Reboot the system.

+     type_safely "reboot\n";

+     # This time, we will need to login manually.

+     boot_to_login_screen;

+     console_login;

+ 

+     # Run the tests for the second time.

+     test_routine();

+ }

+ 

+ sub test_flags {

+     return { fatal => 1 };

+ }

+ 

+ 1;

+ 

+ # vim: set sw=4 et:

I have prepared an automated version of the Reboot testcase suggested by @tablepc. It does exactly what he is proposing. Once, his suggestions is accepted, we will be able to start testing it.
If there will be any changes, I will also make them here.

See more: https://fedoraproject.org/wiki/User:Tablepc/Draft_testcase_reboot

rebased onto 896f8a416878f91d22007cb73b6dd58fa32ed8dc

4 years ago

Metadata Update from @lruzicka:
- Request assigned

4 years ago

rebased onto 5b2512abe51ff1337120e1bf5a474b29322bd3a4

4 years ago

rebased onto b5bca91be23376c7e07332b14c7d804eab258314

4 years ago

rebased onto b9f96f9bd90613ac33fc304e2eaf61b190e22a91

4 years ago

rebased onto eae5d133c3056d2aa14971c810961400bae64f86

4 years ago

rebased onto 20bcea685dee28c209200d771b9a45f1a51db0cf

4 years ago

rebased onto dddc0772dcf478fe23e70f4289a0ed57deefe840

4 years ago

this shouldn't be necessary. we already upload the journal files themselves in the post-fail hook, as part of the var/log tarball. you can use journalctl -f to read it.

this is unrelated to the change, really, technically should be a separate commit.

I expect this to wind up being a Base test called QA:Testcase_base_reboot_unmount, so the openQA name should be base_reboot_unmount, and for tidiness it should be placed alongside the other base tests in this file.

Aside from those minor notes this looks good, thanks!

rebased onto daf2566c5ddef28132df055caaa33c09c616461a

4 years ago

The test case is now accepted and in production, so if you fix up the things mentioned above we can merge this. Then we'll also want to change fedora_openqa to do wiki reporting.

1 new commit added

  • Fix after review.
4 years ago

1 new commit added

  • Add to templates.
4 years ago

1 new commit added

  • Add to templates.
4 years ago

rebased onto 65e6ab9125d20c43f14ab405ceee53ed1b688262

4 years ago

rebased onto d9875bd465169df3e1c1ae9981a4329cfe912e2d

4 years ago

As discussed in person - this looks fine now, except please move the job template definitions alongside the other 'base' job templates for the arches, and test on the same range of images (flavors) we run the other base tests on each arch. Thanks!

rebased onto c8de21d08ce239b710fb86168b2d51360f270de4

4 years ago

rebased onto 23bae35

4 years ago

Pull-Request has been merged by adamwill

4 years ago