1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-12-22 02:13:08 +00:00

Create a test to test unmount errors during reboot (aka Reboot Testcase)

This commit is contained in:
Lukáš Růžička 2020-01-10 15:39:02 +01:00 committed by Adam Williamson
parent 780a88f443
commit 23bae35d82
2 changed files with 145 additions and 0 deletions

103
templates
View File

@ -249,6 +249,50 @@
},
test_suite => { name => "base_selinux" },
},
{
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,
@ -1892,6 +1936,18 @@
},
test_suite => { name => "base_services_start" },
},
{
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" },
@ -2084,6 +2140,18 @@
},
test_suite => { name => "base_services_start" },
},
{
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" },
@ -3080,6 +3148,18 @@
},
test_suite => { name => "base_services_start" },
},
{
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" },
@ -3200,6 +3280,18 @@
},
test_suite => { name => "base_services_start" },
},
{
group_name => "Fedora AArch64",
machine => { name => "aarch64" },
prio => 40,
product => {
arch => "aarch64",
distri => "fedora",
flavor => "Server-dvd-iso",
version => "*",
},
test_suite => { name => "base_reboot_unmount" },
},
{
group_name => "Fedora AArch64",
machine => { name => "aarch64" },
@ -5079,6 +5171,17 @@
{ key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" },
],
},
{
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 => [

View File

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