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; }