lib/opensusebasetest.pm

clear_and_verify_console

clear_and_verify_console();

Clear the console and ensure that it really got cleared using a needle.

pre_run_hook

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

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.

investigate_yast2_failure

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_logs_locale

export_logs_locale();

Upload logs related to system locale settings. This includes locale, localectl and /etc/vconsole.conf.

upload_packagekit_logs

upload_packagekit_logs();

Upload /var/log/pk_backend_zypp.

set_standard_prompt

set_standard_prompt();

Set a simple reproducible prompt for easier needle matching without hostname.

handle_uefi_boot_disk_workaround

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

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

wait_grub_to_boot_on_local_disk

When bootloader appears, make sure to boot from local disk when it is on aarch64.

handle_pxeboot

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

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

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

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

firewall();

Return the default expected firewall implementation depending on the product under test, the version and if the SUT is an upgrade.

post_fail_hook

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.