1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-27 16:13:09 +00:00

Workaround issues with loading same module more than once

Summary:
Loading the same module more than once *kinda* works, but it
shows up all kinds of funky in the openQA web interface. There's
a POO for this:
https://progress.opensuse.org/issues/10514
But it doesn't seem like it's going to be resolved immediately,
so in the mean time maybe we should avoid doing it so we don't
have to deal with the weirdness it produces in the web UI. So
here's a kinda icky hack that uses symlinks and stuff to load
multiple instances of 'the same' test module.

Test Plan:
Run an update test, look at how it looks in the web
UI and confirm it's a lot clearer and less buggy. Check there
aren't any bugs in the loading approach. This is deployed on stg
so you can look at it there.

Reviewers: jsedlak, jskladan

Reviewed By: jsedlak

Subscribers: tflink

Differential Revision: https://phab.qa.fedoraproject.org/D1186
This commit is contained in:
Adam Williamson 2017-04-13 14:47:17 -07:00
parent 9da72de4ed
commit e6076e14b8
5 changed files with 27 additions and 6 deletions

29
main.pm
View File

@ -172,26 +172,43 @@ sub load_install_tests() {
autotest::loadtest "tests/_do_install_and_reboot.pm";
}
sub _load_early_postinstall_tests() {
sub _load_instance {
# loads a specific 'instance' of a given test. See next function
# for more details.
my ($test, $instance) = @_;
$test .= "_${instance}" if $instance;
autotest::loadtest "${test}.pm";
}
sub _load_early_postinstall_tests {
# Early post-install test loading. Split out as a separate sub
# because we do this all twice on update tests.
# openQA isn't very good at handling jobs where the same module
# is loaded more than once, and fixing that will be a bit complex
# and no-one got around to it yet. So for now, we use a bit of a
# hack: for modules we know may get loaded multiple times, we have
# symlinks named _2, _3 etc. This function can be passed an arg
# specifying which 'instance' of the tests to use.
my ($instance) = @_;
$instance //= 0;
# Unlock encrypted storage volumes, if necessary. The test name here
# follows the 'storage post-install' convention, but must be run earlier.
if (get_var("ENCRYPT_PASSWORD")) {
autotest::loadtest "tests/disk_guided_encrypted_postinstall.pm";
_load_instance("tests/disk_guided_encrypted_postinstall", $instance);
}
# Appropriate login method for install type
if (get_var("DESKTOP")) {
autotest::loadtest "tests/_graphical_wait_login.pm";
_load_instance("tests/_graphical_wait_login", $instance);
}
# Test non-US input at this point, on language tests
if (get_var("SWITCHED_LAYOUT") || get_var("INPUT_METHOD")) {
autotest::loadtest "tests/_graphical_input.pm";
_load_instance("tests/_graphical_input", $instance);
}
unless (get_var("DESKTOP")) {
autotest::loadtest "tests/_console_wait_login.pm";
_load_instance("tests/_console_wait_login", $instance);
}
}
@ -219,7 +236,7 @@ sub load_postinstall_tests() {
if (get_var("ADVISORY")) {
autotest::loadtest "tests/_advisory_update.pm";
# now load the early boot tests again, as _advisory_update reboots
_load_early_postinstall_tests();
_load_early_postinstall_tests(2);
}
# from now on, we have fully installed and booted system with root/specified user logged in

View File

@ -0,0 +1 @@
_console_wait_login.pm

1
tests/_graphical_input_2.pm Symbolic link
View File

@ -0,0 +1 @@
_graphical_input.pm

View File

@ -0,0 +1 @@
_graphical_wait_login.pm

View File

@ -0,0 +1 @@
disk_guided_encrypted_postinstall.pm