]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add test case for tmpfs quota logic + PAMName= ask-password logic
authorLennart Poettering <lennart@poettering.net>
Tue, 14 Jan 2025 23:25:22 +0000 (00:25 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Jan 2025 21:36:39 +0000 (22:36 +0100)
test/units/TEST-46-HOMED.sh

index 8de170a1c94464dba0cf24e1c20eb89e0982ba41..3663e5390848c9ab25b1233226b7a40aeed56d3c 100755 (executable)
@@ -652,6 +652,22 @@ getent passwd aliastest@myrealm
 getent passwd aliastest2@myrealm
 getent passwd aliastest3@myrealm
 
+if findmnt -n -o options /tmp | grep -q usrquota ; then
+
+    NEWPASSWORD=quux homectl create tmpfsquota --storage=subvolume --dev-shm-limit=50K -P
+
+    run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/urandom of=/dev/shm/quotatestfile1 bs=1024 count=30
+    (! run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/urandom of=/dev/shm/quotatestfile2 bs=1024 count=30)
+    run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota rm /dev/shm/quotatestfile1 /dev/shm/quotatestfile2
+    run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/urandom of=/dev/shm/quotatestfile1 bs=1024 count=30
+    run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota rm /dev/shm/quotatestfile1
+
+    systemctl stop user@"$(id -u tmpfsquota)".service
+
+    wait_for_state tmpfsquota inactive
+    homectl remove tmpfsquota
+fi
+
 systemd-analyze log-level info
 
 touch /testok