]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/units/testsuite-22.04.sh
Merge pull request #18863 from keszybz/cmdline-escaping
[thirdparty/systemd.git] / test / units / testsuite-22.04.sh
1 #!/bin/bash
2 #
3 # Basic tests for types creating fifos
4 #
5
6 set -eux
7 set -o pipefail
8
9 rm -fr /tmp/p
10 mkdir /tmp/p
11 touch /tmp/p/f1
12
13 systemd-tmpfiles --create - <<EOF
14 p /tmp/p/fifo1 0666 - - - -
15 EOF
16
17 test -p /tmp/p/fifo1
18 test "$(stat -c %U:%G:%a /tmp/p/fifo1)" = "root:root:666"
19
20 # Refuse to overwrite an existing file. Error is not propagated.
21 systemd-tmpfiles --create - <<EOF
22 p /tmp/p/f1 0666 - - - -
23 EOF
24
25 test -f /tmp/p/f1
26
27 # unless '+' prefix is used
28 systemd-tmpfiles --create - <<EOF
29 p+ /tmp/p/f1 0666 - - - -
30 EOF
31
32 test -p /tmp/p/f1
33 test "$(stat -c %U:%G:%a /tmp/p/f1)" = "root:root:666"
34
35 #
36 # Must be fixed
37 #
38 # mkdir /tmp/p/daemon
39 # #ln -s /root /tmp/F/daemon/unsafe-symlink
40 # chown -R --no-dereference daemon:daemon /tmp/p/daemon
41 #
42 # systemd-tmpfiles --create - <<EOF
43 # p /tmp/p/daemon/fifo2 0666 daemon daemon - -
44 # EOF