1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-21 21:43:08 +00:00

add a base_services_start test

Summary:
pretty simple, just make sure no services failed to start. We
may run into the rngd issue here, not sure, let's land it and
see!

Test Plan:
I guess run the test and see what happens? I haven't
actually tested this myself yet, so, yeah.

Reviewers: garretraziel, jskladan

Reviewed By: garretraziel, jskladan

Subscribers: tflink

Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D710
This commit is contained in:
Adam Williamson 2016-01-08 09:01:33 -08:00
parent 7a64700eb2
commit 242d2ca165
3 changed files with 169 additions and 0 deletions

View File

@ -182,6 +182,72 @@
}, },
test_suite => { name => "base_selinux" }, test_suite => { name => "base_selinux" },
}, },
{
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "generic_boot",
version => "*",
},
test_suite => { name => "base_services_start" },
},
{
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "workstation_live",
version => "*",
},
test_suite => { name => "base_services_start" },
},
{
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "server_dvd",
version => "*",
},
test_suite => { name => "base_services_start" },
},
{
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "generic_boot",
version => "*",
},
test_suite => { name => "base_service_manipulation" },
},
{
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "workstation_live",
version => "*",
},
test_suite => { name => "base_service_manipulation" },
},
{
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "server_dvd",
version => "*",
},
test_suite => { name => "base_service_manipulation" },
},
{ {
machine => { name => "64bit" }, machine => { name => "64bit" },
prio => 30, prio => 30,
@ -1245,5 +1311,23 @@
{ key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" }, { key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" },
], ],
}, },
{
name => "base_services_start",
settings => [
{ key => "ENTRYPOINT", value => "base_services_start" },
{ key => "START_AFTER_TEST", value => "default_install" },
{ key => "BOOTFROM", value => "c" },
{ key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" },
],
},
{
name => "base_service_manipulation",
settings => [
{ key => "ENTRYPOINT", value => "base_service_manipulation" },
{ key => "START_AFTER_TEST", value => "default_install" },
{ key => "BOOTFROM", value => "c" },
{ key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" },
],
},
], ],
} }

View File

@ -0,0 +1,60 @@
use base "installedtest";
use strict;
use testapi;
sub run {
my $self=shift;
# wait for boot to complete
$self->boot_to_login_screen("", 30);
# switch to TTY3 for both, graphical and console tests
$self->root_console(tty=>3);
# we could make this slightly more 'efficient' by assuming sshd
# is always going to be enabled/running at first, but it's safer
# to force an expected starting state.
script_run "systemctl stop sshd.service";
script_run "systemctl disable sshd.service";
script_run "reboot";
$self->boot_to_login_screen("", 30);
$self->root_console(tty=>3);
validate_script_output 'systemctl is-enabled sshd.service', sub { $_ =~ m/disabled/ };
validate_script_output 'systemctl is-active sshd.service', sub { $_ =~ m/inactive/ };
validate_script_output 'ps -C sshd', sub { $_ !~ m/sshd/ };
script_run "systemctl start sshd.service";
validate_script_output 'systemctl is-enabled sshd.service', sub { $_ =~ m/disabled/ };
validate_script_output 'systemctl is-active sshd.service', sub { $_ =~ m/active/ };
validate_script_output 'ps -C sshd', sub { $_ =~ m/sshd/ };
script_run "systemctl stop sshd.service";
validate_script_output 'systemctl is-enabled sshd.service', sub { $_ =~ m/disabled/ };
validate_script_output 'systemctl is-active sshd.service', sub { $_ =~ m/inactive/ };
validate_script_output 'ps -C sshd', sub { $_ !~ m/sshd/ };
script_run "systemctl enable sshd.service";
validate_script_output 'systemctl is-enabled sshd.service', sub { $_ =~ m/enabled/ };
validate_script_output 'systemctl is-active sshd.service', sub { $_ =~ m/inactive/ };
validate_script_output 'ps -C sshd', sub { $_ !~ m/sshd/ };
script_run "reboot";
$self->boot_to_login_screen("", 30);
$self->root_console(tty=>3);
validate_script_output 'systemctl is-enabled sshd.service', sub { $_ =~ m/enabled/ };
validate_script_output 'systemctl is-active sshd.service', sub { $_ =~ m/active/ };
validate_script_output 'ps -C sshd', sub { $_ =~ m/sshd/ };
script_run "systemctl disable sshd.service";
script_run "reboot";
$self->boot_to_login_screen("", 30);
$self->root_console(tty=>3);
validate_script_output 'systemctl is-enabled sshd.service', sub { $_ =~ m/disabled/ };
validate_script_output 'systemctl is-active sshd.service', sub { $_ =~ m/inactive/ };
validate_script_output 'ps -C sshd', sub { $_ !~ m/sshd/ };
}
sub test_flags {
# without anything - rollback to 'lastgood' snapshot if failed
# 'fatal' - whole test suite is in danger if this fails
# 'milestone' - after this test succeeds, update 'lastgood'
# 'important' - if this fails, set the overall state to 'fail'
return { fatal => 1 };
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,25 @@
use base "installedtest";
use strict;
use testapi;
sub run {
my $self=shift;
# wait for boot to complete
$self->boot_to_login_screen("", 30);
# switch to TTY3 for both, graphical and console tests
$self->root_console(tty=>3);
validate_script_output 'systemctl --failed', sub { $_ =~ m/0 loaded units/ };
}
sub test_flags {
# without anything - rollback to 'lastgood' snapshot if failed
# 'fatal' - whole test suite is in danger if this fails
# 'milestone' - after this test succeeds, update 'lastgood'
# 'important' - if this fails, set the overall state to 'fail'
return { fatal => 1 };
}
1;
# vim: set sw=4 et: