Skip to content

Commit edb24be

Browse files
authored
ZTS: Replace /var/tmp with $TEST_BASE_DIR
Remove a few hardcoded instances of /var/tmp. This should use the $TEST_BASE_DIR in order to allow the ZTS to be optionally run in an alternate directory using `zfs-tests.sh -d <path>`. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: Kjeld Schouten <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #9775
1 parent a6f6ef8 commit edb24be

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_dev_removal.ksh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ function cleanup
3737

3838
log_onexit cleanup
3939

40-
VIRTUAL_DISK1=/var/tmp/disk1
41-
VIRTUAL_DISK2=/var/tmp/disk2
42-
log_must mkfile $(($MINVDEVSIZE * 8)) $VIRTUAL_DISK1
43-
log_must mkfile $(($MINVDEVSIZE * 16)) $VIRTUAL_DISK2
40+
VIRTUAL_DISK1=$TEST_BASE_DIR/disk1
41+
VIRTUAL_DISK2=$TEST_BASE_DIR/disk2
42+
log_must truncate -s $(($MINVDEVSIZE * 8)) $VIRTUAL_DISK1
43+
log_must truncate -s $(($MINVDEVSIZE * 16)) $VIRTUAL_DISK2
4444

4545
log_must zpool create $TESTPOOL2 $VIRTUAL_DISK1
4646
log_must poolexists $TESTPOOL2

tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_dev_removal_condense.ksh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ log_onexit cleanup
4848
ORIGINAL_MAX=$(get_tunable $LIVELIST_MAX_ENTRIES)
4949
set_tunable64 $LIVELIST_MAX_ENTRIES 20
5050

51-
VIRTUAL_DISK1=/var/tmp/disk1
52-
VIRTUAL_DISK2=/var/tmp/disk2
53-
log_must mkfile $(($MINVDEVSIZE * 8)) $VIRTUAL_DISK1
54-
log_must mkfile $(($MINVDEVSIZE * 16)) $VIRTUAL_DISK2
51+
VIRTUAL_DISK1=$TEST_BASE_DIR/disk1
52+
VIRTUAL_DISK2=$TEST_BASE_DIR/disk2
53+
log_must truncate -s $(($MINVDEVSIZE * 8)) $VIRTUAL_DISK1
54+
log_must truncate -s $(($MINVDEVSIZE * 16)) $VIRTUAL_DISK2
5555

5656
log_must zpool create $TESTPOOL2 $VIRTUAL_DISK1
5757
log_must poolexists $TESTPOOL2

tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_001_pos.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ log_onexit cleanup
7575
init_snap=$TESTPOOL/$TESTFS@init_snap
7676
inc_snap=$TESTPOOL/$TESTFS@inc_snap
7777
full_bkup=$TEST_BASE_DIR/fullbkup.$$
78-
inc_bkup=/var/tmp/incbkup.$$
78+
inc_bkup=$TEST_BASE_DIR/incbkup.$$
7979
init_data=$TESTDIR/$TESTFILE1
8080
inc_data=$TESTDIR/$TESTFILE2
8181
orig_sum=""

tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_007_pos.ksh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ function cleanup
5757
log_onexit cleanup
5858
log_assert "'zfs list -d <n>' should get expected output."
5959

60-
mntpnt=/var/tmp
61-
DEPTH_OUTPUT="$mntpnt/depth_output"
62-
EXPECT_OUTPUT="$mntpnt/expect_output"
60+
DEPTH_OUTPUT="$TEST_BASE_DIR/depth_output"
61+
EXPECT_OUTPUT="$TEST_BASE_DIR/expect_output"
6362
typeset -i old_val=0
6463
typeset -i j=0
6564
typeset -i fs=0

0 commit comments

Comments
 (0)