mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
tests/int: BATS_TMPDIR -> BATS_RUN_TMPDIR
It's a little known fact, but BATS_TMPDIR is just /tmp, and it is not being cleaned by bats after the test. BATS_RUN_TMPDIR (available since bats 1.2.1) is $BATS_TMPDIR/bats-run-$$ (i.e. it is per bats run and includes PID), and it is cleaned up after the test (unless --no-tmpdir-cleanup is given). Use BATS_RUN_TMPDIR for better isolation and cleanup. [v2: check for BATS_RUN_TMPDIR, effectively requiring bats >= 1.2.1] Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -6,7 +6,7 @@ function setup() {
|
||||
unset ALT_ROOT
|
||||
teardown
|
||||
setup_busybox
|
||||
ALT_ROOT=$(mktemp -d "$BATS_TMPDIR/runc-2.XXXXXX")
|
||||
ALT_ROOT=$(mktemp -d "$BATS_RUN_TMPDIR/runc-2.XXXXXX")
|
||||
}
|
||||
|
||||
function teardown() {
|
||||
|
||||
Reference in New Issue
Block a user