]>
Commit | Line | Data |
---|---|---|
0e1f1756 | 1 | #!/bin/bash |
0e1f1756 LP |
2 | set -ex |
3 | set -o pipefail | |
4 | ||
6c34ed51 ZJS |
5 | systemd-analyze log-level debug |
6 | systemd-analyze log-target console | |
0e1f1756 LP |
7 | |
8 | # Create a binary for which execve() will fail | |
9 | touch /tmp/brokenbinary | |
10 | chmod +x /tmp/brokenbinary | |
11 | ||
12 | # These three commands should succeed. | |
13 | systemd-run --unit=one -p Type=simple /bin/sleep infinity | |
14 | systemd-run --unit=two -p Type=simple -p User=idontexist /bin/sleep infinity | |
15 | systemd-run --unit=three -p Type=simple /tmp/brokenbinary | |
16 | ||
17 | # And now, do the same with Type=exec, where the latter two should fail | |
18 | systemd-run --unit=four -p Type=exec /bin/sleep infinity | |
19 | ! systemd-run --unit=five -p Type=exec -p User=idontexist /bin/sleep infinity | |
20 | ! systemd-run --unit=six -p Type=exec /tmp/brokenbinary | |
21 | ||
6c34ed51 | 22 | systemd-analyze log-level info |
0e1f1756 LP |
23 | |
24 | echo OK > /testok | |
25 | ||
26 | exit 0 |