Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PROPOSAL]Schedule systemd upstream tests dynamically #15083

Merged
merged 2 commits into from Aug 8, 2022

Conversation

mloviska
Copy link
Contributor

Tests provided by systemd upstream are packaged in systemd-testsuite.
Each test case is defined in folder with naming convention
TEST-\d{2}-$testname. The runner schedules all test cases that are
present in the provided package. Tests are preferably running in nswapn,
however some of them require qemu.
Users can override the default schedule either excluding certain test
cases provided by a regex. For debug purposes users can provide a list
of tests that will override the default schedule.

@github-actions
Copy link

Great PR! Please pay attention to the following items before merging:

Files matching lib/**.pm:

  • Consider adding or extending unit tests in t/

This is an automatically generated QA checklist based on modified files

@mloviska
Copy link
Contributor Author

mloviska commented Jun 15, 2022

This PR is only a proposal, as I haven't seen how the test are schedule in the current state.

@mloviska mloviska changed the title Schedule systemd upstream tests dynamically [PROPOSAL]Schedule systemd upstream tests dynamically Jun 15, 2022
@mloviska mloviska marked this pull request as ready for review July 4, 2022 14:06
Copy link
Contributor

@mdoucha mdoucha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,70 @@
# SUSE's openQA tests
#
# Copyright 2019-2020 SUSE LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you can neglect the dates. Otherwise i think it needs update

Copy link
Contributor

@b10n1k b10n1k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice @mloviska. just minor comments.

@mloviska
Copy link
Contributor Author

mloviska commented Jul 8, 2022

Hello @tblume, may I ask you for review as well? This way we can do not need to a file per test case in tests folder, and it should be easier to exclude several test cases.

@tblume
Copy link
Contributor

tblume commented Jul 8, 2022

Hello @tblume, may I ask you for review as well? This way we can do not need to a file per test case in tests folder, and it should be easier to exclude several test cases.

I'm happy that the systemd-testsuite code gets some maintenance from you guys!
You know much better than I do.
I agree to the changes and would like to test them on my local openqa machine.
What would be the appropriate openqa-clone-job command to test it?

@mloviska
Copy link
Contributor Author

mloviska commented Jul 8, 2022

What would be the appropriate openqa-clone-job command to test it?

Should be fairly easy, I have got some examples cloning opensuse-Tumbleweed-DVD-x86_64-Build20220707-extra_tests_textmode@64bit.

  1. Full schedule ( all test cases included in the package )
    /usr/share/openqa/script/clone_job.pl --from https://openqa.opensuse.org --host localhost 2458023 TEST=systemd SYSTEMD_TESTSUITE=1 YAML_SCHEDULE= --skip-chained-deps

  2. Exclude TEST-06-SELINUX only
    /usr/share/openqa/script/clone_job.pl --from https://openqa.opensuse.org --host localhost 2458023 TEST=systemd SYSTEMD_TESTSUITE=1 YAML_SCHEDULE= SYSTEMD_EXCLUDE=TEST-06-SELINUX --skip-chained-deps

  3. Run only TEST-0.*
    /usr/share/openqa/script/clone_job.pl --from https://openqa.opensuse.org --host localhost 2458023 TEST=systemd SYSTEMD_TESTSUITE=1 YAML_SCHEDULE= SYSTEMD_EXCLUDE="TEST-[1-9].*" --skip-chained-deps

  4. Include only TEST-01-BASIC and change default test case parameters to UNIFIED_CGROUP_HIERARCHY="no" and TEST_PREFER_NSPAWN=0
    /usr/share/openqa/script/clone_job.pl --from https://openqa.opensuse.org --host localhost 2458023 TEST=systemd SYSTEMD_TESTSUITE=1 YAML_SCHEDULE= SYSTEMD_INCLUDE=TEST-01-BASIC SYSTEMD_UNIFIED_CGROUP="no" SYSTEMD_NSPAWN=0 --skip-chained-deps

@tblume
Copy link
Contributor

tblume commented Jul 8, 2022

What would be the appropriate openqa-clone-job command to test it?

Should be fairly easy, I have got some examples cloning opensuse-Tumbleweed-DVD-x86_64-Build20220707-extra_tests_textmode@64bit.

1. [Full schedule ( all test cases included in the package )](http://kepler.suse.cz/tests/17649#)
   /usr/share/openqa/script/clone_job.pl --from https://openqa.opensuse.org --host localhost 2458023 TEST=systemd SYSTEMD_TESTSUITE=1 YAML_SCHEDULE= --skip-chained-deps

Hm, I get a strange error when executing the tests therewith (booting from a previously created image):

--<
Test died: Failed to wait for login prompt at sle/lib/serial_terminal.pm line 134.
serial_terminal::login("root", "# ") called at sle/lib/susedistribution.pm line 816
susedistribution::activate_console(Distribution::Sle::15_current=HASH(0x556480ffe8e8), "root-virtio-terminal") called at /usr/lib/os-autoinst/testapi.pm line 1769
testapi::select_console("root-virtio-terminal") called at sle/lib/opensusebasetest.pm line 1320
opensusebasetest::select_serial_terminal(runner=HASH(0x5564812f9de0)) called at sle/tests/systemd_testsuite/runner.pm line 35
runner::run(runner=HASH(0x5564812f9de0), OpenQA::Test::RunArgs=HASH(0x556481bee918)) called at /usr/lib/os-autoinst/basetest.pm line 324
eval {...} called at /usr/lib/os-autoinst/basetest.pm line 322
basetest::runtest(runner=HASH(0x5564812f9de0)) called at /usr/lib/os-autoinst/autotest.pm line 360
eval {...} called at /usr/lib/os-autoinst/autotest.pm line 360
autotest::runalltests() called at /usr/lib/os-autoinst/autotest.pm line 236
eval {...} called at /usr/lib/os-autoinst/autotest.pm line 236
autotest::run_all() called at /usr/lib/os-autoinst/autotest.pm line 287
autotest::ANON(Mojo::IOLoop::ReadWriteProcess=HASH(0x556482b51090)) called at /usr/lib/perl5/vendor_perl/5.26.1/Mojo/IOLoop/ReadWriteProcess.pm line 326
eval {...} called at /usr/lib/perl5/vendor_perl/5.26.1/Mojo/IOLoop/ReadWriteProcess.pm line 326
Mojo::IOLoop::ReadWriteProcess::_fork(Mojo::IOLoop::ReadWriteProcess=HASH(0x556482b51090), CODE(0x556482ae5990)) called at /usr/lib/perl5/vendor_perl/5.26.1/Mojo/IOLoop/ReadWriteProcess.pm line 488
Mojo::IOLoop::ReadWriteProcess::start(Mojo::IOLoop::ReadWriteProcess=HASH(0x556482b51090)) called at /usr/lib/os-autoinst/autotest.pm line 289
autotest::start_process() called at /usr/bin/isotovideo line 256
--<

you can take a look at my testmachine at: http://knopfler.arch.suse.de/tests/8#

@mloviska
Copy link
Contributor Author

mloviska commented Jul 8, 2022

What would be the appropriate openqa-clone-job command to test it?

Should be fairly easy, I have got some examples cloning opensuse-Tumbleweed-DVD-x86_64-Build20220707-extra_tests_textmode@64bit.

1. [Full schedule ( all test cases included in the package )](http://kepler.suse.cz/tests/17649#)
   /usr/share/openqa/script/clone_job.pl --from https://openqa.opensuse.org --host localhost 2458023 TEST=systemd SYSTEMD_TESTSUITE=1 YAML_SCHEDULE= --skip-chained-deps

Hm, I get a strange error when executing the tests therewith (booting from a previously created image):

--< Test died: Failed to wait for login prompt at sle/lib/serial_terminal.pm line 134. serial_terminal::login("root", "# ") called at sle/lib/susedistribution.pm line 816 susedistribution::activate_console(Distribution::Sle::15_current=HASH(0x556480ffe8e8), "root-virtio-terminal") called at /usr/lib/os-autoinst/testapi.pm line 1769 testapi::select_console("root-virtio-terminal") called at sle/lib/opensusebasetest.pm line 1320 opensusebasetest::select_serial_terminal(runner=HASH(0x5564812f9de0)) called at sle/tests/systemd_testsuite/runner.pm line 35 runner::run(runner=HASH(0x5564812f9de0), OpenQA::Test::RunArgs=HASH(0x556481bee918)) called at /usr/lib/os-autoinst/basetest.pm line 324 eval {...} called at /usr/lib/os-autoinst/basetest.pm line 322 basetest::runtest(runner=HASH(0x5564812f9de0)) called at /usr/lib/os-autoinst/autotest.pm line 360 eval {...} called at /usr/lib/os-autoinst/autotest.pm line 360 autotest::runalltests() called at /usr/lib/os-autoinst/autotest.pm line 236 eval {...} called at /usr/lib/os-autoinst/autotest.pm line 236 autotest::run_all() called at /usr/lib/os-autoinst/autotest.pm line 287 autotest::ANON(Mojo::IOLoop::ReadWriteProcess=HASH(0x556482b51090)) called at /usr/lib/perl5/vendor_perl/5.26.1/Mojo/IOLoop/ReadWriteProcess.pm line 326 eval {...} called at /usr/lib/perl5/vendor_perl/5.26.1/Mojo/IOLoop/ReadWriteProcess.pm line 326 Mojo::IOLoop::ReadWriteProcess::_fork(Mojo::IOLoop::ReadWriteProcess=HASH(0x556482b51090), CODE(0x556482ae5990)) called at /usr/lib/perl5/vendor_perl/5.26.1/Mojo/IOLoop/ReadWriteProcess.pm line 488 Mojo::IOLoop::ReadWriteProcess::start(Mojo::IOLoop::ReadWriteProcess=HASH(0x556482b51090)) called at /usr/lib/os-autoinst/autotest.pm line 289 autotest::start_process() called at /usr/bin/isotovideo line 256 --<

you can take a look at my testmachine at: http://knopfler.arch.suse.de/tests/8#

I assume it happens because the VM has been shutdown. I am always using jobs that are chained after the installation as extra_tests_dracut. Installation jobs, mainly the ones that create a HDD set openQA variable INSTALLONLY=1 that should prevent other post installation tests to be scheduled.

http://kepler.suse.cz/tests/17660#

Copy link
Contributor

@cfconrad cfconrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
And thx for showing autotest::loadtest() during runtime!!

Tests provided by systemd upstream are packaged in *systemd-testsuite*.
Each test case is defined in folder with naming convention
`TEST-\d{2}-$testname`. The runner schedules all test cases that are
present in the provided package. Tests are preferably running in nswapn,
however some of them require qemu.
Users can override the default schedule either excluding certain test
cases provided by a regex. For debug purposes users can provide a list
of tests that will override the default schedule.
@mloviska
Copy link
Contributor Author

Hello all, can we merge it if there are no objections?

@mloviska mloviska merged commit 9522ec0 into os-autoinst:master Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants