1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

test: extend homed test to test home dir "maximization"

This moves the backing store to a separate tmpfs which we can nicely put
a size limit on to make sure we can test maximization sanely: if we ask
for the home dir to be grown really large it should effectively only be
grown until the size of the backing tmpfs.

(While we are at it, also set a cheaper KDF so that we don't waste CI
cycles for password hashing that aren#t secure anyway.)
This commit is contained in:
Lennart Poettering 2021-11-17 10:22:20 +01:00
parent 2b02eb0591
commit 41caad6fcc

View File

@ -27,9 +27,19 @@ inspect() {
systemd-analyze log-level debug
systemd-analyze log-target console
# Create a tmpfs to use as backing store for the home dir. That way we can enforce a size limit nicely.
mkdir -p /home-pool
mount -t tmpfs tmpfs /home-pool -o size=290M
# we enable --luks-discard= since we run our tests in a tight VM, hence don't
# needlessly pressure for storage
NEWPASSWORD=xEhErW0ndafV4s homectl create test-user --disk-size=256M --luks-discard=yes
# needlessly pressure for storage. We also set the cheapest KDF, since we don't
# want to waste CI CPU cycles on it.
NEWPASSWORD=xEhErW0ndafV4s homectl create test-user \
--disk-size=256M \
--luks-discard=yes \
--image-path=/home-pool/test-user.home \
--luks-pbkdf-type=pbkdf2 \
--luks-pbkdf-time-cost=1ms
inspect test-user
PASSWORD=xEhErW0ndafV4s homectl authenticate test-user
@ -84,7 +94,7 @@ if ! systemd-detect-virt -cq ; then
inspect test-user
# grow while active
PASSWORD=xEhErW0ndafV4s homectl resize test-user 300M
PASSWORD=xEhErW0ndafV4s homectl resize test-user 1T
inspect test-user
# minimize while active