From a89b67509fb8d4f80a918f9ac93b2d759f386820 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 16 Nov 2021 10:51:35 +0100 Subject: [PATCH] test: add grow/shrink/minimize test for homed Let's add testing for the stuff we just added. --- test/units/testsuite-46.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/test/units/testsuite-46.sh b/test/units/testsuite-46.sh index fc4fc502979..6c70b32d45c 100755 --- a/test/units/testsuite-46.sh +++ b/test/units/testsuite-46.sh @@ -69,6 +69,39 @@ inspect test-user PASSWORD=xEhErW0ndafV4s homectl deactivate test-user inspect test-user +# Do some resize tests, but only if we run on real kernels, as quota inside of containers will fail +if ! systemd-detect-virt -cq ; then + # grow while inactive + PASSWORD=xEhErW0ndafV4s homectl resize test-user 300M + inspect test-user + + # minimize while inactive + PASSWORD=xEhErW0ndafV4s homectl resize test-user 0 + inspect test-user + + PASSWORD=xEhErW0ndafV4s homectl activate test-user + inspect test-user + + # grow while active + PASSWORD=xEhErW0ndafV4s homectl resize test-user 300M + inspect test-user + + # minimize while active + PASSWORD=xEhErW0ndafV4s homectl resize test-user 0 + inspect test-user + + # grow while active + PASSWORD=xEhErW0ndafV4s homectl resize test-user 300M + inspect test-user + + # shrink to original size while active + PASSWORD=xEhErW0ndafV4s homectl resize test-user 256M + inspect test-user + + PASSWORD=xEhErW0ndafV4s homectl deactivate test-user + inspect test-user +fi + PASSWORD=xEhErW0ndafV4s homectl with test-user -- test ! -f /home/test-user/xyz PASSWORD=xEhErW0ndafV4s homectl with test-user -- test -f /home/test-user/xyz \ && { echo 'unexpected success'; exit 1; } -- 2.47.3