8fde224dc5
Summary: This adds three new custom storage tests and some needles to support them, and tweaks the custom storage methods a bit to address some things that cropped up in writing the tests. A new method is added for changing the filesystem, as that's a distinct operation from changing the device type. This also restores the previous behaviour of select_disks() where it handled selecting custom partitioning when needed. Turns out it's pretty common to use regex'es in perl! Who'd'a thought. A corresponding commit to add the tests to openqa_fedora_tools is coming. There's no post-install step for the tests yet; I'll try and write those up and add them soon. Test Plan: Do a full run, including the new tests, on Alpha RC2 and check all are scheduled correctly and run correctly. The LVM thinp test is expected to fail as it catches a genuine bug. Reviewers: jskladan, garretraziel Reviewed By: garretraziel Subscribers: tflink Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D490 |
||
---|---|---|
lib | ||
needles | ||
tests | ||
.arcconfig | ||
.gitignore | ||
COPYING | ||
main.pm | ||
README.md | ||
templates | ||
VARIABLES.md |
OpenQA tests for the Fedora distribution
This repository contains tests and images for testing Fedora with OpenQA. For additional tools, Installation Guide and Docker images, see this repository.
Test development
See official documentation on basic concept, test development (including API specification), needles specification and supported variables for backend. See this example repo on how tests should be structured.
In short, since OpenQA uses only one entrypoint for all tests (main.pm
), we have decided to utilize
this feature and make tests modular. It means that basic passing through main.pm
(without any variables set)
results in most basic installation test executed. Developer can then customize it with additional variables
(for example by setting PACKAGE_SET=minimal
to do installation only with minimal package set).
Make your test modular, so that it utilizes _boot_to_anaconda()
and _do_install_and_reboot()
tests (that are loaded automatically). Break your test into smaller parts, each dealing with one
specific feature (e. g. partitioning, user creation...) and add their loading into main.pm
based
on reasonable variable setting (so they can be used in other tests also).
Test inheritance
Your test can inherit from basetest
, fedorabase
, installedtest
or anacondatest
.
basetest
is basic class provided by os-autoinst - it has emptypost_fail_hook()
and doesn't set any flags.fedorabase
doesn't neither set flags nor does anything inpost_fail_hook()
, but it provides basic functions that will be useful during testing Fedora, likeconsole_login()
orboot_to_login_screen()
. It should be used when no other, more specific class can be used.anacondatest
should be used in tests where Anaconda is running. It uploads Anaconda logs (for exampleanaconda.log
orpackaging.log
) inpost_fail_hook()
. It also provides convenient methods for Anaconda likeselect_disks()
.installedtest
should be used in tests that are running on installed system (either in postinstall phase or in upgrade tests). It uploads/var/log
inpost_fail_hook()
.
Test development checklist
- Select test from this document or from phabricator page
- Put each part of your test as a separate file into
tests/
directory, reimplementingrun()
method andtest_flags()
method, inheriting from one of the classes mentioned above. - Set correct variables (so that all test parts you have made are executed) in WebUI -> Test suites.
- Link your newly created Test suite to medium type in WebUI -> Job groups.
- Run test (see openqa_fedora_tools repository).
- Create needles (images) by using interactive mode and needles editor in WebUI.
- Add new Job template and Test suite into
templates
file. - Add new Test suite and Test case into
conf_test_suites.py
file in openqa_fedora_tools repository. - Mark your test in PhaseSeparation.md as done.
- Open differential request via phabricator.