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

Various test improvement, especially for testing minimal templates #639

Merged
merged 15 commits into from
Dec 11, 2024

Conversation

marmarek
Copy link
Member

No description provided.

This allows more effective skipping tests for specific templates -
without doing any setUp/tearDown.
... using another template for management dvm. That other template can
be selected with QUBES_TEST_MGMT_TPL variable.

For this to fully work, test updating a template instead of AppVM, as it
will use updates proxy which should work with minimal template (contrary
to direct network access).
This makes sense for testing if in-vm kernel works out of the box in
selected templates.

QubesOS/qubes-issues#5212
Plain minimial template wont work, but this allows testing if minimal +
just networking packages installed. Specifically, this tests if
installing qubes-core-agent-networking is enough to get networking
working with minimal template.
Copy link

codecov bot commented Nov 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.49%. Comparing base (039b7d3) to head (452b6a3).
Report is 18 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #639   +/-   ##
=======================================
  Coverage   69.49%   69.49%           
=======================================
  Files          58       58           
  Lines       12465    12465           
=======================================
  Hits         8663     8663           
  Misses       3802     3802           
Flag Coverage Δ
unittests 69.49% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@qubesos-bot
Copy link

qubesos-bot commented Nov 30, 2024

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024121004-4.3&flavor=pull-requests

Test run included the following:

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024111705-4.3&flavor=update

  • system_tests_extra

    • TC_00_QVCTest_whonix-workstation-17: test_010_screenshare (failure)
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^... AssertionError: 0 == 0
  • system_tests_kde_gui_interactive

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: "echo -e '[Layout]\nLayoutList=us,de' | sud...

Failed tests

4 failures
  • system_tests_extra

    • TC_00_QVCTest_whonix-gateway-17: test_010_screenshare (failure)
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^... AssertionError: 0 == 0

    • TC_00_QVCTest_whonix-workstation-17: test_010_screenshare (failure)
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^... AssertionError: 0 == 0

  • system_tests_kde_gui_interactive

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: "echo -e '[Layout]\nLayoutList=us,de' | sud...

    • gui_keyboard_layout: Failed (test died)
      # Test died: command 'test "$(cd ~user;ls e1*)" = "$(qvm-run -p wor...

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/119126#dependencies

2 fixed
  • system_tests_audio@hw1

  • system_tests_basic_vm_qrexec_gui_zfs

    • switch_pool: Failed (test died)
      # Test died: command 'dnf install -y ./zfs-release.rpm' failed at /...

Unstable tests

  • system_tests_audio

    TC_20_AudioVM_PipeWire_fedora-40-xfce/test_260_audio_mic_enabled_switch_audiovm (1/5 times with errors)
    • job 117586 AssertionError: too short audio, expected 10s, got 0.00013605442176...
  • system_tests_audio@hw1

    TC_20_AudioVM_PipeWire_fedora-40-xfce/test_260_audio_mic_enabled_switch_audiovm (1/5 times with errors)
    • job 117586 AssertionError: too short audio, expected 10s, got 0.00013605442176...

Skip only the direct (no-proxy) update test, as minimal template doesn't
have networking packages included. But do test all scenarios with proxy,
just use the default template for repo-hosting VM.
HVM has disabled memory hotplug (due to incompatibility with QEMU), and
so needs more RAM to fit everything + memory accounting for full maxmem.

While at it, adjust the test to check if kernel-related settings are
correctly inherited from the template.
@@ -338,7 +338,7 @@ def _configure_audio_recording(self, vm):
str(source_index),
]
if audiovm.name != "dom0":
self.loop.run_until_complete(audiovm.run(" ".join(cmd)))
self.loop.run_until_complete(audiovm.run_for_stdio(" ".join(cmd)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this escape each element?

Copy link
Member Author

@marmarek marmarek Dec 9, 2024

Choose a reason for hiding this comment

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

Not necessary, the command is built literally few lines above and doesn't contain spaces or other fancy chars (and if it would, it should explode)

@marmarek marmarek force-pushed the tests-minimal branch 6 times, most recently from 2344942 to 301f33d Compare December 10, 2024 03:15
When QUBES_TEST_WAIT_ON_FAIL=1 is set, do not wait if the test raises
SkipTest exception. It's an expected behavior, not a real failure.
It seems pactl still exits with code 0 even if the change wasn't made.
There is no info about it on stderr either.
Verify if source-output was changed after the call, and if not - retry.
It's faster as the test is skipped before calling setUp().
Those do not have usage info available, so return None for metadata
usage, instead of crashing on `float('')` call.

Fixes: 6dffbf9 "storage/lvm: allow starting a VM even if not all its volumes are active"
Wait for the local repo to become available - python3 -m http may take a
moment, and if the other parts are quick, the test would fail on
connection refused error.
The point of the test is not its speed, but whether it eventually
happens. On the other hand, some of the test runners can be quite slow
under load.
@marmarek marmarek merged commit 95f7159 into QubesOS:main Dec 11, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants