]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: extend homed test to test home dir "maximization"
authorLennart Poettering <lennart@poettering.net>
Wed, 17 Nov 2021 09:22:20 +0000 (10:22 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 18 Nov 2021 23:05:53 +0000 (00:05 +0100)
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.)

test/units/testsuite-46.sh

index a136e727d7999f2a63a2a2c715a91b44960337b7..b5180eb8c455a556845114ff24758fb38760bbb9 100755 (executable)
@@ -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