Skip to content

Commit f77a8ed

Browse files
committed
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.
1 parent cb86668 commit f77a8ed

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/units/TEST-46-HOMED.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,11 +668,18 @@ getent passwd aliastest3@myrealm
668668
NEWPASSWORD=quux homectl create tmpfsquota --storage=subvolume --dev-shm-limit=50K --tmp-limit=50K -P
669669
for p in /dev/shm /tmp; do
670670
if findmnt -n -o options "$p" | grep -q usrquota; then
671+
# Check if we can display the quotas. If we cannot, than it's likely
672+
# that PID1 was also not able to set the limits and we should not fail
673+
# in the tests below.
674+
/usr/lib/systemd/tests/unit-tests/manual/test-display-quota tmpfsquota "$p" || set +e
675+
671676
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of="$p/quotatestfile1" bs=1024 count=30
672677
(! run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of="$p/quotatestfile2" bs=1024 count=30)
673678
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota rm "$p/quotatestfile1" "$p/quotatestfile2"
674679
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of="$p/quotatestfile1" bs=1024 count=30
675680
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota rm "$p/quotatestfile1"
681+
682+
set -e
676683
fi
677684
done
678685

0 commit comments

Comments
 (0)