From: Frantisek Sumsal Date: Sat, 23 Sep 2023 16:52:03 +0000 (+0200) Subject: test: check soft-reboot behavior wrt argv[0][0] == '@' X-Git-Tag: v255-rc1~396^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d37b9154a78ccc31089345a7ed6256ed6e0e67b8;p=thirdparty%2Fsystemd.git test: check soft-reboot behavior wrt argv[0][0] == '@' --- diff --git a/test/units/testsuite-82.sh b/test/units/testsuite-82.sh index 24bd976b873..b6b6615997a 100755 --- a/test/units/testsuite-82.sh +++ b/test/units/testsuite-82.sh @@ -20,8 +20,10 @@ if [ -f /run/testsuite82.touch3 ]; then read -r x <&5 test "$x" = "oinkoink" - # Check that the surviving service is still around + # Check that the surviving services are still around test "$(systemctl show -P ActiveState testsuite-82-survive.service)" = "active" + test "$(systemctl show -P ActiveState testsuite-82-survive-argv.service)" = "active" + test "$(systemctl show -P ActiveState testsuite-82-nosurvive-sigterm.service)" != "active" test "$(systemctl show -P ActiveState testsuite-82-nosurvive.service)" != "active" # All succeeded, exit cleanly now @@ -43,8 +45,10 @@ elif [ -f /run/testsuite82.touch2 ]; then systemd-notify --fd=3 --pid=parent 3<"$T" rm "$T" - # Check that the surviving service is still around + # Check that the surviving services are still around test "$(systemctl show -P ActiveState testsuite-82-survive.service)" = "active" + test "$(systemctl show -P ActiveState testsuite-82-survive-argv.service)" = "active" + test "$(systemctl show -P ActiveState testsuite-82-nosurvive-sigterm.service)" != "active" test "$(systemctl show -P ActiveState testsuite-82-nosurvive.service)" != "active" # Test that we really are in the new overlayfs root fs @@ -88,8 +92,10 @@ elif [ -f /run/testsuite82.touch ]; then systemd-notify --fd=3 --pid=parent 3<"$T" rm "$T" - # Check that the surviving service is still around + # Check that the surviving services are still around test "$(systemctl show -P ActiveState testsuite-82-survive.service)" = "active" + test "$(systemctl show -P ActiveState testsuite-82-survive-argv.service)" = "active" + test "$(systemctl show -P ActiveState testsuite-82-nosurvive-sigterm.service)" != "active" test "$(systemctl show -P ActiveState testsuite-82-nosurvive.service)" != "active" # This time we test the /run/nextroot/ root switching logic. (We synthesize a new rootfs from the old via overlayfs) @@ -129,8 +135,41 @@ else systemd-notify --fd=3 --pid=parent 3<"$T" rm "$T" - # Configure this transient unit to survive the soft reboot - it will not conflict with shutdown.target - # and it will be ignored on the isolate that happens in the next boot. + survive_sigterm="/dev/shm/survive-sigterm-$RANDOM.sh" + cat >"$survive_sigterm" <"$survive_argv" <