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

api: cache system info #651

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

marmarek
Copy link
Member

@marmarek marmarek commented Feb 4, 2025

collecting the information used for qrexec policy evaluation can be
expensive, but it doesn't change that often. cache it inside qubesd daemon,
and invalidate the cache based on events related to any of the included
information.

fixes QubesOS/qubes-issues#9362

Collecting the information used for qrexec policy evaluation can be
expensive, but it doesn't change that often. Cache it inside qubesd
daemon, and invalidate the cache based on events related to any of the
included information.

Fixes QubesOS/qubes-issues#9362
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 81.63265% with 9 lines in your changes missing coverage. Please review.

Project coverage is 69.69%. Comparing base (c1cdf38) to head (953620a).

Files with missing lines Patch % Lines
qubes/api/internal.py 80.85% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #651      +/-   ##
==========================================
- Coverage   69.71%   69.69%   -0.02%     
==========================================
  Files          58       58              
  Lines       12499    12511      +12     
==========================================
+ Hits         8714     8720       +6     
- Misses       3785     3791       +6     
Flag Coverage Δ
unittests 69.69% <81.63%> (-0.02%) ⬇️

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 Feb 6, 2025

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025020719-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=2025020404-4.3&flavor=update

  • system_tests_whonix

    • whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • whonixcheck: unnamed test (unknown)

  • system_tests_audio

  • system_tests_whonix@hw7

    • whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • whonixcheck: unnamed test (unknown)

  • system_tests_basic_vm_qrexec_gui_xfs

    • TC_03_QvmRevertTemplateChanges: test_000_revert_linux (failure)
      AssertionError: 'a266b0dade6e676389d0220bccfb5b23fe69533c' != 'f87e...
  • system_tests_extra

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

    • suspend: unnamed test (unknown)
    • suspend: Failed (test died)
      # Test died: no candidate needle with tag(s) 'SUSPEND-FAILED' match...
  • system_tests_gui_interactive

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: qr/geHTV-\d+-/...

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

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: "# "...

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: qr/2E8vz-\d+-/...

  • system_tests_suspend@hw1

    • suspend: unnamed test (unknown)
    • suspend: Failed (test died)
      # Test died: no candidate needle with tag(s) 'SUSPEND-FAILED' match...
  • 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...

Failed tests

18 failures
  • system_tests_whonix

    • whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • whonixcheck: unnamed test (unknown)

  • system_tests_audio

  • system_tests_whonix@hw7

    • whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • whonixcheck: unnamed test (unknown)

  • system_tests_basic_vm_qrexec_gui_xfs

    • TC_03_QvmRevertTemplateChanges: test_000_revert_linux (failure)
      AssertionError: 'a266b0dade6e676389d0220bccfb5b23fe69533c' != 'f87e...
  • system_tests_dispvm

    • TC_20_DispVM_fedora-41-xfce: test_100_open_in_dispvm (failure)
      AssertionError: './open-file test.txt' failed with ./open-file test...
  • system_tests_extra

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

    • suspend: unnamed test (unknown)
    • suspend: Failed (test died)
      # Test died: no candidate needle with tag(s) 'SUSPEND-FAILED' match...
  • system_tests_gui_interactive

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: qr/geHTV-\d+-/...

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

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: "# "...

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: qr/2E8vz-\d+-/...

  • system_tests_suspend@hw1

    • suspend: unnamed test (unknown)
    • suspend: Failed (test died)
      # Test died: no candidate needle with tag(s) 'SUSPEND-FAILED' match...
  • 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/127852#dependencies

30 fixed
  • system_tests_backup

    • TC_10_BackupVM_whonix-gateway-17: test_110_send_to_vm_no_space (error)
      subprocess.CalledProcessError: Command 'mknod /dev/loop0 b 7 0;trun...

    • TC_10_BackupVM_whonix-workstation-17: test_110_send_to_vm_no_space (error)
      subprocess.CalledProcessError: Command 'mknod /dev/loop0 b 7 0;trun...

  • system_tests_basic_vm_qrexec_gui_ext4

    • switch_pool: Failed (test died)
      # Test died: command 'printf "label: gpt\n,,L" | sfdisk /dev/sdb' f...
  • system_tests_audio

  • system_tests_devices

    • TC_00_List_whonix-gateway-17: test_000_list_loop (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-gateway-17: test_001_list_loop_mounted (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-gateway-17: test_010_list_dm (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-gateway-17: test_011_list_dm_mounted (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-gateway-17: test_012_list_dm_delayed (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-gateway-17: test_013_list_dm_removed (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-gateway-17: test_020_list_loop_partition (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-gateway-17: test_021_list_loop_partition_mounted (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-workstation-17: test_000_list_loop (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-workstation-17: test_001_list_loop_mounted (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-workstation-17: test_010_list_dm (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-workstation-17: test_011_list_dm_mounted (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-workstation-17: test_012_list_dm_delayed (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-workstation-17: test_013_list_dm_removed (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-workstation-17: test_020_list_loop_partition (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_00_List_whonix-workstation-17: test_021_list_loop_partition_mounted (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_10_Attach_whonix-gateway-17: test_000_attach_reattach (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

    • TC_10_Attach_whonix-workstation-17: test_000_attach_reattach (error)
      subprocess.CalledProcessError: Command 'set -e;truncate -s 128M /tm...

  • system_tests_qrexec

  • system_tests_suspend

    • mount_and_boot_options: unnamed test (unknown)
    • mount_and_boot_options: Failed (test died)
      # Test died: no candidate needle with tag(s) 'x11' matched...
  • system_tests_qrexec_perf@hw1

    • TC_00_QrexecPerf_debian-12-xfce: test_110_simple_data_duplex (failure)
      AssertionError: '/usr/lib/qubes/tests/qrexec_perf.py --vm1=test-ins...
  • system_tests_storage_perf@hw1

    • integ: storage_perf (error)
      ModuleNotFoundError: No module named 'qubes.tests.integ.storage_perf'
  • system_tests_kde_gui_interactive

    • clipboard_and_web: unnamed test (unknown)
    • clipboard_and_web: Failed (test died)
      # Test died: no candidate needle with tag(s) 'menu-vm-firefox' matc...

Unstable tests

## Performance Tests ### Performance degradation: No issues ### Remaining performance tests: No remaining performance tests

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.

Cache "system info" structure for qrexec policy evaluation
2 participants