From 41caad6fcce0b4245849676396b21c8bd553db22 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 17 Nov 2021 10:22:20 +0100 Subject: [PATCH] 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.) --- test/units/testsuite-46.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/units/testsuite-46.sh b/test/units/testsuite-46.sh index a136e727d79..b5180eb8c45 100755 --- a/test/units/testsuite-46.sh +++ b/test/units/testsuite-46.sh @@ -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 -- 2.47.3