hwdb: fix screen rotation for EXO Wings 2in1 w1125 (#36283)
[systemd.io.git] / test / units / TEST-22-TMPFILES.09.sh
blob0857773526eeb16033f1b35744241931d23c6a39
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 set -eux
4 set -o pipefail
6 # Make sure that the "stat" output is not locale dependent.
7 export LANG=C LC_ALL=C
9 # first, create file without suid/sgid
10 systemd-tmpfiles --create - <<EOF
11 f /tmp/xxx 0755 1 1 - -
12 f /tmp/yyy 0755 1 1 - -
13 EOF
15 test "$(stat -c %F:%u:%g:%a /tmp/xxx)" = "regular empty file:1:1:755"
16 test "$(stat -c %F:%u:%g:%a /tmp/yyy)" = "regular empty file:1:1:755"
18 # then, add suid/sgid
19 systemd-tmpfiles --create - <<EOF
20 f /tmp/xxx 04755
21 f /tmp/yyy 02755
22 EOF
24 test "$(stat -c %F:%u:%g:%a /tmp/xxx)" = "regular empty file:1:1:4755"
25 test "$(stat -c %F:%u:%g:%a /tmp/yyy)" = "regular empty file:1:1:2755"
27 # then, chown the files to somebody else
28 systemd-tmpfiles --create - <<EOF
29 f /tmp/xxx - 2 2
30 f /tmp/yyy - 2 2
31 EOF
33 test "$(stat -c %F:%u:%g:%a /tmp/xxx)" = "regular empty file:2:2:4755"
34 test "$(stat -c %F:%u:%g:%a /tmp/yyy)" = "regular empty file:2:2:2755"
36 # then, chown the files to a third user/group but also drop to a mask that has
37 # both more and fewer bits set
38 systemd-tmpfiles --create - <<EOF
39 f /tmp/xxx 0770 3 3
40 f /tmp/yyy 0770 3 3
41 EOF
43 test "$(stat -c %F:%u:%g:%a /tmp/xxx)" = "regular empty file:3:3:770"
44 test "$(stat -c %F:%u:%g:%a /tmp/yyy)" = "regular empty file:3:3:770"
46 # return to the beginning
47 systemd-tmpfiles --create - <<EOF
48 f /tmp/xxx 0755 1 1 - -
49 f /tmp/yyy 0755 1 1 - -
50 EOF
52 test "$(stat -c %F:%u:%g:%a /tmp/xxx)" = "regular empty file:1:1:755"
53 test "$(stat -c %F:%u:%g:%a /tmp/yyy)" = "regular empty file:1:1:755"
55 # remove everything
56 systemd-tmpfiles --remove - <<EOF
57 r /tmp/xxx
58 r /tmp/yyy
59 EOF