blob: 0a1595fa9726820a0e4a6fdcf2c2b27293dff286 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
#!/bin/bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eux
set -o pipefail
# Switch SELinux to permissive if possible, since the tests don't set proper contexts
setenforce 0 || true
# Allow running the integration tests downstream in dist-git with something like
# the following snippet which makes the dist-git sources available in $TMT_SOURCE_DIR:
#
# summary: systemd Fedora test suite
# discover:
# how: fmf
# dist-git-source: true
# dist-git-install-builddeps: false
# prepare:
# - name: systemd
# how: install
# exclude:
# - systemd-standalone-.*
# execute:
# how: tmt
shopt -s extglob
if [[ -n "${TMT_SOURCE_DIR:-}" ]]; then
# Match either directories ending with branch names (e.g. systemd-fmf) or releases (e.g systemd-257.1).
pushd "$TMT_SOURCE_DIR"/systemd-+([0-9a-z.~])/
elif [[ -n "${PACKIT_TARGET_URL:-}" ]]; then
# Prepare systemd source tree
git clone "$PACKIT_TARGET_URL" systemd --branch "$PACKIT_TARGET_BRANCH"
pushd systemd
# If we're running in a pull request job, merge the remote branch into the current main
if [[ -n "${PACKIT_SOURCE_URL:-}" ]]; then
git remote add pr "${PACKIT_SOURCE_URL:?}"
git fetch pr "${PACKIT_SOURCE_BRANCH:?}"
git merge "pr/$PACKIT_SOURCE_BRANCH"
fi
git log --oneline -5
else
echo "Not running within packit or Fedora CI"
exit 1
fi
# Now prepare mkosi, possibly at the same version required by the systemd repo
git clone https://github.com/systemd/mkosi
mkosi_hash="$(grep systemd/mkosi@ .github/workflows/mkosi.yml | sed "s|.*systemd/mkosi@||g")"
git -C mkosi checkout "$mkosi_hash"
export PATH="$PWD/mkosi/bin:$PATH"
# shellcheck source=/dev/null
. /etc/os-release || . /usr/lib/os-release
tee mkosi.local.conf <<EOF
[Distribution]
Release=${VERSION_ID:-rawhide}
[Build]
ToolsTreeDistribution=$ID
ToolsTreeRelease=${VERSION_ID:-rawhide}
ToolsTreeSandboxTrees=
/etc/yum.repos.d/:/etc/yum.repos.d/
/var/share/test-artifacts/:/var/share/test-artifacts/
SandboxTrees=
/etc/yum.repos.d/:/etc/yum.repos.d/
/var/share/test-artifacts/:/var/share/test-artifacts/
Environment=NO_BUILD=1
EOF
cat /etc/dnf/dnf.conf
cat /etc/yum.repos.d/*
# Ensure packages built for this test have highest priority
echo -e "\npriority=1" >> /etc/yum.repos.d/copr_build*
# Disable mkosi's own repository logic
touch /etc/yum.repos.d/mkosi.repo
# TODO: drop once BTRFS regression is fixed in kernel 6.13
sed -i "s/Format=btrfs/Format=ext4/" mkosi.repart/10-root.conf
# If we don't have KVM, skip running in qemu, as it's too slow. But try to load the module first.
modprobe kvm || true
if [[ ! -e /dev/kvm ]]; then
export TEST_NO_QEMU=1
fi
# Create missing mountpoint for mkosi sandbox.
mkdir -p /etc/pacman.d/gnupg
mkosi summary
mkosi -f sandbox true
mkosi -f sandbox meson setup --buildtype=debugoptimized -Dintegration-tests=true build
mkosi genkey
mkosi -f sandbox meson compile -C build mkosi
mkosi -f sandbox \
meson test \
-C build \
--no-rebuild \
--suite integration-tests \
--print-errorlogs \
--no-stdsplit \
--num-processes "$(($(nproc) - 1))"
popd
|