diff options
author | Ryan Moeller <[email protected]> | 2021-08-16 19:38:34 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-08-16 16:38:34 -0700 |
commit | 5bfc3a99f93da97e8612bceae146cf2d5166481b (patch) | |
tree | 57276161ce680614a8dfc2670659768942c561df /tests/zfs-tests | |
parent | e945e8d7f4fcafd4f1c01abd90810fc09ab6a811 (diff) |
ZTS: Avoid unset $tmpdir in redacted_panic
The redacted_send tests make use of a $tmpdir variable, except in
redacted_send/redacted_panic the variable is never defined.
Use $TEST_BASE_DIR instead.
Clean up the stream file after the test.
Reviewed-by: John Kennedy <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #12455
Diffstat (limited to 'tests/zfs-tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/redacted_send/redacted_panic.ksh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/zfs-tests/tests/functional/redacted_send/redacted_panic.ksh b/tests/zfs-tests/tests/functional/redacted_send/redacted_panic.ksh index bf3b17f35..032d1fb91 100755 --- a/tests/zfs-tests/tests/functional/redacted_send/redacted_panic.ksh +++ b/tests/zfs-tests/tests/functional/redacted_send/redacted_panic.ksh @@ -28,9 +28,15 @@ typeset ds_name="panic" typeset sendfs="$POOL/$ds_name" typeset recvfs="$POOL2/$ds_name" typeset clone="$POOL/${ds_name}_clone" -typeset stream=$(mktemp $tmpdir/stream.XXXX) +typeset stream=$(mktemp $TEST_BASE_DIR/stream.XXXX) -log_onexit redacted_cleanup $sendfs $recvfs +function cleanup +{ + redacted_cleanup $sendfs $recvfs + rm -f $stream +} + +log_onexit cleanup log_must zfs create -o recsize=8k $sendfs log_must dd if=/dev/urandom of=/$sendfs/file bs=1024k count=2048 |