From: Luca Boccassi Date: Thu, 9 Mar 2023 17:08:01 +0000 (+0000) Subject: test: run script from /tmp, not /run X-Git-Tag: v254-rc1~1069 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c67a8a1886a928fb48dd87919bfa5ab10c224ab;p=thirdparty%2Fsystemd.git test: run script from /tmp, not /run 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 --- diff --git a/test/units/testsuite-79.sh b/test/units/testsuite-79.sh index cced3205c59..fe34d5c5562 100755 --- a/test/units/testsuite-79.sh +++ b/test/units/testsuite-79.sh @@ -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