]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-22-TMPFILES/test-04.sh
test: make sure our tests get exclusive TTY access
[thirdparty/systemd.git] / test / TEST-22-TMPFILES / test-04.sh
CommitLineData
9f36a8fb
FB
1#! /bin/bash
2#
3# Basic tests for types creating fifos
4#
5
6set -e
7set -x
8
9rm -fr /tmp/p
10mkdir /tmp/p
11touch /tmp/p/f1
12
13systemd-tmpfiles --create - <<EOF
14p /tmp/p/fifo1 0666 - - - -
15EOF
16
17test -p /tmp/p/fifo1
18test $(stat -c %U:%G:%a /tmp/p/fifo1) = "root:root:666"
19
20# it should refuse to overwrite an existing file
21! systemd-tmpfiles --create - <<EOF
22p /tmp/p/f1 0666 - - - -
23EOF
24
25test -f /tmp/p/f1
26
27# unless '+' prefix is used
28systemd-tmpfiles --create - <<EOF
29p+ /tmp/p/f1 0666 - - - -
30EOF
31
32test -p /tmp/p/f1
33test $(stat -c %U:%G:%a /tmp/p/f1) = "root:root:666"
34
35#
36# Must be fixed
37#
721474fe
LP
38# mkdir /tmp/p/daemon
39# #ln -s /root /tmp/F/daemon/unsafe-symlink
40# chown -R --no-dereference daemon:daemon /tmp/p/daemon
9f36a8fb
FB
41#
42# systemd-tmpfiles --create - <<EOF
721474fe 43# p /tmp/p/daemon/fifo2 0666 daemon daemon - -
9f36a8fb 44# EOF