blob: 6d9488688a1bb4554923154641e6e98e65a714fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#!/usr/bin/env bash
set -ex
set -o pipefail
systemd-analyze log-level debug
systemd-analyze log-target console
# Set everything up without DynamicUser=1
systemd-run --wait -p DynamicUser=0 -p StateDirectory=zzz touch /var/lib/zzz/test
systemd-run --wait -p DynamicUser=0 -p StateDirectory=zzz test -f /var/lib/zzz/test
! systemd-run --wait -p DynamicUser=0 -p StateDirectory=zzz test -f /var/lib/zzz/test-missing
test -d /var/lib/zzz
! test -L /var/lib/zzz
! test -e /var/lib/private/zzz
test -f /var/lib/zzz/test
! test -f /var/lib/zzz/test-missing
# Convert to DynamicUser=1
systemd-run --wait -p DynamicUser=1 -p StateDirectory=zzz test -f /var/lib/zzz/test
! systemd-run --wait -p DynamicUser=1 -p StateDirectory=zzz test -f /var/lib/zzz/test-missing
test -L /var/lib/zzz
test -d /var/lib/private/zzz
test -f /var/lib/zzz/test
! test -f /var/lib/zzz/test-missing
# Convert back
systemd-run --wait -p DynamicUser=0 -p StateDirectory=zzz test -f /var/lib/zzz/test
! systemd-run --wait -p DynamicUser=0 -p StateDirectory=zzz test -f /var/lib/zzz/test-missing
test -d /var/lib/zzz
! test -L /var/lib/zzz
! test -e /var/lib/private/zzz
test -f /var/lib/zzz/test
! test -f /var/lib/zzz/test-missing
systemd-analyze log-level info
echo OK > /testok
exit 0
|