From: Dmitry V. Levin Date: Thu, 9 Mar 2023 08:00:00 +0000 (+0000) Subject: testsuite-17.11.sh: create all files in a temporary directory X-Git-Tag: v254-rc1~1062^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99f24451710ed86021c331dd2e90ca35497faa93;p=thirdparty%2Fsystemd.git testsuite-17.11.sh: create all files in a temporary directory Make sure the test would not collide with anything else by moving all files it created into a temporary directory. --- diff --git a/test/units/testsuite-17.11.sh b/test/units/testsuite-17.11.sh index 6a6d873bdee..ad0158921cd 100755 --- a/test/units/testsuite-17.11.sh +++ b/test/units/testsuite-17.11.sh @@ -5,6 +5,16 @@ set -o pipefail # Test for udevadm verify. +cleanup() { + cd / + rm -rf "${workdir}" + workdir= +} + +workdir="$(mktemp -d)" +trap cleanup EXIT +cd "${workdir}" + udevadm verify -h udevadm verify --help udevadm verify -V