]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: run script from /tmp, not /run
authorLuca Boccassi <bluca@debian.org>
Thu, 9 Mar 2023 17:08:01 +0000 (17:08 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 10 Mar 2023 11:01:22 +0000 (11:01 +0000)
On Debian the test fails because /run is noexec. Simply create the
script in /tmp (and use a BindPath=), as other tests are doing.

Follow-up for 3b7101183cac4b35a8bd6ea2c1de9260c33f977f

test/units/testsuite-79.sh

index cced3205c590ea53882a05da9519279edfa4db65..fe34d5c5562aaeea76b6c26d8a68e6e18a4e67c7 100755 (executable)
@@ -25,9 +25,7 @@ if ! test -f "$CGROUP"/memory.pressure ; then
 fi
 
 UNIT="test-mempress-$RANDOM.service"
-SCRIPT="/run/bin/mempress-$RANDOM.sh"
-
-mkdir -p "/run/bin"
+SCRIPT="/tmp/mempress-$RANDOM.sh"
 
 cat >"$SCRIPT" <<'EOF'
 #!/bin/bash
@@ -51,12 +49,10 @@ EOF
 
 chmod +x "$SCRIPT"
 
-systemd-run -u "$UNIT" -p Type=exec -p DynamicUser=1 -p MemoryPressureWatch=on -p MemoryPressureThresholdSec=123ms --wait "$SCRIPT"
+systemd-run -u "$UNIT" -p Type=exec -p DynamicUser=1 -p MemoryPressureWatch=on -p MemoryPressureThresholdSec=123ms -p BindPaths=$SCRIPT --wait "$SCRIPT"
 
 rm "$SCRIPT"
 
-rmdir /run/bin ||:
-
 systemd-analyze log-level info
 echo OK >/testok