mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
TEST-*: use spacing before redirection operator, but not after
<< EOF → <<EOF > foo < bar → >foo <bar
This commit is contained in:
parent
4e20fe2795
commit
0ee994836c
@ -16,4 +16,4 @@ NSPAWN_TIMEOUT=20
|
||||
# only found from the console during the poweroff.
|
||||
rm -f /tmp/honorfirstshutdown.log >/dev/null
|
||||
|
||||
do_test "$@" 52 > /tmp/honorfirstshutdown.log
|
||||
do_test "$@" 52 >/tmp/honorfirstshutdown.log
|
||||
|
@ -2,8 +2,8 @@
|
||||
Description=Test for StandardOutput=append:
|
||||
|
||||
[Service]
|
||||
ExecStartPre=sh -c 'printf "hello\n" > /tmp/test-exec-standardoutput-output'
|
||||
ExecStartPre=sh -c 'printf "hello\nhello\n" > /tmp/test-exec-standardoutput-expected'
|
||||
ExecStartPre=sh -c 'printf "hello\n" >/tmp/test-exec-standardoutput-output'
|
||||
ExecStartPre=sh -c 'printf "hello\nhello\n" >/tmp/test-exec-standardoutput-expected'
|
||||
StandardInput=data
|
||||
StandardInputText=hello
|
||||
StandardOutput=append:/tmp/test-exec-standardoutput-output
|
||||
|
@ -2,8 +2,8 @@
|
||||
Description=Test for StandardOutput=file:
|
||||
|
||||
[Service]
|
||||
ExecStartPre=sh -c 'printf "nooo\nhello\n" > /tmp/test-exec-standardoutput-output'
|
||||
ExecStartPre=sh -c 'printf "hello\nello\n" > /tmp/test-exec-standardoutput-expected'
|
||||
ExecStartPre=sh -c 'printf "nooo\nhello\n" >/tmp/test-exec-standardoutput-output'
|
||||
ExecStartPre=sh -c 'printf "hello\nello\n" >/tmp/test-exec-standardoutput-expected'
|
||||
StandardInput=data
|
||||
StandardInputText=hello
|
||||
StandardOutput=file:/tmp/test-exec-standardoutput-output
|
||||
|
@ -2,8 +2,8 @@
|
||||
Description=Test for StandardOutput=truncate:
|
||||
|
||||
[Service]
|
||||
ExecStartPre=sh -c 'printf "hello\n" > /tmp/test-exec-standardoutput-output'
|
||||
ExecStartPre=sh -c 'printf "hi\n" > /tmp/test-exec-standardoutput-expected'
|
||||
ExecStartPre=sh -c 'printf "hello\n" >/tmp/test-exec-standardoutput-output'
|
||||
ExecStartPre=sh -c 'printf "hi\n" >/tmp/test-exec-standardoutput-expected'
|
||||
StandardInput=data
|
||||
StandardInputText=hi
|
||||
StandardOutput=truncate:/tmp/test-exec-standardoutput-output
|
||||
|
@ -503,13 +503,13 @@ install_verity_minimal() {
|
||||
ln -s ../usr/lib/os-release $initdir/etc/os-release
|
||||
touch $initdir/etc/machine-id $initdir/etc/resolv.conf
|
||||
touch $initdir/opt/some_file
|
||||
echo MARKER=1 >> $initdir/usr/lib/os-release
|
||||
echo -e "[Service]\nExecStartPre=cat /usr/lib/os-release\nExecStart=sleep 120" > $initdir/usr/lib/systemd/system/app0.service
|
||||
echo MARKER=1 >>$initdir/usr/lib/os-release
|
||||
echo -e "[Service]\nExecStartPre=cat /usr/lib/os-release\nExecStart=sleep 120" >$initdir/usr/lib/systemd/system/app0.service
|
||||
cp $initdir/usr/lib/systemd/system/app0.service $initdir/usr/lib/systemd/system/app0-foo.service
|
||||
|
||||
mksquashfs $initdir $oldinitdir/usr/share/minimal_0.raw
|
||||
veritysetup format $oldinitdir/usr/share/minimal_0.raw $oldinitdir/usr/share/minimal_0.verity | \
|
||||
grep '^Root hash:' | cut -f2 | tr -d '\n' > $oldinitdir/usr/share/minimal_0.roothash
|
||||
grep '^Root hash:' | cut -f2 | tr -d '\n' >$oldinitdir/usr/share/minimal_0.roothash
|
||||
|
||||
sed -i "s/MARKER=1/MARKER=2/g" $initdir/usr/lib/os-release
|
||||
rm $initdir/usr/lib/systemd/system/app0-foo.service
|
||||
@ -517,7 +517,7 @@ install_verity_minimal() {
|
||||
|
||||
mksquashfs $initdir $oldinitdir/usr/share/minimal_1.raw
|
||||
veritysetup format $oldinitdir/usr/share/minimal_1.raw $oldinitdir/usr/share/minimal_1.verity | \
|
||||
grep '^Root hash:' | cut -f2 | tr -d '\n' > $oldinitdir/usr/share/minimal_1.roothash
|
||||
grep '^Root hash:' | cut -f2 | tr -d '\n' >$oldinitdir/usr/share/minimal_1.roothash
|
||||
|
||||
# Rolling distros like Arch do not set VERSION_ID
|
||||
local version_id=""
|
||||
@ -527,42 +527,42 @@ install_verity_minimal() {
|
||||
|
||||
export initdir=$TESTDIR/app0
|
||||
mkdir -p $initdir/usr/lib/extension-release.d $initdir/usr/lib/systemd/system $initdir/opt
|
||||
grep "^ID=" $os_release > $initdir/usr/lib/extension-release.d/extension-release.app0
|
||||
echo "${version_id}" >> $initdir/usr/lib/extension-release.d/extension-release.app0
|
||||
cat <<EOF > $initdir/usr/lib/systemd/system/app0.service
|
||||
grep "^ID=" $os_release >$initdir/usr/lib/extension-release.d/extension-release.app0
|
||||
echo "${version_id}" >>$initdir/usr/lib/extension-release.d/extension-release.app0
|
||||
cat <<EOF >$initdir/usr/lib/systemd/system/app0.service
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/opt/script0.sh
|
||||
EOF
|
||||
cat <<EOF > $initdir/opt/script0.sh
|
||||
cat <<EOF >$initdir/opt/script0.sh
|
||||
#!/bin/bash
|
||||
set -e
|
||||
test -e /usr/lib/os-release
|
||||
cat /usr/lib/extension-release.d/extension-release.app0
|
||||
EOF
|
||||
chmod +x $initdir/opt/script0.sh
|
||||
echo MARKER=1 > $initdir/usr/lib/systemd/system/some_file
|
||||
echo MARKER=1 >$initdir/usr/lib/systemd/system/some_file
|
||||
mksquashfs $initdir $oldinitdir/usr/share/app0.raw
|
||||
|
||||
export initdir=$TESTDIR/app1
|
||||
mkdir -p $initdir/usr/lib/extension-release.d $initdir/usr/lib/systemd/system $initdir/opt
|
||||
grep "^ID=" $os_release > $initdir/usr/lib/extension-release.d/extension-release.app1
|
||||
echo "${version_id}" >> $initdir/usr/lib/extension-release.d/extension-release.app1
|
||||
cat <<EOF > $initdir/usr/lib/systemd/system/app1.service
|
||||
grep "^ID=" $os_release >$initdir/usr/lib/extension-release.d/extension-release.app1
|
||||
echo "${version_id}" >>$initdir/usr/lib/extension-release.d/extension-release.app1
|
||||
cat <<EOF >$initdir/usr/lib/systemd/system/app1.service
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/opt/script1.sh
|
||||
EOF
|
||||
cat <<EOF > $initdir/opt/script1.sh
|
||||
cat <<EOF >$initdir/opt/script1.sh
|
||||
#!/bin/bash
|
||||
set -e
|
||||
test -e /usr/lib/os-release
|
||||
cat /usr/lib/extension-release.d/extension-release.app1
|
||||
EOF
|
||||
chmod +x $initdir/opt/script1.sh
|
||||
echo MARKER=1 > $initdir/usr/lib/systemd/system/other_file
|
||||
echo MARKER=1 >$initdir/usr/lib/systemd/system/other_file
|
||||
mksquashfs $initdir $oldinitdir/usr/share/app1.raw
|
||||
)
|
||||
}
|
||||
@ -700,7 +700,7 @@ if [[ "$ASAN_COMPILER" == "clang" ]]; then
|
||||
# Let's add the ASan DSO's path to the dynamic linker's cache. This is pretty
|
||||
# unnecessary for gcc & libasan, however, for clang this is crucial, as its
|
||||
# runtime ASan DSO is in a non-standard (library) path.
|
||||
echo "${ASAN_RT_PATH%/*}" > /etc/ld.so.conf.d/asan-path-override.conf
|
||||
echo "${ASAN_RT_PATH%/*}" >/etc/ld.so.conf.d/asan-path-override.conf
|
||||
ldconfig
|
||||
fi
|
||||
echo DefaultEnvironment=\$DEFAULT_ENVIRONMENT >>/etc/systemd/system.conf
|
||||
@ -741,7 +741,7 @@ printf "[Service]\nEnvironment=ASAN_OPTIONS=leak_check_at_exit=false\n" >/etc/sy
|
||||
# they're uninstrumented (like dmsetup). Let's add a simple rule which sets
|
||||
# LD_PRELOAD to the ASan RT library to fix this.
|
||||
mkdir -p /etc/udev/rules.d
|
||||
cat > /etc/udev/rules.d/00-set-LD_PRELOAD.rules << INNER_EOF
|
||||
cat >/etc/udev/rules.d/00-set-LD_PRELOAD.rules <<INNER_EOF
|
||||
SUBSYSTEM=="block", ENV{LD_PRELOAD}="$ASAN_RT_PATH"
|
||||
INNER_EOF
|
||||
chmod 0644 /etc/udev/rules.d/00-set-LD_PRELOAD.rules
|
||||
@ -856,9 +856,9 @@ install_systemd() {
|
||||
[[ "$LOOKS_LIKE_SUSE" ]] && setup_suse
|
||||
|
||||
# enable debug logging in PID1
|
||||
echo LogLevel=debug >> $initdir/etc/systemd/system.conf
|
||||
echo LogLevel=debug >>$initdir/etc/systemd/system.conf
|
||||
# store coredumps in journal
|
||||
echo Storage=journal >> $initdir/etc/systemd/coredump.conf
|
||||
echo Storage=journal >>$initdir/etc/systemd/coredump.conf
|
||||
}
|
||||
|
||||
get_ldpath() {
|
||||
@ -1174,12 +1174,12 @@ install_config_files() {
|
||||
inst_any /etc/os-release /usr/lib/os-release
|
||||
inst /etc/localtime
|
||||
# we want an empty environment
|
||||
> $initdir/etc/environment
|
||||
> $initdir/etc/machine-id
|
||||
> $initdir/etc/resolv.conf
|
||||
>$initdir/etc/environment
|
||||
>$initdir/etc/machine-id
|
||||
>$initdir/etc/resolv.conf
|
||||
|
||||
# set the hostname
|
||||
echo systemd-testsuite > $initdir/etc/hostname
|
||||
echo systemd-testsuite >$initdir/etc/hostname
|
||||
|
||||
# let's set up just one image with the traditional verbose output
|
||||
if [ ${IMAGE_NAME} != "basic" ]; then
|
||||
@ -1202,9 +1202,9 @@ install_debug_tools() {
|
||||
# Set default TERM from vt220 to linux, so at least basic key shortcuts work
|
||||
local _getty_override="$initdir/etc/systemd/system/serial-getty@.service.d"
|
||||
mkdir -p "$_getty_override"
|
||||
echo -e "[Service]\nEnvironment=TERM=linux" > "$_getty_override/default-TERM.conf"
|
||||
echo -e "[Service]\nEnvironment=TERM=linux" >"$_getty_override/default-TERM.conf"
|
||||
|
||||
cat > "$initdir/etc/motd" << EOF
|
||||
cat >"$initdir/etc/motd" <<EOF
|
||||
To adjust the terminal size use:
|
||||
export COLUMNS=xx
|
||||
export LINES=yy
|
||||
@ -1246,7 +1246,7 @@ install_dbus() {
|
||||
|
||||
# setup policy for Type=dbus test
|
||||
mkdir -p $initdir/etc/dbus-1/system.d
|
||||
cat > $initdir/etc/dbus-1/system.d/systemd.test.ExecStopPost.conf <<EOF
|
||||
cat >$initdir/etc/dbus-1/system.d/systemd.test.ExecStopPost.conf <<EOF
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
@ -1987,7 +1987,7 @@ install_kmod_with_fw() {
|
||||
fi
|
||||
|
||||
[ -d "$initdir/.kernelmodseen" ] && \
|
||||
> "$initdir/.kernelmodseen/${1##*/}"
|
||||
>"$initdir/.kernelmodseen/${1##*/}"
|
||||
|
||||
inst_simple "$1" "/lib/modules/$KERNEL_VER/${1##*/lib/modules/$KERNEL_VER/}" \
|
||||
|| return $?
|
||||
@ -2059,11 +2059,11 @@ filter_kernel_modules_by_path () (
|
||||
for _modname in $(eval $_filtercmd); do
|
||||
case $_modname in
|
||||
*.ko) "$2" "$_modname" && echo "$_modname";;
|
||||
*.ko.gz) gzip -dc "$_modname" > $initdir/$$.ko
|
||||
*.ko.gz) gzip -dc "$_modname" >$initdir/$$.ko
|
||||
$2 $initdir/$$.ko && echo "$_modname"
|
||||
rm -f $initdir/$$.ko
|
||||
;;
|
||||
*.ko.xz) xz -dc "$_modname" > $initdir/$$.ko
|
||||
*.ko.xz) xz -dc "$_modname" >$initdir/$$.ko
|
||||
$2 $initdir/$$.ko && echo "$_modname"
|
||||
rm -f $initdir/$$.ko
|
||||
;;
|
||||
@ -2276,7 +2276,7 @@ test_setup() {
|
||||
fi
|
||||
|
||||
local hook_defined=1
|
||||
if declare -f -F test_append_files > /dev/null; then
|
||||
if declare -f -F test_append_files >/dev/null; then
|
||||
hook_defined=$?
|
||||
fi
|
||||
|
||||
|
@ -7,4 +7,4 @@ After=testsuite-28-pre.service
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=test -f /tmp/test-specifier-j-%j
|
||||
ExecStart=sh -c 'echo OK > /testok'
|
||||
ExecStart=sh -c 'echo OK >/testok'
|
||||
|
@ -3,7 +3,7 @@ set -ex
|
||||
set -o pipefail
|
||||
|
||||
if ! test -x /usr/lib/systemd/tests/testdata/units/test-honor-first-shutdown.sh ; then
|
||||
echo "honor-first-shutdown script not found - FAIL" > /testok
|
||||
echo "honor-first-shutdown script not found - FAIL" >/testok
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -13,6 +13,6 @@ systemd-analyze log-target console
|
||||
systemctl enable test-honor-first-shutdown.service
|
||||
systemctl start test-honor-first-shutdown.service
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -6,9 +6,9 @@ set -ex
|
||||
|
||||
systemctl start --no-block hello-after-sleep.target
|
||||
|
||||
systemctl list-jobs > /root/list-jobs.txt
|
||||
systemctl list-jobs >/root/list-jobs.txt
|
||||
while ! grep 'sleep\.service.*running' /root/list-jobs.txt; do
|
||||
systemctl list-jobs > /root/list-jobs.txt
|
||||
systemctl list-jobs >/root/list-jobs.txt
|
||||
done
|
||||
|
||||
grep 'hello\.service.*waiting' /root/list-jobs.txt
|
||||
@ -22,7 +22,7 @@ ELAPSED=$(($END_SEC-$START_SEC))
|
||||
test "$ELAPSED" -lt 3
|
||||
|
||||
# sleep should still be running, hello not.
|
||||
systemctl list-jobs > /root/list-jobs.txt
|
||||
systemctl list-jobs >/root/list-jobs.txt
|
||||
grep 'sleep\.service.*running' /root/list-jobs.txt
|
||||
grep 'hello\.service' /root/list-jobs.txt && exit 1
|
||||
systemctl stop sleep.service hello-after-sleep.target
|
||||
@ -58,13 +58,13 @@ systemctl stop --job-mode=replace-irreversibly unstoppable.service
|
||||
systemctl start unstoppable.service
|
||||
|
||||
# Test waiting for a started unit(s) to terminate again
|
||||
cat <<EOF > /run/systemd/system/wait2.service
|
||||
cat <<EOF >/run/systemd/system/wait2.service
|
||||
[Unit]
|
||||
Description=Wait for 2 seconds
|
||||
[Service]
|
||||
ExecStart=/bin/sh -ec 'sleep 2'
|
||||
EOF
|
||||
cat <<EOF > /run/systemd/system/wait5fail.service
|
||||
cat <<EOF >/run/systemd/system/wait5fail.service
|
||||
[Unit]
|
||||
Description=Wait for 5 seconds and fail
|
||||
[Service]
|
||||
|
@ -63,15 +63,15 @@ grep '^FOO=' /output && { echo 'unexpected success'; exit 1; }
|
||||
grep '^SYSLOG_FACILITY=' /output && { echo 'unexpected success'; exit 1; }
|
||||
|
||||
# `-b all` negates earlier use of -b (-b and -m are otherwise exclusive)
|
||||
journalctl -b -1 -b all -m > /dev/null
|
||||
journalctl -b -1 -b all -m >/dev/null
|
||||
|
||||
# -b always behaves like -b0
|
||||
journalctl -q -b-1 -b0 | head -1 > /expected
|
||||
journalctl -q -b-1 -b | head -1 > /output
|
||||
journalctl -q -b-1 -b0 | head -1 >/expected
|
||||
journalctl -q -b-1 -b | head -1 >/output
|
||||
cmp /expected /output
|
||||
# ... even when another option follows (both of these should fail due to -m)
|
||||
{ journalctl -ball -b0 -m 2>&1 || :; } | head -1 > /expected
|
||||
{ journalctl -ball -b -m 2>&1 || :; } | head -1 > /output
|
||||
{ journalctl -ball -b0 -m 2>&1 || :; } | head -1 >/expected
|
||||
{ journalctl -ball -b -m 2>&1 || :; } | head -1 >/output
|
||||
cmp /expected /output
|
||||
|
||||
# https://github.com/systemd/systemd/issues/13708
|
||||
|
@ -14,7 +14,7 @@ SocketGroup=adm
|
||||
SocketMode=0660
|
||||
EOF
|
||||
|
||||
cat <<'EOF' > /run/systemd/system/test12@.service
|
||||
cat <<'EOF' >/run/systemd/system/test12@.service
|
||||
[Unit]
|
||||
Description=Test service
|
||||
[Service]
|
||||
|
@ -51,9 +51,9 @@ function check_norbind {
|
||||
local _root="/var/lib/machines/testsuite-13.norbind-path"
|
||||
rm -rf "$_root"
|
||||
mkdir -p /tmp/binddir/subdir
|
||||
echo -n "outer" > /tmp/binddir/subdir/file
|
||||
echo -n "outer" >/tmp/binddir/subdir/file
|
||||
mount -t tmpfs tmpfs /tmp/binddir/subdir
|
||||
echo -n "inner" > /tmp/binddir/subdir/file
|
||||
echo -n "inner" >/tmp/binddir/subdir/file
|
||||
/usr/lib/systemd/tests/testdata/create-busybox-container "$_root"
|
||||
systemd-nspawn $SUSE_OPTS--register=no -D "$_root" --bind=/tmp/binddir:/mnt:norbind /bin/sh -c 'CONTENT=$(cat /mnt/subdir/file); if [[ $CONTENT != "outer" ]]; then echo "*** unexpected content: $CONTENT"; return 1; fi'
|
||||
}
|
||||
@ -73,7 +73,7 @@ if [ -n "${VERSION_ID:+set}" ] && [ "${VERSION_ID}" != "${container_host_version
|
||||
if [ -n "${BUILD_ID:+set}" ] && [ "${BUILD_ID}" != "${container_host_build_id}" ]; then exit 1; fi
|
||||
if [ -n "${VARIANT_ID:+set}" ] && [ "${VARIANT_ID}" != "${container_host_variant_id}" ]; then exit 1; fi
|
||||
cd /tmp; (cd /run/host; md5sum os-release) | md5sum -c
|
||||
if echo test >> /run/host/os-release; then exit 1; fi
|
||||
if echo test >>/run/host/os-release; then exit 1; fi
|
||||
'
|
||||
|
||||
local _os_release_source="/etc/os-release"
|
||||
@ -82,7 +82,7 @@ if echo test >> /run/host/os-release; then exit 1; fi
|
||||
elif [ -L "${_os_release_source}" ] && rm /etc/os-release; then
|
||||
# Ensure that /etc always wins if available
|
||||
cp /usr/lib/os-release /etc
|
||||
echo MARKER=1 >> /etc/os-release
|
||||
echo MARKER=1 >>/etc/os-release
|
||||
fi
|
||||
|
||||
systemd-nspawn $SUSE_OPTS--register=no -D /testsuite-13.nc-container --bind="${_os_release_source}":/tmp/os-release /bin/sh -x -e -c "$_cmd"
|
||||
@ -96,7 +96,7 @@ if echo test >> /run/host/os-release; then exit 1; fi
|
||||
function check_machinectl_bind {
|
||||
local _cmd='for i in $(seq 1 20); do if test -f /tmp/marker; then exit 0; fi; sleep 0.5; done; exit 1;'
|
||||
|
||||
cat <<EOF > /run/systemd/system/nspawn_machinectl_bind.service
|
||||
cat <<EOF >/run/systemd/system/nspawn_machinectl_bind.service
|
||||
[Service]
|
||||
Type=notify
|
||||
ExecStart=systemd-nspawn $SUSE_OPTS -D /testsuite-13.nc-container --notify-ready=no /bin/sh -x -e -c "$_cmd"
|
||||
|
@ -165,7 +165,7 @@ test_hierarchical_dropins () {
|
||||
echo "
|
||||
[Service]
|
||||
ExecCondition=/bin/echo $dropin
|
||||
" > /usr/lib/systemd/system/$dropin/override.conf
|
||||
" >/usr/lib/systemd/system/$dropin/override.conf
|
||||
systemctl daemon-reload
|
||||
check_ok a-b-c ExecCondition "/bin/echo $dropin"
|
||||
done
|
||||
|
@ -19,7 +19,7 @@ while : ; do
|
||||
sleep .5
|
||||
done
|
||||
|
||||
cat > /run/udev/rules.d/50-testsuite.rules <<EOF
|
||||
cat >/run/udev/rules.d/50-testsuite.rules <<EOF
|
||||
ACTION!="remove", SUBSYSTEM=="block", KERNEL=="sda", ENV{SYSTEMD_WANTS}="foobar.service"
|
||||
EOF
|
||||
udevadm control --reload
|
||||
@ -36,7 +36,7 @@ while : ; do
|
||||
sleep .5
|
||||
done
|
||||
|
||||
cat > /run/udev/rules.d/50-testsuite.rules <<EOF
|
||||
cat >/run/udev/rules.d/50-testsuite.rules <<EOF
|
||||
ACTION!="remove", SUBSYSTEM=="block", KERNEL=="sda", ENV{SYSTEMD_WANTS}="waldo.service"
|
||||
EOF
|
||||
udevadm control --reload
|
||||
|
@ -4,7 +4,7 @@ set -o pipefail
|
||||
|
||||
mkdir -p /run/udev/rules.d/
|
||||
|
||||
cat > /run/udev/rules.d/50-testsuite.rules <<EOF
|
||||
cat >/run/udev/rules.d/50-testsuite.rules <<EOF
|
||||
ACTION=="remove", GOTO="lo_end"
|
||||
|
||||
SUBSYSTEM=="net", KERNEL=="lo", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/net/devices/lo"
|
||||
|
@ -7,9 +7,9 @@ test_rule="/run/udev/rules.d/49-test.rules"
|
||||
setup() {
|
||||
mkdir -p "${test_rule%/*}"
|
||||
cp -f /etc/udev/udev.conf /etc/udev/udev.conf.bckp
|
||||
echo 'KERNEL=="lo", SUBSYSTEM=="net", PROGRAM=="/bin/sleep 60"' > "${test_rule}"
|
||||
echo "event_timeout=30" >> /etc/udev/udev.conf
|
||||
echo "timeout_signal=SIGABRT" >> /etc/udev/udev.conf
|
||||
echo 'KERNEL=="lo", SUBSYSTEM=="net", PROGRAM=="/bin/sleep 60"' >"${test_rule}"
|
||||
echo "event_timeout=30" >>/etc/udev/udev.conf
|
||||
echo "timeout_signal=SIGABRT" >>/etc/udev/udev.conf
|
||||
|
||||
systemctl restart systemd-udevd.service
|
||||
}
|
||||
@ -25,7 +25,7 @@ teardown() {
|
||||
run_test() {
|
||||
since="$(date +%T)"
|
||||
|
||||
echo add > /sys/class/net/lo/uevent
|
||||
echo add >/sys/class/net/lo/uevent
|
||||
|
||||
for n in {1..20}; do
|
||||
sleep 5
|
||||
|
@ -11,7 +11,7 @@ mkdir -p /run/udev/rules.d/
|
||||
udevadm info /dev/null | grep -q -v 'E: TAGS=.*:changed:.*' &&
|
||||
udevadm info /dev/null | grep -q -v 'E: CURRENT_TAGS=.*:changed:.*'
|
||||
|
||||
cat > /run/udev/rules.d/50-testsuite.rules <<EOF
|
||||
cat >/run/udev/rules.d/50-testsuite.rules <<EOF
|
||||
ACTION=="add", SUBSYSTEM=="mem", KERNEL=="null", TAG+="added"
|
||||
ACTION=="change", SUBSYSTEM=="mem", KERNEL=="null", TAG+="changed"
|
||||
EOF
|
||||
|
@ -4,7 +4,7 @@ set -o pipefail
|
||||
|
||||
mkdir -p /run/udev/rules.d/
|
||||
|
||||
cat > /run/udev/rules.d/50-testsuite.rules <<EOF
|
||||
cat >/run/udev/rules.d/50-testsuite.rules <<EOF
|
||||
SUBSYSTEM=="mem", KERNEL=="null", OPTIONS="log_level=debug"
|
||||
ACTION=="add", SUBSYSTEM=="mem", KERNEL=="null", IMPORT{program}="/bin/echo -e HOGE=aa\\\\x20\\\\x20\\\\x20bb\nFOO=\\\\x20aaa\\\\x20\n\n\n"
|
||||
EOF
|
||||
|
@ -6,10 +6,10 @@ systemd-run --wait -p FailureAction=poweroff true
|
||||
systemd-run --wait -p SuccessAction=poweroff false && { echo 'unexpected success'; exit 1; }
|
||||
|
||||
if ! test -f /firstphase ; then
|
||||
echo OK > /firstphase
|
||||
echo OK >/firstphase
|
||||
systemd-run --wait -p SuccessAction=reboot true
|
||||
else
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
systemd-run --wait -p FailureAction=poweroff false
|
||||
fi
|
||||
|
||||
|
@ -34,6 +34,6 @@ else
|
||||
echo "Skipping TEST-19-DELEGATE, as the kernel doesn't actually support cgroup v2" >&2
|
||||
fi
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -71,7 +71,7 @@ disown
|
||||
sleep infinity &
|
||||
disown
|
||||
|
||||
echo \$MAINPID > /run/mainpidsh/pid
|
||||
echo \$MAINPID >/run/mainpidsh/pid
|
||||
EOF
|
||||
chmod +x /tmp/test20-mainpid.sh
|
||||
|
||||
@ -95,7 +95,7 @@ disown
|
||||
sleep infinity &
|
||||
disown
|
||||
|
||||
echo \$MAINPID > /run/mainpidsh2/pid
|
||||
echo \$MAINPID >/run/mainpidsh2/pid
|
||||
chown 1001:1001 /run/mainpidsh2/pid
|
||||
EOF
|
||||
chmod +x /tmp/test20-mainpid2.sh
|
||||
@ -140,10 +140,10 @@ systemd-run --unit=test20-mainpidsh3.service \
|
||||
&& { echo 'unexpected success'; exit 1; }
|
||||
|
||||
# Test that this failed due to timeout, and not some other error
|
||||
test `systemctl show -P Result test20-mainpidsh3.service` = timeout
|
||||
test $(systemctl show -P Result test20-mainpidsh3.service) = timeout
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -29,6 +29,6 @@ systemctl stop seven.service
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -67,7 +67,7 @@ mkdir /var/tmp/scratch
|
||||
mv /var/tmp/testimage.raw /var/tmp/scratch/
|
||||
touch /var/tmp/scratch/anotherfile
|
||||
mkdir /var/tmp/scratch/adirectory
|
||||
echo "piep" > /var/tmp/scratch/adirectory/athirdfile
|
||||
echo "piep" >/var/tmp/scratch/adirectory/athirdfile
|
||||
|
||||
# Test import-fs
|
||||
machinectl import-fs /var/tmp/scratch/
|
||||
@ -138,6 +138,6 @@ machinectl remove scratch5
|
||||
test ! -f /var/lib/machines/scratch5
|
||||
machinectl image-status scratch5 && { echo 'unexpected success'; exit 1; }
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -26,6 +26,6 @@ systemctl show-environment | grep '^FOO=$' && exit 1
|
||||
systemctl show-environment | grep '^PATH=.*testaddition$' && exit 1
|
||||
systemctl show-environment | grep -q '^PATH='
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -93,6 +93,6 @@ umount /tmp/overlay
|
||||
umount /tmp/rootdir
|
||||
umount /tmp/app1
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -26,6 +26,6 @@ while test ! -f /tmp/clock-changed ; do sleep .5 ; done
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -6,5 +6,5 @@ if journalctl -b -t systemd --grep '\.device: Changed plugged -> dead'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
exit 0
|
||||
|
@ -4,7 +4,7 @@
|
||||
set -ex
|
||||
set -o pipefail
|
||||
|
||||
cat > /etc/systemd/system/testservice.service <<EOF
|
||||
cat >/etc/systemd/system/testservice.service <<EOF
|
||||
[Service]
|
||||
ConfigurationDirectory=testservice
|
||||
RuntimeDirectory=testservice
|
||||
@ -74,7 +74,7 @@ test ! -e /var/lib/testservice
|
||||
test ! -e /var/cache/testservice
|
||||
test ! -e /var/log/testservice
|
||||
|
||||
cat > /etc/systemd/system/testservice.service <<EOF
|
||||
cat >/etc/systemd/system/testservice.service <<EOF
|
||||
[Service]
|
||||
DynamicUser=yes
|
||||
ConfigurationDirectory=testservice
|
||||
@ -169,7 +169,7 @@ test ! -L /var/lib/testservice
|
||||
test ! -L /var/cache/testservice
|
||||
test ! -L /var/log/testservice
|
||||
|
||||
cat > /etc/systemd/system/tmp-hoge.mount <<EOF
|
||||
cat >/etc/systemd/system/tmp-hoge.mount <<EOF
|
||||
[Mount]
|
||||
What=tmpfs
|
||||
Type=tmpfs
|
||||
@ -244,7 +244,7 @@ test ! -d /var/lib/hoge
|
||||
test ! -d /var/cache/hoge
|
||||
test ! -d /var/log/hoge
|
||||
|
||||
cat > /etc/systemd/system/testservice.socket <<EOF
|
||||
cat >/etc/systemd/system/testservice.socket <<EOF
|
||||
[Socket]
|
||||
ListenSequentialPacket=/run/testservice.socket
|
||||
RemoveOnStop=yes
|
||||
@ -314,6 +314,6 @@ test ! -e /var/lib/testsocket
|
||||
test ! -e /var/cache/testsocket
|
||||
test ! -e /var/log/testsocket
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -44,6 +44,6 @@ test ! -f /var/lib/zzz/test-missing
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -55,7 +55,7 @@ stopJournalctl() {
|
||||
# the --sync wait until the synchronization is complete
|
||||
echo "Force journald to write all queued messages"
|
||||
journalctl --sync
|
||||
journalctl -u $unit --cursor-file="$journalCursorFile" > "$journalLog"
|
||||
journalctl -u $unit --cursor-file="$journalCursorFile" >"$journalLog"
|
||||
}
|
||||
|
||||
checkNUMA() {
|
||||
@ -64,21 +64,21 @@ checkNUMA() {
|
||||
}
|
||||
|
||||
writePID1NUMAPolicy() {
|
||||
echo [Manager] > $confDir/numa.conf
|
||||
echo NUMAPolicy=$1 >> $confDir/numa.conf
|
||||
echo NUMAMask=$2>> $confDir/numa.conf
|
||||
echo [Manager] >$confDir/numa.conf
|
||||
echo NUMAPolicy=$1 >>$confDir/numa.conf
|
||||
echo NUMAMask=$2 >>$confDir/numa.conf
|
||||
}
|
||||
|
||||
writeTestUnit() {
|
||||
mkdir -p $testUnitFile.d/
|
||||
echo [Service] > $testUnitFile
|
||||
echo ExecStart=/bin/sleep 3600 >> $testUnitFile
|
||||
echo [Service] >$testUnitFile
|
||||
echo ExecStart=/bin/sleep 3600 >>$testUnitFile
|
||||
}
|
||||
|
||||
writeTestUnitNUMAPolicy() {
|
||||
echo [Service] > $testUnitNUMAConf
|
||||
echo NUMAPolicy=$1 >> $testUnitNUMAConf
|
||||
echo NUMAMask=$2>> $testUnitNUMAConf
|
||||
echo [Service] >$testUnitNUMAConf
|
||||
echo NUMAPolicy=$1 >>$testUnitNUMAConf
|
||||
echo NUMAMask=$2 >>$testUnitNUMAConf
|
||||
systemctl daemon-reload
|
||||
}
|
||||
|
||||
@ -115,13 +115,13 @@ pid1StopUnit() {
|
||||
|
||||
systemctlCheckNUMAProperties() {
|
||||
local LOGFILE="$(mktemp)"
|
||||
systemctl show -p NUMAPolicy $1 > "$LOGFILE"
|
||||
systemctl show -p NUMAPolicy $1 >"$LOGFILE"
|
||||
grep "NUMAPolicy=$2" "$LOGFILE"
|
||||
|
||||
> "$LOGFILE"
|
||||
>"$LOGFILE"
|
||||
|
||||
if [ -n "$3" ]; then
|
||||
systemctl show -p NUMAMask $1 > "$LOGFILE"
|
||||
systemctl show -p NUMAMask $1 >"$LOGFILE"
|
||||
grep "NUMAMask=$3" "$LOGFILE"
|
||||
fi
|
||||
}
|
||||
@ -281,7 +281,7 @@ else
|
||||
|
||||
echo "Unit file CPUAffinity=NUMA support"
|
||||
writeTestUnitNUMAPolicy "bind" "0"
|
||||
echo "CPUAffinity=numa" >> $testUnitNUMAConf
|
||||
echo "CPUAffinity=numa" >>$testUnitNUMAConf
|
||||
systemctl daemon-reload
|
||||
systemctl start $testUnit
|
||||
systemctlCheckNUMAProperties $testUnit "bind" "0"
|
||||
@ -336,6 +336,6 @@ systemctl daemon-reload
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -14,6 +14,6 @@ systemctl restart tmp-aaa.mount
|
||||
test -e /run/hoge/foo
|
||||
test ! -e /tmp/aaa/bbb
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -245,7 +245,7 @@ test_preserve_state() {
|
||||
echo "Test that freezer state is preserved when recursive freezing is initiated from outside (e.g. by manager up the tree):"
|
||||
|
||||
echo -n " - freeze from outside: "
|
||||
echo 1 > /sys/fs/cgroup/"${slice}"/cgroup.freeze
|
||||
echo 1 >/sys/fs/cgroup/"${slice}"/cgroup.freeze
|
||||
# Give kernel some time to freeze the slice
|
||||
sleep 1
|
||||
|
||||
@ -259,7 +259,7 @@ test_preserve_state() {
|
||||
echo "[ OK ]"
|
||||
|
||||
echo -n " - thaw from outside: "
|
||||
echo 0 > /sys/fs/cgroup/"${slice}"/cgroup.freeze
|
||||
echo 0 >/sys/fs/cgroup/"${slice}"/cgroup.freeze
|
||||
sleep 1
|
||||
|
||||
check_freezer_state "${unit}" "running"
|
||||
@ -271,8 +271,8 @@ test_preserve_state() {
|
||||
echo -n " - thaw from outside while inner service is frozen: "
|
||||
systemctl freeze "$unit"
|
||||
check_freezer_state "${unit}" "frozen"
|
||||
echo 1 > /sys/fs/cgroup/"${slice}"/cgroup.freeze
|
||||
echo 0 > /sys/fs/cgroup/"${slice}"/cgroup.freeze
|
||||
echo 1 >/sys/fs/cgroup/"${slice}"/cgroup.freeze
|
||||
echo 0 >/sys/fs/cgroup/"${slice}"/cgroup.freeze
|
||||
check_freezer_state "${slice}" "running"
|
||||
check_freezer_state "${unit}" "frozen"
|
||||
echo "[ OK ]"
|
||||
@ -293,5 +293,5 @@ test -e /sys/fs/cgroup/system.slice/cgroup.freeze && {
|
||||
test_preserve_state
|
||||
}
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
exit 0
|
||||
|
@ -11,7 +11,7 @@ SERVICE_PATH="$(mktemp /etc/systemd/system/execreloadXXX.service)"
|
||||
SERVICE_NAME="${SERVICE_PATH##*/}"
|
||||
|
||||
echo "[#1] Failing ExecReload= should not kill the service"
|
||||
cat > "$SERVICE_PATH" << EOF
|
||||
cat >"$SERVICE_PATH" <<EOF
|
||||
[Service]
|
||||
ExecStart=/bin/sleep infinity
|
||||
ExecReload=/bin/false
|
||||
@ -27,7 +27,7 @@ systemctl stop $SERVICE_NAME
|
||||
|
||||
|
||||
echo "[#2] Failing ExecReload= should not kill the service (multiple ExecReload=)"
|
||||
cat > "$SERVICE_PATH" << EOF
|
||||
cat >"$SERVICE_PATH" <<EOF
|
||||
[Service]
|
||||
ExecStart=/bin/sleep infinity
|
||||
ExecReload=/bin/true
|
||||
@ -44,7 +44,7 @@ systemctl status $SERVICE_NAME
|
||||
systemctl stop $SERVICE_NAME
|
||||
|
||||
echo "[#3] Failing ExecReload=- should not affect reload's exit code"
|
||||
cat > "$SERVICE_PATH" << EOF
|
||||
cat >"$SERVICE_PATH" <<EOF
|
||||
[Service]
|
||||
ExecStart=/bin/sleep infinity
|
||||
ExecReload=-/bin/false
|
||||
@ -59,6 +59,6 @@ systemctl stop $SERVICE_NAME
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -41,6 +41,6 @@ done
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -51,6 +51,6 @@ fi
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -17,7 +17,7 @@ systemd-run --unit=exec2.service --wait -p StandardOutput=tty -p StandardError=t
|
||||
&& { echo 'unexpected success'; exit 1; }
|
||||
test -f /run/exec2
|
||||
|
||||
cat > /tmp/forking1.sh <<EOF
|
||||
cat >/tmp/forking1.sh <<EOF
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
@ -33,7 +33,7 @@ chmod +x /tmp/forking1.sh
|
||||
systemd-run --unit=forking1.service --wait -p StandardOutput=tty -p StandardError=tty -p Type=forking -p NotifyAccess=exec -p ExecStopPost='/bin/touch /run/forking1' /tmp/forking1.sh
|
||||
test -f /run/forking1
|
||||
|
||||
cat > /tmp/forking2.sh <<EOF
|
||||
cat >/tmp/forking2.sh <<EOF
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
@ -65,7 +65,7 @@ test -f /run/dbus1
|
||||
systemd-run --unit=dbus2.service --wait -p StandardOutput=tty -p StandardError=tty -p Type=dbus -p BusName=systemd.test.ExecStopPost -p ExecStopPost='/bin/touch /run/dbus2' true
|
||||
test -f /run/dbus2
|
||||
|
||||
cat > /tmp/notify1.sh <<EOF
|
||||
cat >/tmp/notify1.sh <<EOF
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
@ -90,6 +90,6 @@ test -f /run/idle2
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -63,6 +63,6 @@ runas testuser systemd-run --wait --user --unit=test-protect-home-yes \
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -6,14 +6,14 @@ systemd-analyze log-level debug
|
||||
systemd-run -p LogNamespace=foobar echo "hello world"
|
||||
|
||||
journalctl --namespace=foobar --sync
|
||||
journalctl --namespace=foobar > /tmp/hello-world
|
||||
journalctl > /tmp/no-hello-world
|
||||
journalctl --namespace=foobar >/tmp/hello-world
|
||||
journalctl >/tmp/no-hello-world
|
||||
|
||||
grep "hello world" /tmp/hello-world
|
||||
! grep "hello world" /tmp/no-hello-world
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -4,7 +4,7 @@ set -o pipefail
|
||||
|
||||
# Check if homectl is installed, and if it isn't bail out early instead of failing
|
||||
if ! test -x /usr/bin/homectl ; then
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -76,6 +76,6 @@ homectl remove test-user
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sleep infinity &
|
||||
echo $! > /leakedtestpid
|
||||
echo $! >/leakedtestpid
|
||||
wait $!
|
||||
|
@ -20,6 +20,6 @@ ps -p "$leaked_pid" && exit 42
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -3,7 +3,7 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
set -ex
|
||||
|
||||
cat > /run/systemd/system/testservice-48.target <<EOF
|
||||
cat >/run/systemd/system/testservice-48.target <<EOF
|
||||
[Unit]
|
||||
Wants=testservice-48.service
|
||||
EOF
|
||||
@ -23,7 +23,7 @@ systemctl start testservice-48.target
|
||||
# May 07 23:12:20 systemd-testsuite testsuite-48.sh[53]: ef53
|
||||
sleep 3.1
|
||||
|
||||
cat > /run/systemd/system/testservice-48.service <<EOF
|
||||
cat >/run/systemd/system/testservice-48.service <<EOF
|
||||
[Service]
|
||||
ExecStart=/bin/sleep infinity
|
||||
EOF
|
||||
@ -39,7 +39,7 @@ systemctl daemon-reload
|
||||
|
||||
sleep 3.1
|
||||
|
||||
cat > /run/systemd/system/testservice-48.service <<EOF
|
||||
cat >/run/systemd/system/testservice-48.service <<EOF
|
||||
[Service]
|
||||
ExecStart=/bin/sleep infinity
|
||||
EOF
|
||||
@ -61,7 +61,7 @@ systemctl daemon-reload
|
||||
|
||||
sleep 3.1
|
||||
|
||||
cat > /run/systemd/system/testservice-48.target <<EOF
|
||||
cat >/run/systemd/system/testservice-48.target <<EOF
|
||||
[Unit]
|
||||
Conflicts=shutdown.target
|
||||
Wants=testservice-48.service
|
||||
@ -71,7 +71,7 @@ systemctl daemon-reload
|
||||
|
||||
systemctl start testservice-48.target
|
||||
|
||||
cat > /run/systemd/system/testservice-48.service <<EOF
|
||||
cat >/run/systemd/system/testservice-48.service <<EOF
|
||||
[Service]
|
||||
ExecStart=/bin/sleep infinity
|
||||
EOF
|
||||
@ -80,6 +80,6 @@ systemctl restart testservice-48.target
|
||||
|
||||
systemctl is-active testservice-48.service
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
echo "MARKER_FIXED" > /run/testservice-49-fixed
|
||||
echo "MARKER_FIXED" >/run/testservice-49-fixed
|
||||
mkdir -p /run/inaccessible
|
||||
|
||||
systemctl start testsuite-49-namespaced.service
|
||||
@ -11,7 +11,7 @@ set +e
|
||||
systemctl bind --mkdir testsuite-49-namespaced.service /run/testservice-49-fixed /run/inaccessible/testfile_fixed && exit 1
|
||||
set -e
|
||||
|
||||
echo "MARKER_RUNTIME" > /run/testservice-49-runtime
|
||||
echo "MARKER_RUNTIME" >/run/testservice-49-runtime
|
||||
|
||||
systemctl bind --mkdir testsuite-49-namespaced.service /run/testservice-49-runtime /tmp/testfile_runtime
|
||||
|
||||
@ -38,6 +38,6 @@ set +e
|
||||
systemctl is-active testsuite-49-non-namespaced.service && exit 1
|
||||
set -e
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -207,7 +207,7 @@ grep -F "squashfs" ${image_dir}/result/c | grep -q -F -v "nosuid"
|
||||
|
||||
# Adding a new mounts at runtime works if the unit is in the active state,
|
||||
# so use Type=notify to make sure there's no race condition in the test
|
||||
cat > /run/systemd/system/testservice-50d.service <<EOF
|
||||
cat >/run/systemd/system/testservice-50d.service <<EOF
|
||||
[Service]
|
||||
RuntimeMaxSec=300
|
||||
Type=notify
|
||||
|
@ -10,7 +10,7 @@ systemd-run -p LoadCredential=passwd:/etc/passwd \
|
||||
-p DynamicUser=1 \
|
||||
--wait \
|
||||
--pipe \
|
||||
cat '${CREDENTIALS_DIRECTORY}/passwd' '${CREDENTIALS_DIRECTORY}/shadow' '${CREDENTIALS_DIRECTORY}/dog' > /tmp/ts54-concat
|
||||
cat '${CREDENTIALS_DIRECTORY}/passwd' '${CREDENTIALS_DIRECTORY}/shadow' '${CREDENTIALS_DIRECTORY}/dog' >/tmp/ts54-concat
|
||||
( cat /etc/passwd /etc/shadow && echo -n wuff ) | cmp /tmp/ts54-concat
|
||||
rm /tmp/ts54-concat
|
||||
|
||||
@ -28,6 +28,6 @@ systemd-run -p LoadCredential=passwd:/etc/passwd \
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -6,19 +6,19 @@ systemd-analyze log-level debug
|
||||
systemd-analyze log-target console
|
||||
|
||||
# Loose checks to ensure the environment has the necessary features for systemd-oomd
|
||||
[[ -e /proc/pressure ]] || echo "no PSI" >> /skipped
|
||||
[[ -e /proc/pressure ]] || echo "no PSI" >>/skipped
|
||||
cgroup_type=$(stat -fc %T /sys/fs/cgroup/)
|
||||
if [[ "$cgroup_type" != *"cgroup2"* ]] && [[ "$cgroup_type" != *"0x63677270"* ]]; then
|
||||
echo "no cgroup2" >> /skipped
|
||||
echo "no cgroup2" >>/skipped
|
||||
fi
|
||||
if [ ! -f /usr/lib/systemd/systemd-oomd ] && [ ! -f /lib/systemd/systemd-oomd ]; then
|
||||
echo "no oomd" >> /skipped
|
||||
echo "no oomd" >>/skipped
|
||||
fi
|
||||
[[ -e /skipped ]] && exit 0 || true
|
||||
|
||||
rm -rf /etc/systemd/system/testsuite-55-testbloat.service.d
|
||||
|
||||
echo "DefaultMemoryPressureDurationSec=5s" >> /etc/systemd/oomd.conf
|
||||
echo "DefaultMemoryPressureDurationSec=5s" >>/etc/systemd/oomd.conf
|
||||
|
||||
systemctl start testsuite-55-testchill.service
|
||||
systemctl start testsuite-55-testbloat.service
|
||||
@ -47,8 +47,8 @@ if setfattr -n user.xattr_test -v 1 /sys/fs/cgroup/; then
|
||||
sleep 120 # wait for systemd-oomd kill cool down and elevated memory pressure to come down
|
||||
|
||||
mkdir -p /etc/systemd/system/testsuite-55-testbloat.service.d/
|
||||
echo "[Service]" > /etc/systemd/system/testsuite-55-testbloat.service.d/override.conf
|
||||
echo "ManagedOOMPreference=avoid" >> /etc/systemd/system/testsuite-55-testbloat.service.d/override.conf
|
||||
echo "[Service]" >/etc/systemd/system/testsuite-55-testbloat.service.d/override.conf
|
||||
echo "ManagedOOMPreference=avoid" >>/etc/systemd/system/testsuite-55-testbloat.service.d/override.conf
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl start testsuite-55-testchill.service
|
||||
@ -71,6 +71,6 @@ fi
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
@ -93,6 +93,6 @@ systemd-run --wait --unit=eight -p ExitType=cgroup /tmp/test56-exit-cgroup-uncle
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK > /testok
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user