mirror of
https://github.com/systemd/systemd
synced 2024-10-01 13:55:20 +00:00
Merge pull request #30464 from CodethinkLabs/misc-integration-test-fixes
Misc integration test fixes
This commit is contained in:
commit
c2d5d8c401
|
@ -4,7 +4,7 @@
|
|||
Images=system
|
||||
|
||||
[Output]
|
||||
OutputDirectory=mkosi.output
|
||||
@OutputDirectory=mkosi.output
|
||||
BuildDirectory=mkosi.builddir
|
||||
CacheDirectory=mkosi.cache
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ EOF
|
|||
fi
|
||||
|
||||
if [ ! -f "$BUILDDIR"/build.ninja ]; then
|
||||
sysvinit_path=$(realpath /etc/init.d)
|
||||
[[ -d /etc/rc.d/init.d ]] && sysvinit_path="/etc/rc.d/init.d" || sysvinit_path="/etc/init.d"
|
||||
|
||||
if [ "$ID" = "centos" ] && [ "$VERSION" = "8" ]; then
|
||||
UKIFY="disabled"
|
||||
|
|
|
@ -33,6 +33,7 @@ Packages=
|
|||
strace
|
||||
systemd
|
||||
tmux
|
||||
tar
|
||||
tree
|
||||
udev
|
||||
util-linux
|
||||
|
|
|
@ -8,4 +8,5 @@ Packages=
|
|||
btrfs-progs
|
||||
compsize
|
||||
f2fs-tools
|
||||
glibc-langpack-en
|
||||
kernel-core
|
||||
|
|
|
@ -83,3 +83,12 @@ if [ "$ID" = "centos" ] && [ "$VERSION" = "8" ]; then
|
|||
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
|
||||
alternatives --set python3 /usr/bin/python3.9
|
||||
fi
|
||||
|
||||
mkdir -p /usr/lib/sysusers.d
|
||||
cat >/usr/lib/sysusers.d/testuser.conf <<EOF
|
||||
u testuser 4711 "Test User" /home/testuser
|
||||
EOF
|
||||
mkdir -p /usr/lib/tmpfiles.d
|
||||
cat >/usr/lib/tmpfiles.d/testuser.conf <<EOF
|
||||
q /home/testuser 0700 4711 4711
|
||||
EOF
|
||||
|
|
|
@ -5,6 +5,11 @@ set -o pipefail
|
|||
|
||||
# shellcheck source=test/units/test-control.sh
|
||||
. "$(dirname "$0")"/test-control.sh
|
||||
# shellcheck source=test/units/util.sh
|
||||
. "$(dirname "$0")"/util.sh
|
||||
|
||||
maybe_mount_usr_overlay
|
||||
trap 'maybe_umount_usr_overlay' EXIT
|
||||
|
||||
clear_unit() {
|
||||
local unit_name="${1:?}"
|
||||
|
|
|
@ -12,10 +12,13 @@ at_exit() {
|
|||
rm -fvr "/usr/lib/systemd/system/$UNIT_NAME" "/etc/systemd/system/$UNIT_NAME.d" "+4"
|
||||
fi
|
||||
|
||||
maybe_umount_usr_overlay
|
||||
|
||||
rm -f /etc/init.d/issue-24990
|
||||
return 0
|
||||
}
|
||||
|
||||
maybe_mount_usr_overlay
|
||||
trap at_exit EXIT
|
||||
|
||||
# Create a simple unit file for testing
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
set -eux
|
||||
set -o pipefail
|
||||
|
||||
if journalctl -b -t systemd --grep '\.device: Changed plugged -> dead'; then
|
||||
if journalctl -b -t systemd --grep '(?<!loop.|diskseq-.)\.device: Changed plugged -> dead'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
@ -6,6 +6,9 @@ set -o pipefail
|
|||
# shellcheck source=test/units/util.sh
|
||||
. "$(dirname "$0")"/util.sh
|
||||
|
||||
maybe_mount_usr_overlay
|
||||
trap 'maybe_umount_usr_overlay' EXIT
|
||||
|
||||
teardown_test_dependencies() (
|
||||
set +eux
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ systemd-analyze security --json=short | jq
|
|||
if [[ ! -v ASAN_OPTIONS ]]; then
|
||||
# check that systemd-analyze cat-config paths work in a chroot
|
||||
mkdir -p /tmp/root
|
||||
mount --bind / /tmp/root
|
||||
mount --rbind / /tmp/root
|
||||
systemd-analyze cat-config systemd/system-preset >/tmp/out1
|
||||
chroot /tmp/root systemd-analyze cat-config systemd/system-preset >/tmp/out2
|
||||
diff /tmp/out{1,2}
|
||||
|
|
|
@ -9,6 +9,9 @@ set -o pipefail
|
|||
# shellcheck source=test/units/util.sh
|
||||
. "$(dirname "$0")"/util.sh
|
||||
|
||||
maybe_mount_usr_overlay
|
||||
trap 'maybe_umount_usr_overlay' EXIT
|
||||
|
||||
enable_debug() {
|
||||
mkdir -p /run/systemd/system/systemd-localed.service.d
|
||||
cat >>/run/systemd/system/systemd-localed.service.d/override.conf <<EOF
|
||||
|
|
|
@ -216,3 +216,19 @@ kernel_supports_lsm() {
|
|||
|
||||
return 1
|
||||
}
|
||||
|
||||
MOUNTED_USR_OVERLAY=false
|
||||
|
||||
maybe_mount_usr_overlay() {
|
||||
if [[ ! -w /usr ]]; then
|
||||
mkdir -p /tmp/usr-overlay/{upperdir,workdir}
|
||||
mount -t overlay -o lowerdir=/usr,upperdir=/tmp/usr-overlay/upperdir,workdir=/tmp/usr-overlay/workdir overlay /usr
|
||||
MOUNTED_USR_OVERLAY=true
|
||||
fi
|
||||
}
|
||||
|
||||
maybe_umount_usr_overlay() {
|
||||
if "$MOUNTED_USR_OVERLAY"; then
|
||||
umount -l /usr
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue