clear_and_verify_console();
Clear the console and ensure that it really got cleared using a needle.
pre_run_hook();
This method will be called before each module is executed. Test modules (or their intermediate base classes) may overwrite this method, must call this baseclass method from the overwriting method.
post_run_hook();
This method will be called after each module finished. It will not get executed when the test module failed. Test modules (or their intermediate base classes) may overwrite this method.
save_and_upload_log($cmd, $file [, timeout => $timeout] [, screenshot => $screenshot] [, noupload => $noupload]);
Will run $cmd
on the SUT (without caring for the return code) and tee the standard output to a file called $file
. The $timeout
parameter specifies how long $cmd
may run. When $cmd
returns, the output file will be uploaded to openQA unless $noupload
is set. Afterwards a screenshot will be created if $screenshot
is set.
tar_and_upload_log($sources, $dest, [, timeout => $timeout] [, screenshot => $screenshot] [, noupload => $noupload]);
Will create an xz compressed tar archive with filename $dest
from the folder(s) listed in $sources
. The return code of tar
will be ignored. The $timeout
parameter specifies how long tar
may run. When tar
returns, the output file will be uploaded to openQA unless $noupload
is set. Afterwards a screenshot will be created if $screenshot
is set.
save_and_upload_systemd_unit_log($unit);
Saves the journal of the systemd unit $unit
to journal_$unit.log
and uploads it to openQA.
detect_bsc_1063638();
Btrfs maintenance jobs lead to the system being unresponsive and affects SUT's performance. Not to waste time during investigation of the failures, we would like to detect if such jobs are running, providing a hint why test timed out. This method will create a softfail if such a problem is detected.
problem_detection();
This method will upload a number of logs and debugging information. This includes a log with all journal errors, a systemd unit plot and the output of rpmverify. The files will be uploaded as a single tarball called problem_detection_logs.tar.xz
.
investigate_yast2_failure(logs_path => $logs_path);
Inspect the YaST2 logfile checking for known issues. logs_path can be a directory where logs are saved e.g. /tmp. In that case the function will parse /tmp/var/log/YaST2/y2logs* files.
export_healthcheck_basic();
Upload healthcheck logs that make sense for any failure. This includes cpu
, memory
and fdisk
.
export_logs_basic();
Upload logs that make sense for any failure. This includes /proc/loadavg
, ps axf
, complete journal since last boot, dmesg
and /etc/sysconfig
.
select_log_console();
Select 'log-console' with higher timeout on screen check to even cover systems that react very slow due to high background load or high memory consumption. This should be especially useful in post_fail_hook
implementations.
export_logs();
This method will call several other log gathering methods from this class.
export_logs_locale();
Upload logs related to system locale settings. This includes locale
, localectl
and /etc/vconsole.conf
.
upload_packagekit_logs();
Upload /var/log/pk_backend_zypp
.
upload_solvertestcase_logs();
Upload /tmp/solverTestCase.tar.bz2
.
set_standard_prompt();
Set a simple reproducible prompt for easier needle matching without hostname.
export_logs_desktop();
Upload several KDE, GNOME, X11, GDM and SDDM related logs and configs.
handle_uefi_boot_disk_workaround();
Our aarch64 setup fails to boot properly from an installed hard disk so point the firmware boot manager to the right file.
wait_grub([bootloader_time => $bootloader_time] [,in_grub => $in_grub]);
Makes sure the bootloader appears. Returns successfully when reached the bootloader menu, ready to control it further or continue. The time waiting for the bootloader can be configured with $bootloader_time
in seconds. Set $in_grub
to 1 when the SUT is already expected to be within the grub menu.
wait_grub_to_boot_on_local_disk
When bootloader appears, make sure to boot from local disk when it is on aarch64.
handle_pxeboot(bootloader_time => $bootloader_time, pxemenu => $pxemenu, pxeselect => $pxeselect);
Handle a textmode PXE bootloader menu by means of two needle tags: $pxemenu
to match the initial menu, $pxeselect
to match the menu with the desired entry selected.
wait_boot_past_bootloader([, textmode => $textmode] [,ready_time => $ready_time] [, nologin => $nologin] [, forcenologin => $forcenologin]);
Waits until the system is booted, every step after the bootloader or bootloader menu. Returns successfully when the system is ready on a login prompt or logged in desktop. Set $textmode
to 1 when the text mode login prompt should be expected rather than a desktop or display manager. Expects already unlocked encrypted disks, see wait_boot
for handling these in before. The time waiting for the system to be fully booted can be configured with $ready_time
in seconds. $forcenologin
makes this function behave as if the env var NOAUTOLOGIN was set.
wait_boot([bootloader_time => $bootloader_time] [, textmode => $textmode] [,ready_time => $ready_time] [,in_grub => $in_grub] [, nologin => $nologin] [, forcenologin => $forcenologin]);
Makes sure the bootloader appears and then boots to desktop or text mode correspondingly. Returns successfully when the system is ready on a login prompt or logged in desktop. Set $textmode
to 1 when the text mode login prompt should be expected rather than a desktop or display manager. wait_boot
also handles unlocking encrypted disks if needed as well as various exceptions during the boot process. Also, before the bootloader menu or login prompt various architecture or machine specific handlings are in place. The time waiting for the bootloader can be configured with $bootloader_time
in seconds as well as the time waiting for the system to be fully booted with $ready_time
in seconds. Set $in_grub
to 1 when the SUT is already expected to be within the grub menu. wait_boot
continues from there. $forcenologin
makes this function behave as if the env var NOAUTOLOGIN was set.
enter_test_text($name [, cmd => $cmd] [, slow => $slow]);
For testing a text editor or terminal emulator. This will type some newlines and then enter the following text:
If you can see this text $name is working.
$name
will default to "your program". If $slow
is set, the typing will be very slow. If $cmd
is set, the text will be prefixed by an echo
command.
firewall();
Return the default expected firewall implementation depending on the product under test, the version and if the SUT is an upgrade.
remount_tmp_if_ro();
Mounts /tmp to shared memory if not possible to write to tmp. For example, save_y2logs creates temporary files there.
select_serial_terminal($root);
Select most suitable text console. The optional parameter root
controls whether the console will have root privileges or not. Passing any value that evaluates to true will select a root console (default). Passing any value that evaluates to false will select unprivileged user console. The choice is made by BACKEND and other variables.
Purpose of this wrapper is to avoid if/else conditions when selecting console.
Optional root
parameter specifies, whether use root user (root
=1, also default when parameter not specified) or prefer non-root user if available.
Variables affecting behavior: VIRTIO_CONSOLE
=0 disables virtio console (use {root,user}-console instead of the default {root-,user-}virtio-terminal) NOTE: virtio console is enabled by default (VIRTIO_CONSOLE
=1). For ppc64le it requires to call prepare_serial_console() to before first use (used in console/system_prepare and shutdown/cleanup_before_shutdown modules) and console=hvc0 in kernel parameters (add it to autoyast profile or update grub setup manually with add_grub_cmdline_settings()).
SERIAL_CONSOLE
=0 disables serial console (use {root,user}-console instead of the default {root-,}sut-serial) NOTE: serial console is disabled by default on all but s390x machines (SERIAL_CONSOLE
=0), because it's not working yet on other machines (see poo#55985). For s390x it requires console=ttysclp0 in kernel parameters (add it to autoyast profile or update grub setup manually with add_grub_cmdline_settings()).
On ikvm|ipmi|spvm|pvm_hmc it's expected, that use_ssh_serial_console() has been called (done via activate_console()) therefore SERIALDEV has been set and we can use root-ssh console directly.
select_user_serial_terminal();
Select most suitable text console with non-root user. The choice is made by BACKEND and other variables.
upload_coredumps(%args);
Upload all coredumps to logs. In case `proceed_on_failure` key is set to true, errors during logs collection will be ignored, which is usefull for the post_fail_hook calls.
post_fail_hook();
When the test module fails, this method will be called. It will try to fetch some logs from the SUT. Test modules (or their intermediate base classes) may overwrite this method to export certain specific logfiles and call the base method using $self->SUPER::post_fail_hook;
at the end.