Skip to content

Commit cb86668

Browse files
committed
TEST-46-HOMED: check for support on /dev/shm and /tmp separately
The test fails in CI. My guess was this is because the enablement of quota on /tmp and /dev/shm is independent. The former fs is mounted by systemd in the host, while the latter is mounted in the initrd, so we can end up with quota support on one but not the other, which is the situation I had on my laptop. This wasn't actually the source of the problems in CI, but it's a reasonable change to make anyway. While at it, test both mountpoints separately.
1 parent cb6b161 commit cb86668

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

test/units/TEST-46-HOMED.sh

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -665,24 +665,22 @@ getent passwd aliastest@myrealm
665665
getent passwd aliastest2@myrealm
666666
getent passwd aliastest3@myrealm
667667

668-
if findmnt -n -o options /tmp | grep -q usrquota ; then
669-
670-
NEWPASSWORD=quux homectl create tmpfsquota --storage=subvolume --dev-shm-limit=50K -P
671-
672-
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of=/dev/shm/quotatestfile1 bs=1024 count=30
673-
(! run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of=/dev/shm/quotatestfile2 bs=1024 count=30)
674-
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota rm /dev/shm/quotatestfile1 /dev/shm/quotatestfile2
675-
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of=/dev/shm/quotatestfile1 bs=1024 count=30
676-
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota rm /dev/shm/quotatestfile1
677-
678-
systemctl stop user@"$(id -u tmpfsquota)".service
668+
NEWPASSWORD=quux homectl create tmpfsquota --storage=subvolume --dev-shm-limit=50K --tmp-limit=50K -P
669+
for p in /dev/shm /tmp; do
670+
if findmnt -n -o options "$p" | grep -q usrquota; then
671+
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of="$p/quotatestfile1" bs=1024 count=30
672+
(! run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of="$p/quotatestfile2" bs=1024 count=30)
673+
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota rm "$p/quotatestfile1" "$p/quotatestfile2"
674+
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero of="$p/quotatestfile1" bs=1024 count=30
675+
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota rm "$p/quotatestfile1"
676+
fi
677+
done
679678

680-
wait_for_state tmpfsquota inactive
681-
homectl remove tmpfsquota
682-
fi
679+
systemctl stop user@"$(id -u tmpfsquota)".service
680+
wait_for_state tmpfsquota inactive
681+
homectl remove tmpfsquota
683682

684683
NEWPASSWORD=quux homectl create subareatest --storage=subvolume -P
685-
686684
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest mkdir Areas
687685
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest cp -av /etc/skel Areas/furb
688686
run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest cp -av /etc/skel Areas/molb

0 commit comments

Comments
 (0)