Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZTS: zfs-tests: set TMPDIR to FILEDIR
Many tests use mktemp to create temporary files and dirs, which will usually put them in /tmp unless instructed otherwise. This had led to many tests trying to give mktemp a useful temp path in ad-hoc ways, and others just using it directly without knowing they're potentially leaving stuff lying around. So we set TMPDIR to FILEDIR, which makes the simplest uses of mktemp put things in the wanted work dir. Included here is a hack to get TMPDIR into the test. If a test has to be run as a different user (most of them), it is run through sudo. ld.so from glibc will not pass TMPDIR to a setuid program, so instead we re-set TMPDIR after sudo before running the target command. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]>
- Loading branch information