Skip to content

Commit c6c0d30

Browse files
Ryan Moellertonyhutter
authored andcommitted
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 openzfs#12455
1 parent 24e51e3 commit c6c0d30

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/zfs-tests/tests/functional/redacted_send/redacted_panic.ksh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,15 @@ typeset ds_name="panic"
2828
typeset sendfs="$POOL/$ds_name"
2929
typeset recvfs="$POOL2/$ds_name"
3030
typeset clone="$POOL/${ds_name}_clone"
31-
typeset stream=$(mktemp $tmpdir/stream.XXXX)
31+
typeset stream=$(mktemp $TEST_BASE_DIR/stream.XXXX)
3232

33-
log_onexit redacted_cleanup $sendfs $recvfs
33+
function cleanup
34+
{
35+
redacted_cleanup $sendfs $recvfs
36+
rm -f $stream
37+
}
38+
39+
log_onexit cleanup
3440

3541
log_must zfs create -o recsize=8k $sendfs
3642
log_must dd if=/dev/urandom of=/$sendfs/file bs=1024k count=2048

0 commit comments

Comments
 (0)