]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-46-HOMED: write zeros instead of random bytes
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 28 Mar 2025 17:00:38 +0000 (18:00 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 31 Mar 2025 20:46:04 +0000 (22:46 +0200)
This should be faster, and equivalent for the purposes of quota calculation.

test/units/TEST-46-HOMED.sh

index 78c91044b819ef8760c5f2033de32448aa15a78c..3bd6ebda480b33fac9a322ec13757627917ac7df 100755 (executable)
@@ -669,10 +669,10 @@ 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 dd if=/dev/zero of=/dev/shm/quotatestfile1 bs=1024 count=30
+    (! run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u tmpfsquota dd if=/dev/zero 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 dd if=/dev/zero 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
@@ -705,7 +705,7 @@ test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareate
 test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest -a furb sh -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/furb"
 
 # Install a PK rule that allows 'subareatest' user to invoke run0 without password, just for testing
-cat > /usr/share/polkit-1/rules.d/subareatest.rules <<'EOF'
+cat >/usr/share/polkit-1/rules.d/subareatest.rules <<'EOF'
 polkit.addRule(function(action, subject) {
     if (action.id == "org.freedesktop.systemd1.manage-units" &&
         subject.user == "subareatest") {