From: Zbigniew Jędrzejewski-Szmek Date: Mon, 31 Mar 2025 20:50:38 +0000 (+0200) Subject: TEST-46-HOMED: conditionally skip usrquota tests X-Git-Tag: v258-rc1~969^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f77a8edfefd47e481fab78e7dd75d5d088d4e5e3;p=thirdparty%2Fsystemd.git TEST-46-HOMED: conditionally skip usrquota tests The tests were failing, because the quota was not enforced. It seems that we simply don't have privileges to set or display the quota. The test is running priviled, so this is probably some SELinux: TEST-46-HOMED.sh[117]: + /usr/lib/systemd/tests/unit-tests/manual/test-display-quota tmpfsquota /dev/shm /tmp TEST-46-HOMED.sh[1103]: Lacking privileges to query UID quota on /dev/shm: Operation not permitted TEST-46-HOMED.sh[1103]: Lacking privileges to query UID quota on /tmp: Operation not permitted If we cannot display the quota, ignore the test results. In a local run under mkosi, quota is shown and the tests pass. So this is something about how the testing-farm:fedora-rawhide-x86_64 is configured. --- diff --git a/test/units/TEST-46-HOMED.sh b/test/units/TEST-46-HOMED.sh index d1a6ea2fc59..f7aadf38b51 100755 --- a/test/units/TEST-46-HOMED.sh +++ b/test/units/TEST-46-HOMED.sh @@ -668,11 +668,18 @@ getent passwd aliastest3@myrealm NEWPASSWORD=quux homectl create tmpfsquota --storage=subvolume --dev-shm-limit=50K --tmp-limit=50K -P for p in /dev/shm /tmp; do if findmnt -n -o options "$p" | grep -q usrquota; then + # Check if we can display the quotas. If we cannot, than it's likely + # that PID1 was also not able to set the limits and we should not fail + # in the tests below. + /usr/lib/systemd/tests/unit-tests/manual/test-display-quota tmpfsquota "$p" || set +e + run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of="$p/quotatestfile1" bs=1024 count=30 (! run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of="$p/quotatestfile2" bs=1024 count=30) run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota rm "$p/quotatestfile1" "$p/quotatestfile2" run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of="$p/quotatestfile1" bs=1024 count=30 run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota rm "$p/quotatestfile1" + + set -e fi done