]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: use --service-type= instead of -p Type=
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 3 Oct 2023 14:38:35 +0000 (16:38 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 3 Oct 2023 14:38:35 +0000 (16:38 +0200)
test/units/testsuite-82.sh

index fec29eef1275079e76eda5ad14888f23254addae..b57350c79b9379cb0397f78f21f11e66050ae587 100755 (executable)
@@ -75,7 +75,7 @@ elif [ -f /run/testsuite82.touch2 ]; then
     mount
 
     # Restart the unit that is not supposed to survive
-    systemd-run -p Type=exec --unit=testsuite-82-nosurvive.service sleep infinity
+    systemd-run --service-type=exec --unit=testsuite-82-nosurvive.service sleep infinity
 
     # Now issue the soft reboot. We should be right back soon.
     touch /run/testsuite82.touch3
@@ -131,7 +131,7 @@ elif [ -f /run/testsuite82.touch ]; then
     mount --bind / /run/nextroot/original-root
 
     # Restart the unit that is not supposed to survive
-    systemd-run -p Type=exec --unit=testsuite-82-nosurvive.service sleep infinity
+    systemd-run --service-type=exec --unit=testsuite-82-nosurvive.service sleep infinity
 
     # Now issue the soft reboot. We should be right back soon.
     touch /run/testsuite82.touch2
@@ -170,13 +170,13 @@ EOF
     # This sets DefaultDependencies=no so that they remain running until the very end, and
     # IgnoreOnIsolate=yes so that they aren't stopped via the "testsuite.target" isolation we do on next boot,
     # and will be killed by the final sigterm/sigkill spree.
-    systemd-run -p Type=notify -p DefaultDependencies=no -p IgnoreOnIsolate=yes --unit=testsuite-82-nosurvive-sigterm.service "$survive_sigterm"
-    systemd-run -p Type=exec -p DefaultDependencies=no -p IgnoreOnIsolate=yes --unit=testsuite-82-nosurvive.service sleep infinity
+    systemd-run --service-type=notify -p DefaultDependencies=no -p IgnoreOnIsolate=yes --unit=testsuite-82-nosurvive-sigterm.service "$survive_sigterm"
+    systemd-run --service-type=exec -p DefaultDependencies=no -p IgnoreOnIsolate=yes --unit=testsuite-82-nosurvive.service sleep infinity
 
     # Configure these transient units to survive the soft reboot - they will not conflict with shutdown.target
     # and it will be ignored on the isolate that happens in the next boot. The first will use argv[0][0] =
     # '@', and the second will use SurviveFinalKillSignal=yes. Both should survive.
-    systemd-run -p Type=notify --unit=testsuite-82-survive-argv.service \
+    systemd-run --service-type=notify --unit=testsuite-82-survive-argv.service \
         --property SurviveFinalKillSignal=no \
         --property IgnoreOnIsolate=yes \
         --property DefaultDependencies=no \
@@ -184,7 +184,7 @@ EOF
         --property "Conflicts=reboot.target kexec.target poweroff.target halt.target emergency.target rescue.target" \
         --property "Before=reboot.target kexec.target poweroff.target halt.target emergency.target rescue.target" \
          "$survive_argv"
-    systemd-run -p Type=exec --unit=testsuite-82-survive.service \
+    systemd-run --service-type=exec --unit=testsuite-82-survive.service \
         --property SurviveFinalKillSignal=yes \
         --property IgnoreOnIsolate=yes \
         --property DefaultDependencies=no \
@@ -195,9 +195,9 @@ EOF
 
     # Check that we can set up an inhibitor, and that busctl monitor sees the
     # PrepareForShutdownWithMetadata signal and that it says 'soft-reboot'.
-    systemd-run --unit busctl.service -p Type=exec --property StandardOutput=file:/run/testsuite82.signal \
+    systemd-run --unit busctl.service --service-type=exec --property StandardOutput=file:/run/testsuite82.signal \
         busctl monitor --json=pretty --match 'sender=org.freedesktop.login1,path=/org/freedesktop/login1,interface=org.freedesktop.login1.Manager,member=PrepareForShutdownWithMetadata,type=signal'
-    systemd-run --unit inhibit.service -p Type=exec \
+    systemd-run --unit inhibit.service --service-type=exec \
         systemd-inhibit --what=shutdown --who=test --why=test --mode=delay \
             sleep infinity