From 48b99a2291c1a5c97b07ed74bd4f390b2208b8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sedl=C3=A1k?= Date: Thu, 1 Jun 2017 11:06:04 +0200 Subject: [PATCH] add base system logging test Differential Revision: https://phab.qa.fedoraproject.org/D1202 --- templates | 44 ++++++++++++++++++++++++++++++++++++ tests/base_system_logging.pm | 24 ++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 tests/base_system_logging.pm diff --git a/templates b/templates index 1508b502..90f2ceba 100755 --- a/templates +++ b/templates @@ -358,6 +358,39 @@ }, test_suite => { name => "base_update_cli" }, }, + { + machine => { name => "64bit" }, + prio => 20, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "Workstation-live-iso", + version => "*", + }, + test_suite => { name => "base_system_logging" }, + }, + { + machine => { name => "64bit" }, + prio => 20, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "Server-dvd-iso", + version => "*", + }, + test_suite => { name => "base_system_logging" }, + }, + { + machine => { name => "64bit" }, + prio => 22, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "KDE-live-iso", + version => "*", + }, + test_suite => { name => "base_system_logging" }, + }, { machine => { name => "64bit" }, prio => 30, @@ -2438,6 +2471,17 @@ { key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" }, ], }, + { + name => "base_system_logging", + settings => [ + { key => "POSTINSTALL", value => "base_system_logging" }, + { 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 => "install_kickstart_firewall_disabled", settings => [ diff --git a/tests/base_system_logging.pm b/tests/base_system_logging.pm new file mode 100644 index 00000000..7912c893 --- /dev/null +++ b/tests/base_system_logging.pm @@ -0,0 +1,24 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + my $self=shift; + # switch to TTY3 for both, graphical and console tests + $self->root_console(tty=>3); + # Check that journalctl DOESN'T output "No entries". This is also the case when journal files are missing. + # NOTE: We are quietly assuming that something was logged in journal in last 30 minutes. Should be boot log, + # switch to TTY3 etc. + assert_script_run '! journalctl -aeb --since "30 minutes ago" | grep "\-\- No entries \-\-" -q'; + # if rsyslog package is installed (e. g. Server edition), /var/log/secure should exist and be nonempty + assert_script_run '(! rpm --quiet -q rsyslog) || [ -s /var/log/secure ]'; +} + + +sub test_flags { + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: