mirror of
https://github.com/systemd/systemd
synced 2025-10-09 21:54:44 +02:00
Compare commits
7 Commits
a06e64d884
...
5fe08a12e6
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5fe08a12e6 | ||
![]() |
d25e515ebc | ||
![]() |
4df7d51cde | ||
![]() |
c0a5801f7b | ||
![]() |
4bffb45bb7 | ||
![]() |
a1000c075b | ||
![]() |
b6be8bf2c6 |
48
.github/workflows/mkosi.yml
vendored
48
.github/workflows/mkosi.yml
vendored
@ -46,9 +46,9 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ${{ matrix.runner }}
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.release }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.release }}-${{ github.ref }}-${{ matrix.runner }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -56,60 +56,94 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- distro: arch
|
- distro: arch
|
||||||
release: rolling
|
release: rolling
|
||||||
|
runner: ubuntu-24.04
|
||||||
sanitizers: ""
|
sanitizers: ""
|
||||||
llvm: 0
|
llvm: 0
|
||||||
cflags: "-O2 -D_FORTIFY_SOURCE=3"
|
cflags: "-O2 -D_FORTIFY_SOURCE=3"
|
||||||
relabel: no
|
relabel: no
|
||||||
vm: 1
|
vm: 1
|
||||||
|
no_qemu: 0
|
||||||
|
no_kvm: 0
|
||||||
- distro: debian
|
- distro: debian
|
||||||
release: testing
|
release: testing
|
||||||
|
runner: ubuntu-24.04
|
||||||
sanitizers: ""
|
sanitizers: ""
|
||||||
llvm: 0
|
llvm: 0
|
||||||
cflags: "-Og"
|
cflags: "-Og"
|
||||||
relabel: no
|
relabel: no
|
||||||
vm: 0
|
vm: 0
|
||||||
|
no_qemu: 0
|
||||||
|
no_kvm: 0
|
||||||
|
- distro: debian
|
||||||
|
release: testing
|
||||||
|
runner: ubuntu-24.04-arm
|
||||||
|
sanitizers: ""
|
||||||
|
llvm: 0
|
||||||
|
cflags: "-Og"
|
||||||
|
relabel: no
|
||||||
|
vm: 0
|
||||||
|
no_qemu: 1
|
||||||
|
no_kvm: 1
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
release: noble
|
release: noble
|
||||||
|
runner: ubuntu-24.04
|
||||||
sanitizers: ""
|
sanitizers: ""
|
||||||
llvm: 0
|
llvm: 0
|
||||||
cflags: "-Og"
|
cflags: "-Og"
|
||||||
relabel: no
|
relabel: no
|
||||||
vm: 0
|
vm: 0
|
||||||
|
no_qemu: 0
|
||||||
|
no_kvm: 0
|
||||||
- distro: fedora
|
- distro: fedora
|
||||||
release: "42"
|
release: "42"
|
||||||
|
runner: ubuntu-24.04
|
||||||
sanitizers: address,undefined
|
sanitizers: address,undefined
|
||||||
llvm: 1
|
llvm: 1
|
||||||
cflags: "-Og"
|
cflags: "-Og"
|
||||||
relabel: yes
|
relabel: yes
|
||||||
vm: 0
|
vm: 0
|
||||||
|
no_qemu: 0
|
||||||
|
no_kvm: 0
|
||||||
- distro: fedora
|
- distro: fedora
|
||||||
release: rawhide
|
release: rawhide
|
||||||
|
runner: ubuntu-24.04
|
||||||
sanitizers: ""
|
sanitizers: ""
|
||||||
llvm: 0
|
llvm: 0
|
||||||
cflags: "-Og"
|
cflags: "-Og"
|
||||||
relabel: yes
|
relabel: yes
|
||||||
vm: 0
|
vm: 0
|
||||||
|
no_qemu: 0
|
||||||
|
no_kvm: 0
|
||||||
- distro: opensuse
|
- distro: opensuse
|
||||||
release: tumbleweed
|
release: tumbleweed
|
||||||
|
runner: ubuntu-24.04
|
||||||
sanitizers: ""
|
sanitizers: ""
|
||||||
llvm: 0
|
llvm: 0
|
||||||
cflags: "-Og"
|
cflags: "-Og"
|
||||||
relabel: no
|
relabel: no
|
||||||
vm: 0
|
vm: 0
|
||||||
|
no_qemu: 0
|
||||||
|
no_kvm: 0
|
||||||
- distro: centos
|
- distro: centos
|
||||||
release: "9"
|
release: "9"
|
||||||
|
runner: ubuntu-24.04
|
||||||
sanitizers: ""
|
sanitizers: ""
|
||||||
llvm: 0
|
llvm: 0
|
||||||
cflags: "-Og"
|
cflags: "-Og"
|
||||||
relabel: yes
|
relabel: yes
|
||||||
vm: 0
|
vm: 0
|
||||||
|
no_qemu: 0
|
||||||
|
no_kvm: 0
|
||||||
- distro: centos
|
- distro: centos
|
||||||
release: "10"
|
release: "10"
|
||||||
|
runner: ubuntu-24.04
|
||||||
sanitizers: ""
|
sanitizers: ""
|
||||||
llvm: 0
|
llvm: 0
|
||||||
cflags: "-Og"
|
cflags: "-Og"
|
||||||
relabel: yes
|
relabel: yes
|
||||||
vm: 0
|
vm: 0
|
||||||
|
no_qemu: 0
|
||||||
|
no_kvm: 0
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
@ -215,14 +249,22 @@ jobs:
|
|||||||
MAX_LINES=()
|
MAX_LINES=()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${{ matrix.no_kvm }}" = 1 ] && [ "${{ matrix.no_qemu }}" = 0 ]; then
|
||||||
|
timeout_multiplier=4
|
||||||
|
fi
|
||||||
|
|
||||||
# --preserve-env makes sure all the github actions environment variables are propagated which are
|
# --preserve-env makes sure all the github actions environment variables are propagated which are
|
||||||
# used in integration-test-wrapper.py to construct the `gh` command line to download the journals
|
# used in integration-test-wrapper.py to construct the `gh` command line to download the journals
|
||||||
# of failed tests.
|
# of failed tests.
|
||||||
sudo --preserve-env mkosi sandbox -- \
|
sudo --preserve-env mkosi sandbox -- \
|
||||||
env \
|
env \
|
||||||
TEST_PREFER_QEMU=${{ matrix.vm }} \
|
TEST_PREFER_QEMU=${{ matrix.vm }} \
|
||||||
|
TEST_NO_QEMU=${{ matrix.no_qemu }} \
|
||||||
|
TEST_NO_KVM=${{ matrix.no_kvm }} \
|
||||||
|
TEST_RUNNER=${{ matrix.runner }} \
|
||||||
meson test \
|
meson test \
|
||||||
-C build \
|
-C build \
|
||||||
|
--timeout-multiplier="${timeout_multiplier:-1}" \
|
||||||
--no-rebuild \
|
--no-rebuild \
|
||||||
--setup=integration \
|
--setup=integration \
|
||||||
--suite=integration-tests \
|
--suite=integration-tests \
|
||||||
@ -235,7 +277,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
if: failure() && (github.repository == 'systemd/systemd' || github.repository == 'systemd/systemd-stable')
|
if: failure() && (github.repository == 'systemd/systemd' || github.repository == 'systemd/systemd-stable')
|
||||||
with:
|
with:
|
||||||
name: ci-mkosi-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.distro }}-${{ matrix.release }}-failed-test-journals
|
name: ci-mkosi-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.distro }}-${{ matrix.release }}-${{ matrix.runner }}-failed-test-journals
|
||||||
path: |
|
path: |
|
||||||
build/test/journal/*.journal
|
build/test/journal/*.journal
|
||||||
build/meson-logs/*
|
build/meson-logs/*
|
||||||
|
@ -241,14 +241,14 @@ static int ask_password_keyring(const AskPasswordRequest *req, AskPasswordFlags
|
|||||||
return -EUNATCH;
|
return -EUNATCH;
|
||||||
|
|
||||||
r = lookup_key(req->keyring, &serial);
|
r = lookup_key(req->keyring, &serial);
|
||||||
if (ERRNO_IS_NEG_NOT_SUPPORTED(r) || r == -EPERM)
|
if (ERRNO_IS_NEG_NOT_SUPPORTED(r) || IN_SET(r, -EPERM, -ENOKEY))
|
||||||
/* When retrieving, the distinction between "kernel or container manager don't support or
|
/* When retrieving, the distinction between "kernel or container manager don't support or
|
||||||
* allow this" and "no matching key known" doesn't matter. Note that we propagate EACCESS
|
* allow this" and "no matching key known" doesn't matter. Note that we propagate EACCESS
|
||||||
* here (even if EPERM not) since that is used if the keyring is available, but we lack
|
* here (even if EPERM not) since that is used if the keyring is available, but we lack
|
||||||
* access to the key. */
|
* access to the key. */
|
||||||
return -ENOKEY;
|
return -ENOKEY;
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return log_debug_errno(r, "Failed to look up key %s in keyring: %m", req->keyring);
|
||||||
|
|
||||||
_cleanup_strv_free_erase_ char **l = NULL;
|
_cleanup_strv_free_erase_ char **l = NULL;
|
||||||
r = retrieve_key(serial, &l);
|
r = retrieve_key(serial, &l);
|
||||||
|
@ -672,7 +672,10 @@ def main() -> None:
|
|||||||
id = os.environ['GITHUB_RUN_ID']
|
id = os.environ['GITHUB_RUN_ID']
|
||||||
wf = os.environ['GITHUB_WORKFLOW']
|
wf = os.environ['GITHUB_WORKFLOW']
|
||||||
iter = os.environ['GITHUB_RUN_ATTEMPT']
|
iter = os.environ['GITHUB_RUN_ATTEMPT']
|
||||||
artifact = f'ci-{wf}-{id}-{iter}-{summary.distribution}-{summary.release}-failed-test-journals'
|
runner = os.environ['TEST_RUNNER']
|
||||||
|
artifact = (
|
||||||
|
f'ci-{wf}-{id}-{iter}-{summary.distribution}-{summary.release}-{runner}-failed-test-journals' # noqa: E501
|
||||||
|
)
|
||||||
ops += [f'gh run download {id} --name {artifact} -D ci/{artifact}']
|
ops += [f'gh run download {id} --name {artifact} -D ci/{artifact}']
|
||||||
journal_file = Path(f'ci/{artifact}/test/journal/{name}.journal')
|
journal_file = Path(f'ci/{artifact}/test/journal/{name}.journal')
|
||||||
|
|
||||||
|
@ -64,10 +64,11 @@ def setUpModule():
|
|||||||
# Ensure we don't mess with an existing networkd config
|
# Ensure we don't mess with an existing networkd config
|
||||||
for u in [
|
for u in [
|
||||||
'systemd-networkd.socket',
|
'systemd-networkd.socket',
|
||||||
'systemd-networkd',
|
'systemd-networkd-varlink.socket',
|
||||||
|
'systemd-networkd.service',
|
||||||
'systemd-resolved-varlink.socket',
|
'systemd-resolved-varlink.socket',
|
||||||
'systemd-resolved-monitor.socket',
|
'systemd-resolved-monitor.socket',
|
||||||
'systemd-resolved',
|
'systemd-resolved.service',
|
||||||
]:
|
]:
|
||||||
if subprocess.call(['systemctl', 'is-active', '--quiet', u]) == 0:
|
if subprocess.call(['systemctl', 'is-active', '--quiet', u]) == 0:
|
||||||
subprocess.call(['systemctl', 'stop', u])
|
subprocess.call(['systemctl', 'stop', u])
|
||||||
|
@ -13,7 +13,7 @@ at_exit() {
|
|||||||
set +e
|
set +e
|
||||||
|
|
||||||
machinectl status long-running &>/dev/null && machinectl kill --signal=KILL long-running
|
machinectl status long-running &>/dev/null && machinectl kill --signal=KILL long-running
|
||||||
mountpoint -q /var/lib/machines && timeout 10 sh -c "until umount /var/lib/machines; do sleep .5; done"
|
mountpoint -q /var/lib/machines && timeout 30 sh -c "until umount /var/lib/machines; do sleep .5; done"
|
||||||
[[ -n "${NSPAWN_FRAGMENT:-}" ]] && rm -f "/etc/systemd/nspawn/$NSPAWN_FRAGMENT" "/var/lib/machines/$NSPAWN_FRAGMENT"
|
[[ -n "${NSPAWN_FRAGMENT:-}" ]] && rm -f "/etc/systemd/nspawn/$NSPAWN_FRAGMENT" "/var/lib/machines/$NSPAWN_FRAGMENT"
|
||||||
rm -f /run/systemd/nspawn/*.nspawn
|
rm -f /run/systemd/nspawn/*.nspawn
|
||||||
}
|
}
|
||||||
@ -120,22 +120,22 @@ machinectl disable long-running long-running long-running container1
|
|||||||
# Equivalent to machinectl kill --signal=SIGRTMIN+4 --kill-whom=leader
|
# Equivalent to machinectl kill --signal=SIGRTMIN+4 --kill-whom=leader
|
||||||
rm -f /var/lib/machines/long-running/poweroff
|
rm -f /var/lib/machines/long-running/poweroff
|
||||||
machinectl poweroff long-running
|
machinectl poweroff long-running
|
||||||
timeout 10 bash -c "until test -e /var/lib/machines/long-running/poweroff; do sleep .5; done"
|
timeout 30 bash -c "until test -e /var/lib/machines/long-running/poweroff; do sleep .5; done"
|
||||||
# Equivalent to machinectl kill --signal=SIGINT --kill-whom=leader
|
# Equivalent to machinectl kill --signal=SIGINT --kill-whom=leader
|
||||||
rm -f /var/lib/machines/long-running/reboot
|
rm -f /var/lib/machines/long-running/reboot
|
||||||
machinectl reboot long-running
|
machinectl reboot long-running
|
||||||
timeout 10 bash -c "until test -e /var/lib/machines/long-running/reboot; do sleep .5; done"
|
timeout 30 bash -c "until test -e /var/lib/machines/long-running/reboot; do sleep .5; done"
|
||||||
# Test for 'machinectl terminate'
|
# Test for 'machinectl terminate'
|
||||||
rm -f /var/lib/machines/long-running/terminate
|
rm -f /var/lib/machines/long-running/terminate
|
||||||
machinectl terminate long-running
|
machinectl terminate long-running
|
||||||
timeout 10 bash -c "until test -e /var/lib/machines/long-running/terminate; do sleep .5; done"
|
timeout 30 bash -c "until test -e /var/lib/machines/long-running/terminate; do sleep .5; done"
|
||||||
timeout 10 bash -c "while machinectl status long-running &>/dev/null; do sleep .5; done"
|
timeout 30 bash -c "while machinectl status long-running &>/dev/null; do sleep .5; done"
|
||||||
# Restart container
|
# Restart container
|
||||||
long_running_machine_start
|
long_running_machine_start
|
||||||
# Test for 'machinectl kill'
|
# Test for 'machinectl kill'
|
||||||
rm -f /var/lib/machines/long-running/trap
|
rm -f /var/lib/machines/long-running/trap
|
||||||
machinectl kill --signal=SIGTRAP --kill-whom=leader long-running
|
machinectl kill --signal=SIGTRAP --kill-whom=leader long-running
|
||||||
timeout 10 bash -c "until test -e /var/lib/machines/long-running/trap; do sleep .5; done"
|
timeout 30 bash -c "until test -e /var/lib/machines/long-running/trap; do sleep .5; done"
|
||||||
# Multiple machines at once
|
# Multiple machines at once
|
||||||
machinectl poweroff long-running long-running long-running
|
machinectl poweroff long-running long-running long-running
|
||||||
machinectl reboot long-running long-running long-running
|
machinectl reboot long-running long-running long-running
|
||||||
@ -223,7 +223,7 @@ machinectl import-fs /var/tmp/container.dir container-dir
|
|||||||
machinectl start container-dir
|
machinectl start container-dir
|
||||||
rm -fr /var/tmp/container.dir
|
rm -fr /var/tmp/container.dir
|
||||||
|
|
||||||
timeout 10 bash -c "until machinectl clean --all; do sleep .5; done"
|
timeout 30 bash -c "until machinectl clean --all; do sleep .5; done"
|
||||||
|
|
||||||
NSPAWN_FRAGMENT="machinectl-test-$RANDOM.nspawn"
|
NSPAWN_FRAGMENT="machinectl-test-$RANDOM.nspawn"
|
||||||
cat >"/var/lib/machines/$NSPAWN_FRAGMENT" <<EOF
|
cat >"/var/lib/machines/$NSPAWN_FRAGMENT" <<EOF
|
||||||
@ -442,7 +442,7 @@ varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.OpenR
|
|||||||
# Terminating machine, otherwise acquiring image metadata by io.systemd.MachineImage.List may fail in the below.
|
# Terminating machine, otherwise acquiring image metadata by io.systemd.MachineImage.List may fail in the below.
|
||||||
machinectl terminate long-running
|
machinectl terminate long-running
|
||||||
# wait for the container being stopped, otherwise acquiring image metadata by io.systemd.MachineImage.List may fail in the below.
|
# wait for the container being stopped, otherwise acquiring image metadata by io.systemd.MachineImage.List may fail in the below.
|
||||||
timeout 10 bash -c "while machinectl status long-running &>/dev/null; do sleep .5; done"
|
timeout 30 bash -c "while machinectl status long-running &>/dev/null; do sleep .5; done"
|
||||||
systemctl kill --signal=KILL systemd-nspawn@long-running.service || :
|
systemctl kill --signal=KILL systemd-nspawn@long-running.service || :
|
||||||
|
|
||||||
# test io.systemd.MachineImage.List
|
# test io.systemd.MachineImage.List
|
||||||
|
@ -1126,7 +1126,10 @@ testcase_check_os_release() {
|
|||||||
base="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.check_os_release_base.XXX)"
|
base="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.check_os_release_base.XXX)"
|
||||||
root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.check_os_release.XXX)"
|
root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.check_os_release.XXX)"
|
||||||
create_dummy_container "$base"
|
create_dummy_container "$base"
|
||||||
cp -d "$base"/{bin,sbin,lib,lib64} "$root/"
|
cp -d "$base"/{bin,sbin,lib} "$root/"
|
||||||
|
if [ -d "$base"/lib64 ]; then
|
||||||
|
cp -d "$base"/lib64 "$root/"
|
||||||
|
fi
|
||||||
common_opts=(
|
common_opts=(
|
||||||
--boot
|
--boot
|
||||||
--register=no
|
--register=no
|
||||||
|
@ -11,7 +11,7 @@ at_exit() {
|
|||||||
set +e
|
set +e
|
||||||
|
|
||||||
machinectl kill --signal=KILL nss-mymachines-{noip,singleip,manyips}
|
machinectl kill --signal=KILL nss-mymachines-{noip,singleip,manyips}
|
||||||
mountpoint -q /var/lib/machines && timeout 10 sh -c "until umount /var/lib/machines; do sleep .5; done"
|
mountpoint -q /var/lib/machines && timeout 30 sh -c "until umount /var/lib/machines; do sleep .5; done"
|
||||||
rm -f /run/systemd/nspawn/*.nspawn
|
rm -f /run/systemd/nspawn/*.nspawn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,8 +190,8 @@ udevadm test-builtin "factory_reset status" "$loopdev"
|
|||||||
# systemd-hwdb update is extremely slow when combined with sanitizers and run
|
# systemd-hwdb update is extremely slow when combined with sanitizers and run
|
||||||
# in a VM without acceleration, so let's just skip the one particular test
|
# in a VM without acceleration, so let's just skip the one particular test
|
||||||
# if we detect this combination
|
# if we detect this combination
|
||||||
if ! [[ -v ASAN_OPTIONS && "$(systemd-detect-virt -v)" == "qemu" ]]; then
|
# scsi_debug is not available in all architectures/kernels combinations
|
||||||
modprobe scsi_debug
|
if ! [[ -v ASAN_OPTIONS && "$(systemd-detect-virt -v)" == "qemu" ]] && modprobe scsi_debug; then
|
||||||
scsidev=$(readlink -f /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/[0-9]*)
|
scsidev=$(readlink -f /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/[0-9]*)
|
||||||
mkdir -p /etc/udev/hwdb.d
|
mkdir -p /etc/udev/hwdb.d
|
||||||
cat >/etc/udev/hwdb.d/99-test.hwdb <<EOF
|
cat >/etc/udev/hwdb.d/99-test.hwdb <<EOF
|
||||||
|
@ -298,7 +298,7 @@ teardown_session() (
|
|||||||
|
|
||||||
rm -f /run/udev/rules.d/70-logindtest-scsi_debug-user.rules
|
rm -f /run/udev/rules.d/70-logindtest-scsi_debug-user.rules
|
||||||
udevadm control --reload
|
udevadm control --reload
|
||||||
rmmod scsi_debug
|
rmmod scsi_debug || true
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
)
|
)
|
||||||
@ -446,7 +446,11 @@ EOF
|
|||||||
|
|
||||||
# coldplug: logind started with existing device
|
# coldplug: logind started with existing device
|
||||||
systemctl stop systemd-logind.service
|
systemctl stop systemd-logind.service
|
||||||
modprobe scsi_debug
|
if ! modprobe scsi_debug; then
|
||||||
|
echo "scsi_debug module not available, skipping test ${FUNCNAME[0]}."
|
||||||
|
systemctl start systemd-logind.service
|
||||||
|
return
|
||||||
|
fi
|
||||||
timeout 30 bash -c 'until ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block 2>/dev/null; do sleep 1; done'
|
timeout 30 bash -c 'until ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block 2>/dev/null; do sleep 1; done'
|
||||||
dev=/dev/$(ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block 2>/dev/null)
|
dev=/dev/$(ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block 2>/dev/null)
|
||||||
if [[ ! -b "$dev" ]]; then
|
if [[ ! -b "$dev" ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user