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

Rebase on upstream #2

Open
wants to merge 206 commits into
base: 3mdeb-lab
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
d198dda
Add option to force disable USBVM
marmarek Mar 9, 2024
954bf93
Add test for S0ix
marmarek Mar 9, 2024
c50d6be
Allow running qubes-gui-agent tests on the "kernel" flavor
marmarek Mar 9, 2024
b0d18b0
Allow choosing test flavor for PRs test
marmarek Mar 9, 2024
211a759
Fixes for template tests
marmarek Mar 9, 2024
80fd456
Archlinux testing support
marmarek Mar 9, 2024
ae94f0d
Update for newer Heads build
marmarek Mar 9, 2024
8fef43d
suspend: add commented-out enabling wake-on-lan
marmarek Mar 9, 2024
72c60c3
Misc minor fixes
marmarek Mar 9, 2024
c12e7bd
Needles update
marmarek Mar 9, 2024
5a08091
Use relocated OVMF
marmarek Mar 11, 2024
86d40ac
Install qubes-video-companion to have it tested
marmarek Mar 15, 2024
dfe4085
Fix handling disk unlock key with heads
marmarek Mar 15, 2024
6dab4f4
Handle new menu opening on "favorites" tab by default
marmarek Mar 15, 2024
b78f8bb
Prefer wait_still_screen over hardcoded sleep times
marmarek Mar 15, 2024
2ab773e
Needles update
marmarek Mar 15, 2024
5b7491c
Use openQA's copy of the repository key instead of fetching from gitl…
marmarek Mar 15, 2024
a6088ba
Enable testing / CI repo before installing updates and extra packages
marmarek May 9, 2024
f584531
Move OVMF even higher in the memory map
marmarek May 9, 2024
80e4bba
document INSTALL_OEM variables
marmarek May 9, 2024
cb57365
Allow PR-originating builds for grub2 too -> via "kernel" flavor
marmarek May 9, 2024
73036ed
Include minutes in the PR builds
marmarek May 9, 2024
e559270
Install qubes-audio-daemon
marmarek May 9, 2024
98927f5
Extend Heads handling
marmarek May 9, 2024
b7d4069
Handle menu configured to start on favorites tab
marmarek May 9, 2024
e0bbcec
Extend handling inactive windows in installer
marmarek May 9, 2024
843ba18
Handle geany without any file open
marmarek May 9, 2024
49b1b28
Fix handling updating the qubesteststub package
marmarek May 9, 2024
ddd1737
Increase some timeouts
marmarek May 9, 2024
a24f200
Needles update
marmarek May 9, 2024
d3c181c
Dump updated job templates
marmarek May 9, 2024
500709b
api: fix symlinks handling in gitlab artifacts
marmarek Jun 15, 2024
d656900
Document DEFAULT_TEMPLATE
marmarek Jun 15, 2024
b58a593
Add R4.3 handling and switch default to it
marmarek Jun 15, 2024
db52c2f
api: allow requesting UPDATE_TEMPLATES too
marmarek Jun 15, 2024
641d609
Upload sut_packages.txt
marmarek Jun 15, 2024
164fb4c
Add QVC to packages mapping
marmarek Jun 15, 2024
96d2f0a
Include tested PRs links in github report comment
marmarek Jun 15, 2024
cd656b7
Improve handling VMs with IOMMU
marmarek Jun 15, 2024
861cf40
Fix handling Arch updates
marmarek Jun 15, 2024
302994b
Collect more logs earlier on failure
marmarek Jun 15, 2024
a686607
new devices API handling in the test fixup module
marmarek Jun 15, 2024
19c33da
Hardware workers update
marmarek Jun 15, 2024
415ba63
Use a wrapper to select GUI console
marmarek Jun 15, 2024
3deadf9
Add setup of sys-gui-vnc
marmarek Jun 15, 2024
c664a95
Allow setting VERSION in 'openQArun' command
marmarek Jun 18, 2024
931d71f
Fix grub2-pc-modules install on R4.3
marmarek Jun 18, 2024
e5a5ae4
Do not fail post-fail-hook if switching console fails
marmarek Jun 18, 2024
f84959b
Needles update
marmarek Jun 18, 2024
3b2eec0
Improve handling LUKS prompt on hardware runners
marmarek Aug 5, 2024
3433d0b
Improve network manager clicking reliability
marmarek Aug 5, 2024
29855ef
Fixes for sys-gui-vnc test
marmarek Aug 5, 2024
6e65313
Add support for tests using PS/2 HID
marmarek Aug 5, 2024
84d9628
Reset SSH console after restarting sys-net
marmarek Aug 5, 2024
ef7b383
Improve password prompt handling after suspend
marmarek Aug 5, 2024
1e3d3a5
Unify timeouts a bit
marmarek Aug 5, 2024
ca427d1
Type slower to improve reliability
marmarek Aug 5, 2024
2795371
Needles update and cleanup
marmarek Aug 5, 2024
d8e88cf
Add patched seabios binary
marmarek Aug 5, 2024
df80088
Confirm file copy with a keyboard
marmarek Aug 5, 2024
d0f355d
fixup for new q-dev api
marmarek Sep 10, 2024
388eb3c
R4.3 is on F41 now
marmarek Sep 10, 2024
ed5d025
Handle xfce4-screenlocker
marmarek Sep 10, 2024
e582dad
Update packages lists
marmarek Sep 10, 2024
3376002
Minor fixes
marmarek Sep 10, 2024
007bee9
Try to workaround mouse issue
marmarek Sep 10, 2024
1c5f3f0
Fix guivm-vnc login
marmarek Sep 10, 2024
7242736
Update needles, mostly for R4.3
marmarek Sep 10, 2024
5058c9d
Adjust stubs for newer new devices API
marmarek Nov 4, 2024
7ec28fc
Install dependencies for the UEFI VM test
marmarek Nov 4, 2024
165a481
Increase time precission in logs
marmarek Nov 4, 2024
7eeb6e8
Adjust template manager test for updated layout
marmarek Nov 4, 2024
09f863d
Adjust KDE startup for Wayland session
marmarek Nov 4, 2024
cb63a2b
Wiggle mouse a bit to let Xorg/Wayland initialize it fully
marmarek Nov 4, 2024
239e5df
Fix setting time when RTC battery is missing
marmarek Nov 4, 2024
667139c
Fix assert_screen call in firstboot.pm
marmarek Nov 4, 2024
95cea6c
Call eject_cd on "hw3" machine
marmarek Nov 4, 2024
835e38a
Fix whonix-based vm startup in keyboard layout tests
marmarek Nov 4, 2024
ff7ecab
Adjust screenlocker handling for xfce4-screenlocker
marmarek Nov 4, 2024
f033173
Commit needles for SecureDrop tests
marmarek Nov 4, 2024
b6df845
Update needles
marmarek Nov 4, 2024
84b1d06
Re-enable usb console on hw8 worker
marmarek Nov 4, 2024
c4c2045
Adjust KDE install
marmarek Nov 4, 2024
3a7ab82
api: take version specific gitlab repo job
marmarek Nov 8, 2024
ea6bbcf
Cleanly unmount /boot on test end
marmarek Nov 8, 2024
dc60ed1
Fixes for devices tests
marmarek Nov 8, 2024
4cc1f04
Adjust needles for updated Heads on hw6
marmarek Nov 8, 2024
0aa0b26
Few other needle updates
marmarek Nov 8, 2024
fe319a0
Do not restart job if it failed before triggering test
marmarek Nov 8, 2024
f828a30
Add tests to Global Config and Policy Editor
marmarta Nov 4, 2024
93b79d0
Merge remote-tracking branch 'origin/pr/26'
marmarek Nov 14, 2024
2e932b4
Add needles for new GUI tools tests
marmarek Nov 14, 2024
33aab62
Adjust GUI tests to work on R4.2 too, and few minor fixes
marmarek Nov 19, 2024
b8d61cc
Adjust Heads handling
marmarek Nov 19, 2024
c84eeab
Update grub2-pc-modules package URL
marmarek Nov 19, 2024
5cc0f6c
Skip final fstrim call on non-hardware runners
marmarek Nov 19, 2024
dca43b4
Don't try to install xfsprogs if it's there already
marmarek Nov 19, 2024
11cca26
Update whonix needle
marmarek Nov 19, 2024
fe89cdf
Move uploading packages list to a base class
marmarek Nov 19, 2024
871d08c
Adjust sut_packages.txt format to prefix each line with VM name
marmarek Nov 19, 2024
ef7fbce
Add SecureDrop installation test
Sep 11, 2024
f59897e
Allow setting more things via API
marmarek Dec 19, 2024
0d3b960
Try to log user journal to the console too
marmarek Dec 19, 2024
9323d42
Quirks for hw16 worker
marmarek Dec 19, 2024
6fc25d8
Prepare minimal templates for tests
marmarek Dec 19, 2024
694f5b1
Test sys-gui-gpu - part 1
marmarek Dec 19, 2024
9c3b298
Test old create qube dialog only in R4.2
marmarek Dec 19, 2024
37c5c0c
keyboard layout: Wait for Whonix messages only when testing Whonix te…
marmarek Dec 19, 2024
d9802ac
Update logging result of the isosize test
marmarek Dec 19, 2024
be29ed4
Do not install kernel in in-vm kernel tests
marmarek Dec 19, 2024
e015aa7
Use KDE-specific keyboard layout switching method on KDE
marmarek Dec 19, 2024
0d7bb92
Add commend about complicated text editor app selection
marmarek Dec 19, 2024
92cd282
Update ZFS packages signing key link
marmarek Dec 19, 2024
030f4b6
Enable debug logging in updater
marmarek Dec 19, 2024
521df17
A few needles for SecureDrop tests
marmarek Dec 19, 2024
836eeaf
Update needles after switching to Fedora 41 default template
marmarek Dec 19, 2024
898d1f2
lib/installedtest.pm: don't "assert" for NM popup
SergiiDmytruk Nov 12, 2023
bdda6c9
tests/install_startup.pm: use Kickstart file from QUBES_OS_KS_URL
SergiiDmytruk Nov 12, 2023
48a36ac
lib/qubesdistribution.pm: use QUBES_OS_HOST_IP to connect to host
SergiiDmytruk Nov 12, 2023
42f558a
Add generalhw configuration for MSI boards
SergiiDmytruk Feb 4, 2024
8d7f0cb
Support running tests on OptiPlex 9010
SergiiDmytruk Feb 4, 2024
d0f94a1
Add AEM verification on hardware
SergiiDmytruk Feb 4, 2024
eec943f
Add backup of openQA configuration
SergiiDmytruk Feb 4, 2024
56158e2
Extract generalhw/adding-vnc-setup.md
SergiiDmytruk Feb 13, 2024
8d8f5bb
Explain why generalhw setups are so different
SergiiDmytruk Feb 13, 2024
7f02f7f
Introduce and switch to using assert_serial()
SergiiDmytruk Feb 13, 2024
d2e6430
Try to make iPXE prompt matching more reliable
SergiiDmytruk Feb 13, 2024
fc126db
Allow installing without sys-usb for generalhw
SergiiDmytruk Mar 31, 2024
1c0b813
Make serial log of aem_hw test less noisy
SergiiDmytruk Mar 31, 2024
9bfd09d
Fix VNC setup instructions
SergiiDmytruk Mar 31, 2024
826262f
Support installing on Supermicro M11SDV-4C-LN4F in CSM mode
SergiiDmytruk Mar 31, 2024
99b4f73
tests/install_startup.pm: add inactive Supermicro EFI boot changes
SergiiDmytruk Mar 31, 2024
7946a3a
tests/aem_hw.pm: slightly generalize in preparation for SKINIT
SergiiDmytruk Mar 31, 2024
d25f555
tests/aem_hw.pm: try to account for serial issues on GRUB2 check
SergiiDmytruk Mar 31, 2024
1c831a5
tests/aem_hw.pm: workaround an issue with tpm*_id
SergiiDmytruk Mar 31, 2024
fd50926
tests/aem_hw.pm: do not install anti-evil-maid separately
SergiiDmytruk Mar 31, 2024
47e3985
tests/aem_hw.pm: remove all previously uploaded packages
SergiiDmytruk Mar 31, 2024
f87e480
tests/aem_hw.pm: simplify list of xen packeges to install
SergiiDmytruk Mar 31, 2024
deb8920
tests/aem_hw.pm: handle Supermicro
SergiiDmytruk Mar 31, 2024
0e7771d
tests/aem_hw.pm: make installation more reliable
SergiiDmytruk Apr 1, 2024
7392a32
tests/aem_hw.pm: wait for login prompt for longer
SergiiDmytruk Jan 5, 2025
cec63f5
generalhw/**/ks.cfg: add `ignoredisk` command
SergiiDmytruk Jan 5, 2025
68d7580
generalhw/optiplex/power: `./rte_ctrl` -> `rte_ctrl`
SergiiDmytruk Jan 5, 2025
dcb5038
tests/install_startup.pm: match arbitrary PiKVM drive ids
SergiiDmytruk Jan 5, 2025
827ebbb
tests/install_startup.pm: make OptiPlex boot with Dasharo coreboot+se…
SergiiDmytruk Jan 5, 2025
e04a46b
3mdeb-templates.json: Update products to qubes R4.2.3
philipanda Jan 23, 2025
e91f059
3mdeb-templates.json: Update AEM packages
philipanda Jan 23, 2025
11375e0
3mdeb-templates.json: Add new producsts & machines
philipanda Jan 23, 2025
d4cba72
3mdeb-templates: Update jobgroups
philipanda Jan 27, 2025
c263ca0
generalhw: hpt630v1: Add
philipanda Jan 27, 2025
de34bea
generalhw/hpt630v1: Add +x to scripts
philipanda Jan 27, 2025
4fd460d
generalhw/hpt630v1/power: Fix parsing action to sonoff api
philipanda Jan 27, 2025
23af81e
3mdeb-templates: Update MAX_ISO_SIZE
philipanda Jan 27, 2025
75b3ec4
3mdeb-templates: Add "legacy_boot" key to jobs with legacy boot
philipanda Jan 27, 2025
3ee1206
needles: HP GRUB bootmenu needles
philipanda Jan 28, 2025
298ab73
install_partitioning_default: check for install over existing
philipanda Jan 28, 2025
6bc8db4
firstboot & 3mdeb-templates: Workaround for missing video in lukspass
philipanda Feb 3, 2025
e42c64c
3mdeb-templates.json: Set TIMEOUT_SCALE for hpt630v1 machine
philipanda Feb 3, 2025
ff4d340
tests/aem_hw.pm: Support HPt630v1
philipanda Feb 3, 2025
7311cd4
3mdeb-templates: Add SKL_VER to aem-setup test suite
philipanda Feb 3, 2025
9d015ba
tests/aem_hw.pm: Running Qubes: update grub traversal
philipanda Feb 4, 2025
a39000e
aem_hw.pm: Workaround for missing signal on lukspass
philipanda Feb 4, 2025
fd2a597
aem_hw: Set corect boot partition depending on legacy/efi boot
philipanda Feb 4, 2025
c951bfb
aem_hw: Do lukspass no signal workaround in loop to save time
philipanda Feb 4, 2025
77a5104
aem_hw: Don't do grub2-install on efi systems
philipanda Feb 4, 2025
3d94db9
needles: Add needles for aem_hw clearing TPM on HPt630v1
philipanda Feb 5, 2025
2a79832
aem_hw.pm: Change poweroff to reboot on the end of `run`
philipanda Feb 4, 2025
8cdd2a3
aem_hw: clear_tpm_hp: Add verifying TPM is still enabled after clear
philipanda Feb 4, 2025
cdc14e6
aem_hw: Adjust installed packages depending on Legacy/EFI boot
philipanda Feb 4, 2025
540243e
needles: Add needles to verify TPM enabled on HP
philipanda Feb 4, 2025
b1331d2
3mdeb-templates: Fix XEN_VER for installation test suite
philipanda Feb 4, 2025
ea4c6c8
3mdeb-templates: Seperate test suites into Legacy/UEFI versions
philipanda Feb 4, 2025
eebfab1
3mdeb-templates: Update START_AFTER for EFI/legacy test variants
philipanda Feb 5, 2025
620c76e
hpt630v1/power: Add delay after power off
philipanda Feb 5, 2025
b262fa5
generalhw: Generalize hardcoded AEM packages version
philipanda Feb 5, 2025
0afc1cd
hpt630v1/power: Use $1 for sonoff ip instead of hardcoding it
philipanda Feb 5, 2025
8818bcb
hpt630v1/ks.cfg: Add `spec-ctrl=no-ibpb-entry` for xen
philipanda Feb 5, 2025
65f2321
aem_hw.pm: Fix comment on optional grub2-install call
philipanda Feb 6, 2025
64ac09c
aem_hw: Download AEM packages using qubes-dom0-update
philipanda Feb 6, 2025
11f6930
serve_aem_repo.sh: Add script to quickly setup testing AEM repo
philipanda Feb 6, 2025
a3cbec4
3mdeb-templates: Modify aem_setup PACKAGES_BASE_URL
philipanda Feb 6, 2025
50c9325
needles: grub after installing AEM
philipanda Feb 7, 2025
6a30677
aem_hw: Fix aem_setup to not boot 'Advanced options'
philipanda Feb 7, 2025
d15ba63
tests: shutdown.pm: Fix to work after aem_hw
philipanda Feb 13, 2025
7c70d77
needles/root-console-after-login-20250213: Add
philipanda Feb 13, 2025
ffdb8db
aem_hw: Remove unneeded aem skl workaround
philipanda Feb 14, 2025
c0fe1eb
generalhw/README.md: Add HPt630 description
philipanda Jan 28, 2025
02e5da1
generalhw/README: Add vp4670 description
philipanda Feb 21, 2025
3b3230c
generalhw/README.md: vp4670: Fix repeating the same ipxe file twice
philipanda Mar 6, 2025
29db55a
generalhw/README.md: hpt630: Remove hard shutdown warning
philipanda Mar 6, 2025
4be40d2
3mdeb-templates.json: update to currently used version and clean up
krystian-hebel Mar 3, 2025
115121d
generalhw/hpt630v1: mention boot order requirement
krystian-hebel Mar 3, 2025
fee8141
generalhw/adding-vnc-setup.md: suggest --format-swap-rgb instead of p…
krystian-hebel Mar 10, 2025
54f23e6
Merge pull request #7 from 3mdeb/t630_doc_update
BeataZdunczyk Mar 11, 2025
eada974
generalhw & 3mdeb-templates: Add basic vp4670 config
philipanda Feb 19, 2025
191e05f
install_startup: Boot iso connected by PiKVM
philipanda Feb 20, 2025
ce0c234
firstboot: Increase timeout for lukspass prompt to appear
philipanda Feb 21, 2025
f95fdbe
generalhw/README: Describe issue of missing network connection
philipanda Feb 21, 2025
fb6e6c7
generalhw/vp4670/README: Fix a couple typos & formatting
philipanda Feb 24, 2025
71f7aa1
generalhw/vp4670: Remove mounting PiKVM otg drive, which didn't work
philipanda Feb 24, 2025
18a8475
generalhw/vp4670/README: Add section to prepare installation media
philipanda Feb 24, 2025
8c09663
generalhw/README: Describe trying to disable kvmd-otgnet on vp4670
philipanda Feb 25, 2025
4406a3c
vp4670/ks.cfg: Stop uCode updates
philipanda Mar 6, 2025
6567779
generalhw/vp4670/flash: Link the platform specific ks.cfg to webdir
philipanda Mar 7, 2025
88af44c
generalhw/vp4670 make scripts executable
philipanda Mar 10, 2025
3426c61
generalhw/README: Fix invalid path to HP t630 v1 readme
philipanda Mar 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
472 changes: 472 additions & 0 deletions 3mdeb-templates.json

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OpenQA Tests for Qubes OS
OpenQA Tests for Qubes OS

To install, clone this repo to /var/lib/openqa/tests/qubesos

Expand Down Expand Up @@ -35,7 +35,7 @@ Variables:

Variables used in tests:
- `INSTALL_TEMPLATES` - space separated list of template groups (`debian`, `whonix`), or `all`; can include also specific template versions (`debian-11`) - they they will be installed/reinstalled from online repo after the initial install process
- `USBVM` - USB VM configuration: `none`, `sys-usb` (default), `sys-net` (combined with Net VM)
- `USBVM` - USB VM configuration: `none` (assert that already disabled by default), `disable` (disable explicitly), `sys-usb` (default), `sys-net` (combined with Net VM)
- `KEYBOARD_LAYOUT` - install with non-default keyboard layout; currently only `us-colemak` value is supported
- `LOCALE` - install with non-default locale; currently only `en_DK.utf8` value is supported
- `SYSTEM_TESTS` - run system tests from those (space separated) modules, each module can be suffixed with ":TIMEOUT" (in seconds); tests are run using nose2
Expand All @@ -45,13 +45,16 @@ Variables used in tests:
- `SALT_SYSTEM_TESTS` - run salt formula preparing for system tests (mostly install extra packages)
- `UPDATE_TEMPLATES` - update listed template packages as a whole (space separated list of templates to update)
- `TEST_TEMPLATES` - limit tests to listed templates only (space separated list of templates to test)
- `DEFAULT_TEMPLATE` - choose default template - on install jobs it's chosen in initial-setup, on update jobs all qubes that used default template are switched to this one
- `UPDATE` - install updates in dom0 and all templates
- `QUBES_TEST_EXTRA_INCLUDE`, `QUBES_TEST_EXTRA_EXCLUDE` - passed directly to the test environment
- `TEST_GUI_INTERACTIVE` - simple GUI interactive tests (start application from menu etc)
- `TEST_WINDOWS_GUI_INTERACTIVE` - simple GUI interactive tests for Windows with QWT installed
- `WINDOWS_VERSION` - create Windows VM of specific version and install QWT inside (argument as for qvm-create-windows-qube)
- `QWT_DOWNLOAD` - download specific QWT build (can be URL to iso or rpm file); otherwise qubes-windows-tools dom0 packages is installed from standard repositories
- `GUIVM` - create GUI VM
- `GUIVM` - create GUI VM (sys-gui)
- `GUIVM_VNC` - create GUI VM (sys-gui-vnc)
- `GUIVM_GPU` - create GUI VM (sys-gui-gpu)
- `KEEP_SCREENLOCKER` - do not disable xscreensaver (or whatever screenlocker is there)
- `PARTITIONING` - partition layout ('standard', 'xfs', 'btrfs', 'default', 'unencrypted'); on install - set via installer options, later - created manually on sdb, and all templates are migrated there
- `HEADS` - when set to `1`, the test will handle Heads boot menu. Currently relevant only with `BACKEND=generalhw`. It's supposed to be sed in "machine" definition.
Expand All @@ -61,3 +64,11 @@ Variables used in tests:
- `KERNEL_VERSION` - which kernel flavor should be used - currently supported value is 'latest', which will switch to kernel-latest and kernel-latest-qubes-vm during update
- `PIPEWIRE` - when set to `1`, VMs are set to use pipewire instead of
pulseaudio, including switching native pulseaudio to pipewire-pulse.
- `SUSPEND_MODE` - what suspend mode should be used; default is `S3`, set to `S0ix` to use S0ix suspend
- `INSTALL_OEM` - do fully automated OEM installation
- `INSTALL_OEM_STARTUP` - start OEM installation, but still expect interactive prompts during installation
- `HID` - for generalhw tests, tell it whether `USB` hid is used (default) or `PS2` one; in the latter case, sys-usb is not supposed to have input-proxy allowed by default

SecureDrop variables used in tests:
- `SECUREDROP_INSTALL` - when set to `1`, SecureDrop Workstation is installed
- `SECUREDROP_TEST` - when set with a value, SecureDrop tests are run on top of an existing installation
46 changes: 33 additions & 13 deletions api/gitlab_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import subprocess
import sys
import os
import re
import json
import time
import requests
import zipfile
import tempfile
import string
import hmac
Expand All @@ -28,7 +28,7 @@
# defaults
config_defaults = {
'owner_allowlist': 'QubesOS',
'repo_allowlist': 'qubes-continuous-integration qubes-installer-qubes-os qubes-linux-kernel qubes-vmm-xen qubes-vmm-xen-stubdom-linux',
'repo_allowlist': 'qubes-continuous-integration qubes-installer-qubes-os qubes-linux-kernel qubes-vmm-xen qubes-vmm-xen-stubdom-linux qubes-gui-agent-linux qubes-grub2',
'repo_blocklist': None,
'job_allowlist': '*',
'user_allowlist': None,
Expand Down Expand Up @@ -128,7 +128,7 @@ def verify_webhook_obj():

return webhook_obj

def get_job_from_pr(pr_details):
def get_job_from_pr(pr_details, job_name="publish:repo"):
r = requests.get(pr_details['_links']['statuses']['href'])
r.raise_for_status()
for status in r.json():
Expand All @@ -142,7 +142,7 @@ def get_job_from_pr(pr_details):
for job in r.json():
if job['status'] != 'success':
continue
if 'publish:repo' not in job['name']:
if job_name not in job['name']:
continue
return job['web_url']
return None
Expand All @@ -159,7 +159,7 @@ def run_test():

print(repr(req_values))

version = req_values.get('VERSION') or '4.2'
version = req_values.get('VERSION') or '4.3'
buildid = time.strftime('%Y%m%d%H-') + version
# cannot serve repo directly from gitlab, because it refuses connections via Tor :/
repo_url = req_values['REPO_JOB'] + '/artifacts/raw/repo'
Expand All @@ -171,8 +171,8 @@ def run_test():
f.flush()
repo_dir = TARGET_REPO_DIR + '/' + buildid
os.mkdir(repo_dir)
with zipfile.ZipFile(f.name, 'r') as repo_zip:
repo_zip.extractall(repo_dir)
subprocess.check_output(
['unzip', '-q', f.name, '-d', repo_dir])
# get rid of 'repo' dir nesting
for subdir in os.listdir(repo_dir + '/repo'):
os.rename(repo_dir + '/repo/' + subdir, repo_dir + '/' + subdir)
Expand All @@ -193,6 +193,14 @@ def run_test():
values['SELINUX_TEMPLATES'] = req_values['SELINUX_TEMPLATES']
if 'TEST_TEMPLATES' in req_values:
values['TEST_TEMPLATES'] = req_values['TEST_TEMPLATES']
if 'UPDATE_TEMPLATES' in req_values:
values['UPDATE_TEMPLATES'] = req_values['UPDATE_TEMPLATES']
if 'FLAVOR' in req_values and req_values['FLAVOR'] in ('pull-requests', 'kernel', 'whonix', 'templates'):
values['FLAVOR'] = req_values['FLAVOR']
if 'KERNEL_VERSION' in req_values and req_values['KERNEL_VERSION'] in ('stable', 'latest'):
values['KERNEL_VERSION'] = req_values['KERNEL_VERSION']
if 'QUBES_TEST_MGMT_TPL' in req_values:
values['QUBES_TEST_MGMT_TPL'] = req_values['QUBES_TEST_MGMT_TPL'];

subprocess.check_call([
'openqa-cli', 'api', '-X', 'POST',
Expand All @@ -213,12 +221,19 @@ def github_event():
user = webhook_obj['comment']['user']['login']
if user.lower() not in config['user_allowlist'].lower().split():
return respond(200, 'comment of this user ignored')
if webhook_obj['comment']['body'].lower() == 'openqarun':
if webhook_obj['comment']['body'].lower().startswith('openqarun'):
return run_test_pr(webhook_obj['comment'])

return respond(200, 'nothing to do')

def run_test_pr(comment_details):
comment_body = comment_details['body'].strip()
comment_params = dict([
param.split("=", 1)
for param in comment_body.split(" ")
if "=" in param and param[0].isupper()
])

# get PR info
issue_url = comment_details['issue_url']
r = requests.get(issue_url)
Expand All @@ -228,13 +243,16 @@ def run_test_pr(comment_details):
r.raise_for_status()
pr_details = r.json()

version = comment_params.get("VERSION", "4.3")
if not re.match(r"\A[0-9]\.[0-9]\Z", version):
return respond(400, "invalid VERSION value")

# get associated gitlab job
repo_job = get_job_from_pr(pr_details)
repo_job = get_job_from_pr(pr_details, job_name=f"r{version}:publish:repo")
if not repo_job:
return respond(404, "build not found")

version = '4.2'
buildid = time.strftime('%Y%m%d%H-') + version
buildid = time.strftime('%Y%m%d%H%M-') + version
# cannot serve repo directly from gitlab, because it refuses connections via Tor :/
repo_url = repo_job + '/artifacts/raw/repo'
with requests.get(repo_job + '/artifacts/download', stream=True) as r:
Expand All @@ -245,8 +263,8 @@ def run_test_pr(comment_details):
f.flush()
repo_dir = TARGET_REPO_DIR + '/' + buildid
os.mkdir(repo_dir)
with zipfile.ZipFile(f.name, 'r') as repo_zip:
repo_zip.extractall(repo_dir)
subprocess.check_output(
['unzip', '-q', f.name, '-d', repo_dir])
# get rid of 'repo' dir nesting
for subdir in os.listdir(repo_dir + '/repo'):
os.rename(repo_dir + '/repo/' + subdir, repo_dir + '/' + subdir)
Expand All @@ -256,6 +274,8 @@ def run_test_pr(comment_details):
values['VERSION'] = version
if pr_details['base']['repo']['name'] in (
'qubes-linux-kernel',
'qubes-gui-agent-linux',
'qubes-grub2',
'qubes-vmm-xen',
'qubes-vmm-xen-stubdom-linux'):
values['FLAVOR'] = 'kernel'
Expand Down
52 changes: 40 additions & 12 deletions extra-files/qubesteststub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async def on_domain_pre_start(self, vm, event, **kwargs):
pv_passthrough_available = (self.xeninfo['xen_minor'] < 13 or
'qubes.enable_insecure_pv_passthrough' in self.dom0_cmdline)
if 'hvm_directio' not in self.physinfo['virt_caps'] and not pv_passthrough_available:
# FIXME: new devices API
if vm.name in ('sys-net', 'sys-usb'):
for ass in list(vm.devices['pci'].assignments()):
await vm.devices['pci'].detach(ass)
Expand All @@ -28,18 +29,42 @@ async def on_domain_pre_start(self, vm, event, **kwargs):
else:
missing = set()

for dev in vm.devices['pci'].persistent():
missing.discard(dev.ident.replace('_', ':'))
for dev in missing:
ass = DeviceAssignment(vm.app.domains[0], dev.replace(':', '_'),
options={'no-strict-reset': 'True'},
persistent=True)
await vm.devices['pci'].attach(ass)
if hasattr(vm.devices['pci'], 'get_assigned_devices'):
# new devices API
for dev in vm.devices['pci'].get_assigned_devices():
if hasattr(dev, "port"):
missing.discard(dev.port.port_id.replace('_', ':'))
else:
missing.discard(dev.ident.replace('_', ':'))
for dev in missing:
if hasattr(DeviceAssignment, "new"):
ass = DeviceAssignment.new(vm.app.domains[0], dev.replace(':', '_'), "pci",
options={'no-strict-reset': 'True'},
mode="required")
else:
ass = DeviceAssignment(vm.app.domains[0], dev.replace(':', '_'),
options={'no-strict-reset': 'True'},
required=True, attach_automatically=True)
await vm.devices['pci'].assign(ass)
else:
# old devices API
for dev in vm.devices['pci'].persistent():
missing.discard(dev.ident.replace('_', ':'))
for dev in missing:
ass = DeviceAssignment(vm.app.domains[0], dev.replace(':', '_'),
options={'no-strict-reset': 'True'},
persistent=True)
await vm.devices['pci'].attach(ass)

if len(vm.devices['pci'].persistent()):
has_pci_devices = (len(list(vm.devices['pci'].get_assigned_devices()))
if hasattr(vm.devices['pci'], 'get_assigned_devices')
else len(vm.devices['pci'].persistent()))
if has_pci_devices:
# IOMMU missing
if 'hvm_directio' not in self.physinfo['virt_caps'] and vm.virt_mode != 'pv':
vm.virt_mode = 'pv'
elif 'hvm_directio' in self.physinfo['virt_caps'] and vm.virt_mode != 'hvm':
vm.virt_mode = 'hvm'
if os.path.exists('/sys/firmware/efi') and vm.virt_mode == 'pv':
# on UEFI (OVMF) disable e820_host, otherwise guest crashes;
# but then, force swiotlb as without e820_host automatic detection
Expand All @@ -49,7 +74,10 @@ async def on_domain_pre_start(self, vm, event, **kwargs):

@qubes.ext.handler('domain-start')
async def on_domain_start(self, vm, event, **kwargs):
if vm.name == 'sys-net' and not len(vm.devices['pci'].persistent()):
has_pci_devices = (len(list(vm.devices['pci'].get_assigned_devices()))
if hasattr(vm.devices['pci'], 'get_assigned_devices')
else len(vm.devices['pci'].persistent()))
if vm.name == 'sys-net' and not has_pci_devices:
for dev in self.netdevs:
subprocess.call('echo 0000:{} > /sys/bus/pci/drivers/pciback/unbind'.format(dev), shell=True)
subprocess.call('echo 0000:{} > /sys/bus/pci/drivers/e1000e/bind'.format(dev), shell=True)
Expand All @@ -64,7 +92,7 @@ async def on_domain_start(self, vm, event, **kwargs):
subprocess.call('ip l s {} up'.format(iface), shell=True)
subprocess.call('ip l s xenbr0 up', shell=True)
subprocess.call('xl network-attach sys-net bridge=xenbr0', shell=True)
if vm.name == 'sys-usb' and not len(vm.devices['pci'].persistent()):
if vm.name == 'sys-usb' and not has_pci_devices:
for dev in self.usbdevs:
subprocess.call('echo 0000:{} > /sys/bus/pci/drivers/pciback/unbind'.format(dev), shell=True)
subprocess.call('echo 0000:{} > /sys/bus/pci/drivers/ehci-pci/bind'.format(dev), shell=True)
Expand Down Expand Up @@ -96,8 +124,8 @@ def __init__(self):
qubes.config.defaults['kernelopts'] += ' xen_scrub_pages=0'
qubes.config.defaults['kernelopts_pcidevs'] += ' xen_scrub_pages=0'
if 'journald' not in qubes.config.defaults['kernelopts']:
qubes.config.defaults['kernelopts'] += ' systemd.journald.forward_to_console=1'
qubes.config.defaults['kernelopts_pcidevs'] += ' systemd.journald.forward_to_console=1'
qubes.config.defaults['kernelopts'] += ' systemd.journald.forward_to_console=1 systemd.journald.max_level_console=debug'
qubes.config.defaults['kernelopts_pcidevs'] += ' systemd.journald.forward_to_console=1 systemd.journald.max_level_console=debug'

self.dom0_cmdline = pathlib.Path('/proc/cmdline').read_bytes().decode()

Expand Down
6 changes: 5 additions & 1 deletion extra-files/system-tests/dom0.sls
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ dom0-packages:
- qubes-usb-proxy-dom0
- syslinux
- genisoimage
- grub2-pc-modules
# for mkefiboot
- lorax
- pulseaudio-utils
- btrfs-progs
- python3-nose2
- python3-objgraph
- patch
{% if grains['osrelease'] == '4.2' %}
- qubes-video-companion-dom0
{% if grains['osrelease'] != '4.1' %}
- xinput
{% endif %}
- openssl
Expand Down
77 changes: 77 additions & 0 deletions extra-files/update/atestrepo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import subprocess
import os
from pathlib import Path

UPDATE_REPO_URL = "@REPO_URL@"
UPDATE_REPO_KEY = """@REPO_KEY@"""
ENABLE_TESTING = True
QUBES_VER = "@QUBES_VER@"
WHONIX_REPO = "@WHONIX_REPO@"

def atestrepo(os_data, log, **kwargs):
if os.path.exists("/usr/share/whonix/marker"):
# Whonix randomizes time, sometimes setting it in the future, which breaks
# at least Debian fasttrack
subprocess.call(["date", "-s", "+5min"])

if os_data["os_family"] == "Debian":
with open('/etc/apt/sources.list.d/qubes-testing.list', 'w') as f:
if ENABLE_TESTING:
f.write(f"deb [arch=amd64 signed-by=/usr/share/keyrings/qubes-archive-keyring.gpg] https://deb.qubes-os.org/r{QUBES_VER}/vm {os_data['codename']}-testing main\n")
if UPDATE_REPO_URL:
f.write(f"deb [arch=amd64 signed-by=/usr/share/keyrings/test.gpg] {UPDATE_REPO_URL}/vm {os_data['codename']} main\n")
subprocess.run(
["gpg",
"--no-default-keyring",
"--keyring", "/usr/share/keyrings/test.gpg",
"--import"],
input=UPDATE_REPO_KEY.encode(),
check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
elif os_data["os_family"] == "RedHat":
with open('/etc/yum.repos.d/qubes-testing.repo', 'w') as f:
if ENABLE_TESTING:
f.write("[qubes-testing]\n")
f.write("name=qubes testing\n")
f.write(f"baseurl=https://yum.qubes-os.org/r{QUBES_VER}/current-testing/vm/fc$releasever\n")
f.write(f"gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-qubes-{QUBES_VER}-primary\n")
f.write("gpgcheck = 1\n")
f.write("repo_gpgcheck = 1\n")
if UPDATE_REPO_URL:
f.write("[test-repo]\n")
f.write("name=test repo\n")
f.write(f"baseurl={UPDATE_REPO_URL}/vm/fc$releasever\n")
f.write(f"gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-test\n")
f.write("gpgcheck = 1\n")
f.write("repo_gpgcheck = 1\n")
with open("/etc/pki/rpm-gpg/RPM-GPG-KEY-test", "w") as key_f:
key_f.write(UPDATE_REPO_KEY)
elif os_data["os_family"] == "ArchLinux":
with open('/etc/pacman.d/80-qubes-testing.conf', 'w') as f:
if UPDATE_REPO_URL:
f.write("[qubes-test]\n")
f.write(f"Server = {UPDATE_REPO_URL}/vm/archlinux/pkgs\n")
with open("/usr/share/pacman/keyrings/qubes-test.gpg", "w") as fk:
fk.write(UPDATE_REPO_KEY)
list_output = subprocess.check_output([
"gpg", "--show-keys", "--with-colons", "--with-fingerprint",
"/usr/share/pacman/keyrings/qubes-test.gpg"
]).decode()
key_fpr = [l for l in list_output.splitlines() if l.startswith("fpr:")][0].split(":")[9]
with open("/usr/share/pacman/keyrings/qubes-test-trusted", "w") as fk:
fk.write(key_fpr + ":4:\n")
with open("/usr/share/pacman/keyrings/qubes-test-revoked", "w") as fk:
pass
if not os.listdir('/etc/pacman.d/gnupg/private-keys-v1.d'):
subprocess.run(["pacman-key", "--init"], check=True)
subprocess.run(["pacman-key", "--populate"], check=True)
else:
subprocess.run(["pacman-key", "--populate", "qubes-test"], check=True)
if ENABLE_TESTING:
f.write(f"[qubes-r{QUBES_VER}-current-testing]\n")
f.write(f"Server = https://archlinux.qubes-os.org/r{QUBES_VER}/current-testing/vm/archlinux/pkgs\n")
if Path('/usr/share/whonix/marker').exists():
subprocess.check_call([
"repository-dist",
"--enable",
"--repository",
WHONIX_REPO])
2 changes: 2 additions & 0 deletions extra-files/update/dom0.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
{% set basedist = 'fc32' %}
{% elif grains['osrelease'] == '4.2' %}
{% set basedist = 'fc37' %}
{% elif grains['osrelease'] == '4.3' %}
{% set basedist = 'fc41' %}
{% else %}
{% set basedist = 'unknown' %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion extra-files/update/qubes-testing-dom0.repo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[qubes-testing]
name = Qubes updates testing
baseurl = http://yum.qubes-os.org/r{{grains['osrelease']}}/current-testing/dom0/{{basedist}}
baseurl = http://yum.qubes-os.org/r{{grains['osrelease']}}/current-testing/host/{{basedist}}
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-qubes-{{grains['osrelease']}}-primary
gpgcheck = 1

Expand Down
Loading