mirror of
https://github.com/systemd/systemd.git
synced 2025-03-28 02:50:16 +03:00
test: unify /testok & /failed handling
And drop it where not necessary.
This commit is contained in:
parent
74711e7a09
commit
07268394d6
@ -45,4 +45,4 @@ systemctl daemon-reload
|
||||
# of systemd-analyze blame. See issue #27187.
|
||||
systemd-analyze blame
|
||||
|
||||
echo OK >/testok
|
||||
touch /testok
|
||||
|
@ -113,3 +113,4 @@ set -x
|
||||
journalctl --sync
|
||||
|
||||
test ! -s /failed
|
||||
touch /testok
|
||||
|
@ -9,9 +9,6 @@ trap "journalctl --rotate --vacuum-size=16M" EXIT
|
||||
# shellcheck source=test/units/test-control.sh
|
||||
. "$(dirname "$0")"/test-control.sh
|
||||
|
||||
: >/failed
|
||||
|
||||
run_subtests
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -6,8 +6,6 @@ set -o pipefail
|
||||
# shellcheck source=test/units/test-control.sh
|
||||
. "$(dirname "$0")"/test-control.sh
|
||||
|
||||
: >/failed
|
||||
|
||||
# Issue: https://github.com/systemd/systemd/issues/2730
|
||||
# See TEST-07-PID1/test.sh for the first "half" of the test
|
||||
mountpoint /issue2730
|
||||
@ -15,4 +13,3 @@ mountpoint /issue2730
|
||||
run_subtests
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -6,9 +6,6 @@ set -o pipefail
|
||||
# shellcheck source=test/units/test-control.sh
|
||||
. "$(dirname "$0")"/test-control.sh
|
||||
|
||||
: >/failed
|
||||
|
||||
run_subtests
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -117,4 +117,3 @@ if [[ -f "$TESTLOG" ]]; then
|
||||
fi
|
||||
|
||||
touch /testok
|
||||
exit 0
|
||||
|
@ -6,11 +6,8 @@ set -o pipefail
|
||||
# shellcheck source=test/units/test-control.sh
|
||||
. "$(dirname "$0")"/test-control.sh
|
||||
|
||||
: >/failed
|
||||
|
||||
udevadm settle
|
||||
|
||||
run_subtests
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -3,12 +3,9 @@
|
||||
set -eux
|
||||
set -o pipefail
|
||||
|
||||
: >/failed
|
||||
|
||||
# shellcheck source=test/units/test-control.sh
|
||||
. "$(dirname "$0")"/test-control.sh
|
||||
|
||||
run_subtests
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -107,6 +107,4 @@ for bus in "${SESSION_BUS_LIST[@]}"; do
|
||||
systemctl --machine 'testuser@.host' --user daemon-reexec
|
||||
done
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -6,9 +6,6 @@ set -o pipefail
|
||||
# shellcheck source=test/units/test-control.sh
|
||||
. "$(dirname "$0")"/test-control.sh
|
||||
|
||||
: >/failed
|
||||
|
||||
run_subtests
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -3,8 +3,6 @@
|
||||
set -eux
|
||||
set -o pipefail
|
||||
|
||||
: >/failed
|
||||
|
||||
# shellcheck source=test/units/test-control.sh
|
||||
. "$(dirname "$0")"/test-control.sh
|
||||
|
||||
@ -12,4 +10,3 @@ set -o pipefail
|
||||
run_subtests_with_signals SIGUSR1 SIGUSR2 SIGRTMIN+1
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -213,4 +213,4 @@ cryptsetup_start_and_check -f detached_fail{0..4}
|
||||
cryptsetup_start_and_check detached_slot{0..1}
|
||||
cryptsetup_start_and_check -f detached_slot_fail
|
||||
|
||||
echo OK >/testok
|
||||
touch /testok
|
||||
|
@ -140,6 +140,4 @@ machinectl remove scratch5
|
||||
test ! -f /var/lib/machines/scratch5
|
||||
(! machinectl image-status scratch5)
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -7,8 +7,6 @@ set -o pipefail
|
||||
# shellcheck source=test/units/util.sh
|
||||
. "$(dirname "$0")"/util.sh
|
||||
|
||||
: >/failed
|
||||
|
||||
at_exit() {
|
||||
if [[ -v UNIT_NAME && -e "/usr/lib/systemd/system/$UNIT_NAME" ]]; then
|
||||
rm -fvr "/usr/lib/systemd/system/$UNIT_NAME" "/etc/systemd/system/$UNIT_NAME.d" "+4"
|
||||
@ -463,4 +461,3 @@ systemctl enable --now test-WantedBy.service || :
|
||||
systemctl daemon-reload
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -231,6 +231,4 @@ touch /tmp/emptyext/usr/lib/extension-release.d/extension-release.emptyext
|
||||
res="$(! portablectl attach --extension /tmp/emptyext /tmp/emptyroot 2> >(grep "Remote peer disconnected"))"
|
||||
test -z "${res}"
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -26,6 +26,4 @@ while test ! -f /tmp/clock-changed ; do sleep .5 ; done
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -7,5 +7,4 @@ if journalctl -b -t systemd --grep '\.device: Changed plugged -> dead'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo OK >/testok
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -33,6 +33,4 @@ if test -f /sys/fs/cgroup/system.slice/testsuite-32.service/memory.oom.group; th
|
||||
systemd-analyze log-level info
|
||||
fi
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -157,6 +157,4 @@ test_check_writable
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -653,11 +653,8 @@ EOF
|
||||
rm -f "$SCRIPT" "$PAMSERVICE"
|
||||
}
|
||||
|
||||
: >/failed
|
||||
|
||||
setup_test_user
|
||||
test_enable_debug
|
||||
run_testcases
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -349,6 +349,4 @@ systemctl daemon-reload
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -298,5 +298,4 @@ if [[ -e /sys/fs/cgroup/system.slice/cgroup.freeze ]]; then
|
||||
run_testcases
|
||||
fi
|
||||
|
||||
echo OK >/testok
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -135,6 +135,4 @@ fi
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -15,6 +15,4 @@ grep "^hello world$" /tmp/hello-world
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -277,9 +277,6 @@ EOF
|
||||
assert_rc 3 systemctl is-active --quiet systemd-timesyncd
|
||||
}
|
||||
|
||||
: >/failed
|
||||
|
||||
run_testcases
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -308,6 +308,4 @@ done
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -551,6 +551,4 @@ echo abc > abc
|
||||
systemd-dissect --copy-to /tmp/img abc /abc
|
||||
test -f /tmp/img/abc
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -8,6 +8,4 @@ systemd-analyze log-level debug
|
||||
systemctl enable test-honor-first-shutdown.service
|
||||
systemctl start test-honor-first-shutdown.service
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -316,6 +316,4 @@ fi
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -174,6 +174,4 @@ fi
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -1183,6 +1183,4 @@ test_sector 1024
|
||||
test_sector 2048
|
||||
test_sector 4096
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -157,6 +157,4 @@ rm /run/notify-reload-test.sh
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -241,8 +241,6 @@ EOF
|
||||
done
|
||||
}
|
||||
|
||||
: >/failed
|
||||
|
||||
systemd-analyze log-level debug
|
||||
systemd-analyze log-target journal
|
||||
|
||||
@ -308,4 +306,3 @@ test_issue_23796
|
||||
systemd-analyze log-level info
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -60,6 +60,4 @@ systemctl start --wait testsuite-62-3.service
|
||||
systemctl start --wait testsuite-62-4.service
|
||||
systemctl start --wait testsuite-62-5.service
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -82,4 +82,4 @@ assert_in "test63-issue-24577-dep.service" "$output"
|
||||
|
||||
systemctl log-level info
|
||||
|
||||
echo OK >/testok
|
||||
touch /testok
|
||||
|
@ -1159,8 +1159,6 @@ testcase_mdadm_lvm() {
|
||||
helper_check_device_units
|
||||
}
|
||||
|
||||
: >/failed
|
||||
|
||||
udevadm settle
|
||||
udevadm control --log-level debug
|
||||
lsblk -a
|
||||
@ -1187,4 +1185,3 @@ udevadm control --log-level info
|
||||
systemctl status systemd-udevd
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -845,6 +845,4 @@ systemd-analyze pcrs 14 7 0 ima
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -21,6 +21,4 @@ grep -q "thisshouldnotbehere" "$RESULTS_FILE" && exit 42
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -116,4 +116,4 @@ do
|
||||
separate_data=0
|
||||
done
|
||||
|
||||
echo OK >/testok
|
||||
touch /testok
|
||||
|
@ -212,6 +212,5 @@ systemctl start testservice-failure-68-template.service
|
||||
wait_on_state_or_fail "testservice-failure-exit-handler-68-template@testservice-failure-68-template.service.service" "inactive" "10"
|
||||
|
||||
systemd-analyze log-level info
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -316,6 +316,4 @@ systemd-cryptenroll --tpm2-pcrs=boot-loader-code+boot-loader-config "$img"
|
||||
(! systemd-cryptenroll --wipe-slot=10240000 "$img")
|
||||
(! systemd-cryptenroll --fido2-device=auto --unlock-fido2-device=auto "$img")
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -223,9 +223,6 @@ testcase_nss-myhostname() {
|
||||
(! getent hosts -s myhostname fd00:dead:beef:cafe::1)
|
||||
}
|
||||
|
||||
: >/failed
|
||||
|
||||
run_testcases
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -202,6 +202,4 @@ verify_version v4 2048 4096
|
||||
rm /var/tmp/72-joined.raw
|
||||
rm -r /var/tmp/72-{dirs,defs,source,xbootldr,esp}
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -682,8 +682,6 @@ testcase_locale_gen_leading_space() {
|
||||
localectl set-locale en_US.UTF-8
|
||||
}
|
||||
|
||||
: >/failed
|
||||
|
||||
# Make sure the content of kbd-model-map is the one that the tests expect
|
||||
# regardless of the version installed on the distro where the testsuite is
|
||||
# running on.
|
||||
@ -693,4 +691,3 @@ enable_debug
|
||||
run_testcases
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -6,9 +6,6 @@ set -o pipefail
|
||||
# shellcheck source=test/units/test-control.sh
|
||||
. "$(dirname "$0")"/test-control.sh
|
||||
|
||||
: >/failed
|
||||
|
||||
run_subtests
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -14,8 +14,6 @@ set -o pipefail
|
||||
# shellcheck source=test/units/util.sh
|
||||
. "$(dirname "$0")"/util.sh
|
||||
|
||||
: >/failed
|
||||
|
||||
RUN_OUT="$(mktemp)"
|
||||
|
||||
run() {
|
||||
@ -580,4 +578,3 @@ else
|
||||
fi
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -31,6 +31,5 @@ test "$(grep SigQ: /proc/"$P"/status | cut -d: -f2 | cut -d/ -f1)" -eq 6
|
||||
systemctl stop $UNIT
|
||||
|
||||
systemd-analyze log-level info
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -54,6 +54,5 @@ systemd-run -u "$UNIT" -p Type=exec -p ProtectControlGroups=1 -p DynamicUser=1 -
|
||||
rm "$SCRIPT"
|
||||
|
||||
systemd-analyze log-level info
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
touch /testok
|
||||
|
@ -7,8 +7,6 @@ set -o pipefail
|
||||
# shellcheck source=test/units/util.sh
|
||||
. "$(dirname "$0")"/util.sh
|
||||
|
||||
: >/failed
|
||||
|
||||
mkfifo /tmp/syncfifo1 /tmp/syncfifo2
|
||||
|
||||
sync_in() {
|
||||
@ -126,6 +124,3 @@ assert_eq "$(systemctl show fdstore-pin.service -P SubState)" dead
|
||||
assert_eq "$(systemctl show fdstore-nopin.service -P SubState)" dead
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
||||
exit 0
|
||||
|
@ -6,9 +6,6 @@ set -o pipefail
|
||||
# shellcheck source=test/units/test-control.sh
|
||||
. "$(dirname "$0")"/test-control.sh
|
||||
|
||||
: >/failed
|
||||
|
||||
run_subtests
|
||||
|
||||
touch /testok
|
||||
rm /failed
|
||||
|
@ -140,8 +140,6 @@ EOF
|
||||
fi
|
||||
|
||||
systemd-analyze log-level info
|
||||
echo OK >/testok
|
||||
|
||||
touch /testok
|
||||
systemctl --no-block poweroff
|
||||
|
||||
exit 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user