diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-10-07 01:53:51 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 01:53:51 +0900 |
commit | d489317f5951850e91682b05ca7c96c5c3bc3f4d (patch) | |
tree | e2dce6b1ff33be1fbf0291832fbdfef7af8bb364 /test | |
parent | 9a1ddc8dee1be2623cdd3736f4f951938e588e3d (diff) | |
parent | 8688a389cabdff61efe187bb85cc1776de03c460 (diff) | |
download | systemd-d489317f5951850e91682b05ca7c96c5c3bc3f4d.tar.gz |
Merge pull request #20935 from unusual-thoughts/fix-empty-argv
Fix #20933
Diffstat (limited to 'test')
-rwxr-xr-x | test/units/testsuite-23.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/units/testsuite-23.sh b/test/units/testsuite-23.sh index 4ef7c878a8..5488447a87 100755 --- a/test/units/testsuite-23.sh +++ b/test/units/testsuite-23.sh @@ -27,6 +27,37 @@ test "$(systemctl show --value -p RestartKillSignal seven.service)" -eq 2 systemctl restart seven.service systemctl stop seven.service +# For issue #20933 + +# Should work normally +busctl call \ + org.freedesktop.systemd1 /org/freedesktop/systemd1 \ + org.freedesktop.systemd1.Manager StartTransientUnit \ + "ssa(sv)a(sa(sv))" test-20933-ok.service replace 1 \ + ExecStart "a(sasb)" 1 \ + /usr/bin/sleep 2 /usr/bin/sleep 1 true \ + 0 + +# DBus call should fail but not crash systemd +busctl call \ + org.freedesktop.systemd1 /org/freedesktop/systemd1 \ + org.freedesktop.systemd1.Manager StartTransientUnit \ + "ssa(sv)a(sa(sv))" test-20933-bad.service replace 1 \ + ExecStart "a(sasb)" 1 \ + /usr/bin/sleep 0 true \ + 0 && { echo 'unexpected success'; exit 1; } + +# Same but with the empty argv in the middle +busctl call \ + org.freedesktop.systemd1 /org/freedesktop/systemd1 \ + org.freedesktop.systemd1.Manager StartTransientUnit \ + "ssa(sv)a(sa(sv))" test-20933-bad-middle.service replace 1 \ + ExecStart "a(sasb)" 3 \ + /usr/bin/sleep 2 /usr/bin/sleep 1 true \ + /usr/bin/sleep 0 true \ + /usr/bin/sleep 2 /usr/bin/sleep 1 true \ + 0 && { echo 'unexpected success'; exit 1; } + systemd-analyze log-level info echo OK >/testok |