Skip to content

Commit 82260fc

Browse files
committed
test: add tests for "homectl --skel"
1 parent 05e64ea commit 82260fc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/units/TEST-46-HOMED.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ systemctl service-log-level systemd-homed debug
4444
mkdir -p /home
4545
mount -t tmpfs tmpfs /home -o size=290M
4646

47+
TMP_SKEL=$(mktemp -d)
48+
echo hogehoge >"$TMP_SKEL"/hoge
49+
4750
# we enable --luks-discard= since we run our tests in a tight VM, hence don't
4851
# needlessly pressure for storage. We also set the cheapest KDF, since we don't
4952
# want to waste CI CPU cycles on it. We also effectively disable rate-limiting on
@@ -55,7 +58,8 @@ NEWPASSWORD=xEhErW0ndafV4s homectl create test-user \
5558
--luks-pbkdf-type=pbkdf2 \
5659
--luks-pbkdf-time-cost=1ms \
5760
--rate-limit-interval=1s \
58-
--rate-limit-burst=1000
61+
--rate-limit-burst=1000 \
62+
--skel="$TMP_SKEL"
5963
inspect test-user
6064

6165
PASSWORD=xEhErW0ndafV4s homectl authenticate test-user
@@ -211,6 +215,8 @@ PASSWORD=xEhErW0ndafV4s homectl with test-user -- test -f /home/test-user/xyz
211215
PASSWORD=xEhErW0ndafV4s homectl with test-user -- rm /home/test-user/xyz
212216
PASSWORD=xEhErW0ndafV4s homectl with test-user -- test ! -f /home/test-user/xyz
213217
(! PASSWORD=xEhErW0ndafV4s homectl with test-user -- test -f /home/test-user/xyz)
218+
[[ $(PASSWORD=xEhErW0ndafV4s homectl with test-user -- stat -c %U /home/test-user/hoge) == "test-user" ]]
219+
[[ $(PASSWORD=xEhErW0ndafV4s homectl with test-user -- cat /home/test-user/hoge) == "$(cat "$TMP_SKEL"/hoge)" ]]
214220

215221
# Regression tests
216222
wait_for_state test-user inactive

0 commit comments

Comments
 (0)