1
0
mirror of https://github.com/systemd/systemd synced 2025-12-26 19:04:45 +01:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Luca Boccassi
f1027d7c28
Merge pull request #17787 from DaanDeMeyer/mkosi-boot-tests
CI: Add mkosi boot tests
2020-12-04 23:38:29 +00:00
Daan De Meyer
448d3462b0 CI: Add mkosi boot tests
Using the new mkosi Github Action, we can add some simple boot tests
for the systemd mkosi configs. This makes sure these keep working
as expected.
2020-12-04 22:24:12 +00:00
Daan De Meyer
8f2c4c5e93 mkosi: Add findutils to Fedora config
find is needed by test_exec_dynamicuser.
2020-12-04 22:24:12 +00:00
Daan De Meyer
8d036c446a mkosi: Add rpm to Fedora BuildPackages as it's needed by pkg-config 2020-12-04 20:06:03 +00:00
Daan De Meyer
aef61dc888 mkosi: Replace iptables-dev with libiptc-dev in debian config
Latest debian unstable doesn't have iptables-dev anymore. Instead,
let's use libiptc-dev.
2020-12-03 17:46:49 +00:00
4 changed files with 72 additions and 1 deletions

42
.github/workflows/mkosi.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: mkosi
# Simple boot tests that build and boot the mkosi images generated by the mkosi config files in .mkosi.
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
ci:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
distro:
- arch
- debian
- ubuntu
- fedora
steps:
- uses: actions/checkout@v2
- uses: systemd/mkosi@v8
- name: Install
run: sudo apt-get update && sudo apt-get install --no-install-recommends
ovmf
python3-pexpect
qemu-system-x86-64
- name: Build ${{ matrix.distro }}
run: sudo python3 -m mkosi --default .mkosi/mkosi.${{ matrix.distro }} --password= --qemu-headless build
- name: Boot ${{ matrix.distro }} systemd-nspawn
run: sudo ./.github/workflows/test_mkosi_boot.py python3 -m mkosi --default .mkosi/mkosi.${{ matrix.distro }} --password= --qemu-headless boot
- name: Boot ${{ matrix.distro }} QEMU
run: sudo ./.github/workflows/test_mkosi_boot.py python3 -m mkosi --default .mkosi/mkosi.${{ matrix.distro }} --password= --qemu-headless qemu

27
.github/workflows/test_mkosi_boot.py vendored Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
import pexpect
import sys
def run() -> None:
p = pexpect.spawnu(" ".join(sys.argv[1:]), logfile=sys.stdout, timeout=300)
p.expect("login:")
p.sendline("root")
p.expect("#")
p.sendline("systemctl poweroff")
p.expect(pexpect.EOF)
try:
run()
except pexpect.EOF:
print("UNEXPECTED EOF")
sys.exit(1)
except pexpect.TIMEOUT:
print("TIMED OUT")
sys.exit(1)

View File

@ -24,7 +24,7 @@ BuildPackages=
git
gnu-efi
gperf
iptables-dev
libiptc-dev
libacl1-dev
libaudit-dev
libblkid-dev

View File

@ -23,6 +23,7 @@ BuildPackages=
diffutils
docbook-style-xsl
elfutils-devel
findutils
gcc
gettext
git
@ -64,6 +65,7 @@ BuildPackages=
python3-devel
python3-lxml
qrencode-devel
rpm
tree
valgrind-devel
xz-devel