summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2023-11-25 20:22:24 +0100
committerFrantisek Sumsal <frantisek@sumsal.cz>2023-11-25 20:22:24 +0100
commit60f9c49b16b087d2d7d419ef3a9972a2193f794f (patch)
tree5a397987d2cc19332ecde39b8d8baa112c53084c /test
parentMerge pull request #30196 from YHNdnzj/fchmodat2-no-symlink (diff)
downloadsystemd-60f9c49b16b087d2d7d419ef3a9972a2193f794f.tar.xz
systemd-60f9c49b16b087d2d7d419ef3a9972a2193f794f.zip
test: remove the reboot counter just before spawning container/VM
Doing that in test_run() is not enough, since it's called only once and spawns all QEMU/nspawn jobs.
Diffstat (limited to 'test')
-rw-r--r--test/test-functions7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test-functions b/test/test-functions
index e2d3f109a2..b054892e17 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -472,6 +472,8 @@ run_qemu() {
local CONSOLE=ttyS0
+ # Reset the boot counter, if present
+ rm -f "${initdir:?}/var/tmp/.systemd_reboot_count"
rm -f "$initdir"/{testok,failed,skipped}
# make sure the initdir is not mounted to avoid concurrent access
cleanup_initdir
@@ -645,6 +647,8 @@ run_qemu() {
# success), or 1 if nspawn is not available.
run_nspawn() {
[[ -d /run/systemd/system ]] || return 1
+ # Reset the boot counter, if present
+ rm -f "${initdir:?}/var/tmp/.systemd_reboot_count"
rm -f "${initdir:?}"/{testok,failed,skipped}
local nspawn_cmd=()
@@ -3356,9 +3360,6 @@ test_run() {
local test_id="${1:?}"
mount_initdir
- # Reset the boot counter, if present
- rm -f "${initdir:?}/var/tmp/.systemd_reboot_count"
-
if ! get_bool "${TEST_NO_QEMU:=}"; then
if run_qemu "$test_id"; then
check_result_qemu || { echo "qemu test failed"; return 1; }