2020-03-04 12:35:06 +03:00
#!/usr/bin/env bash
2021-10-17 19:13:06 +03:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2017-08-07 22:09:21 +03:00
set -e
2021-04-19 14:01:59 +03:00
2023-05-10 13:38:57 +03:00
TEST_DESCRIPTION = "Tests for core PID1 functionality"
2015-11-23 20:56:45 +03:00
2023-10-11 07:02:14 +03:00
# for testing PrivateNetwork=yes
NSPAWN_ARGUMENTS = "--capability=CAP_NET_ADMIN"
2021-04-19 14:01:59 +03:00
# shellcheck source=test/test-functions
. " ${ TEST_BASE_DIR : ? } /test-functions "
2015-11-23 20:56:45 +03:00
2023-05-10 14:07:26 +03:00
test_append_files( ) {
local workspace = " ${ 1 : ? } "
2023-09-05 14:14:39 +03: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 14:41:03 +03:00
mkdir -p " $workspace /etc/systemd/system/issue2467.socket.d "
2023-09-05 14:14:39 +03:00
printf "[Socket]\nTriggerLimitIntervalSec=10\n" >" $workspace /etc/systemd/system/issue2467.socket.d/TriggerLimitInterval.conf "
2023-05-10 14:41:03 +03:00
fi
2023-05-10 14:07:26 +03: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 19:05:27 +03:00
image_install logger
2023-05-10 14:07:26 +03:00
}
2021-04-26 20:20:18 +03:00
do_test " $@ "