2020-03-04 09:35:06 +00:00
#!/usr/bin/env bash
2021-10-17 18:13:06 +02:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2017-08-07 21:09:21 +02:00
set -e
2021-04-19 13:01:59 +02:00
2023-05-10 12:38:57 +02:00
TEST_DESCRIPTION = "Tests for core PID1 functionality"
2015-11-23 17:56:45 +00:00
2023-10-11 13:02:14 +09:00
# for testing PrivateNetwork=yes
NSPAWN_ARGUMENTS = "--capability=CAP_NET_ADMIN"
2021-04-19 13:01:59 +02:00
# shellcheck source=test/test-functions
. " ${ TEST_BASE_DIR : ? } /test-functions "
2015-11-23 17:56:45 +00:00
2023-05-10 13:07:26 +02:00
test_append_files( ) {
local workspace = " ${ 1 : ? } "
2023-09-05 13:14:39 +02:00
# We might not be fast enough to hit the limit (20 triggers per 2 secs)
# in certain environments, i.e. when running without KVM or when collecting
# coverage. Let's help it a bit in such case.
if ! get_bool " $QEMU_KVM " || get_bool " $IS_BUILT_WITH_COVERAGE " ; then
2023-05-10 13:41:03 +02:00
mkdir -p " $workspace /etc/systemd/system/issue2467.socket.d "
2023-09-05 13:14:39 +02:00
printf "[Socket]\nTriggerLimitIntervalSec=10\n" >" $workspace /etc/systemd/system/issue2467.socket.d/TriggerLimitInterval.conf "
2023-05-10 13:41:03 +02:00
fi
2023-05-10 13:07:26 +02:00
# Issue: https://github.com/systemd/systemd/issues/2730
mkdir -p " $workspace /etc/systemd/system/ "
cat >" $workspace /etc/systemd/system/issue2730.mount " <<EOF
[ Mount]
What = tmpfs
Where = /issue2730
Type = tmpfs
[ Install]
WantedBy = local-fs.target
Alias = issue2730-alias.mount
EOF
" ${ SYSTEMCTL : ? } " enable --root= " $workspace " issue2730.mount
ln -svrf " $workspace /etc/systemd/system/issue2730.mount " " $workspace /etc/systemd/system/issue2730-alias.mount "
2023-09-18 18:05:27 +02:00
2023-12-11 01:03:39 +00:00
image_install logger socat
2023-05-10 13:07:26 +02:00
}
2021-04-26 19:20:18 +02:00
do_test " $@ "