diff options
author | наб <[email protected]> | 2022-03-26 11:19:17 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-04-01 18:03:21 -0700 |
commit | 6ef2151c80b6e68e03ff2272bdb50505309b2b2e (patch) | |
tree | e702eb1ad1e60176344af79d2b77c1e4378cc01f /tests | |
parent | 22ddc7f5ff9c773bc85de5a61033f4967a96d3aa (diff) |
tests: clean out more temporary files
What remains is a bunch of anonymous untraceable /tmp/tmp.XXXXXXXXXX
files and bak.root.receive.staff1.3835 from an error branch, testdir.1,
testdir.3, and testroot454470 (with children) in testroot
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: John Kennedy <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #13259
Diffstat (limited to 'tests')
16 files changed, 44 insertions, 46 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_block_size_histogram.ksh b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_block_size_histogram.ksh index 9a960cecc..0a4d24fa6 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_block_size_histogram.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_block_size_histogram.ksh @@ -145,7 +145,6 @@ function histo_check_test_pool typeset -i this_rs typeset -i this_ri typeset -i sum_filesizes=0 - typeset stripped let histo_check_pool_size=$(get_pool_prop size ${pool}) if [[ ! ${histo_check_pool_size} =~ ${re_number} ]]; then @@ -243,6 +242,8 @@ function histo_check_test_pool fi fi done < ${stripped} + rm "${stripped}" + if [ ${fail_value} -gt 0 ]; then if [ ${error_count} -eq 1 ]; then log_note "hctp: There was ${error_count} error" diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh index 3a1cddb5c..ec21c81ab 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh @@ -62,6 +62,8 @@ function cleanup bkmarkexists "$DATASET#$TESTBMCOPY" && \ destroy_dataset "$DATASET#$TESTBMCOPY" + + log_must rm -f "$TEST_BASE_DIR/zfstest_datastream.$$" } log_assert "'zfs bookmark' should work only when passed valid arguments." diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_003_pos.ksh index 6484de9c9..ac3bc891c 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_003_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_003_pos.ksh @@ -49,6 +49,7 @@ verify_runnable "both" function cleanup { snapexists $SNAPFS && destroy_dataset $SNAPFS -Rf + log_must rm -df "/tmp/mnt$$" } log_onexit cleanup diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_004_pos.ksh index 9e69366c8..bd01623b3 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_004_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_004_pos.ksh @@ -49,24 +49,23 @@ verify_runnable "both" function cleanup { datasetexists $TESTPOOL/$TESTFS1 && destroy_dataset $TESTPOOL/$TESTFS1 -f + log_must rm -df "/tmp/mnt$$" } log_onexit cleanup -log_assert "'zfs create -o property=value filesystem' can successfully create \ - a ZFS filesystem with correct property set." +log_assert "'zfs create -o property=value filesystem' can successfully create" \ + "a ZFS filesystem with correct property set." typeset -i i=0 while (( $i < ${#RW_FS_PROP[*]} )); do log_must zfs create -o ${RW_FS_PROP[$i]} $TESTPOOL/$TESTFS1 - datasetexists $TESTPOOL/$TESTFS1 || \ - log_fail "zfs create $TESTPOOL/$TESTFS1 fail." - propertycheck $TESTPOOL/$TESTFS1 ${RW_FS_PROP[i]} || \ - log_fail "${RW_FS_PROP[i]} is failed to set." + log_must datasetexists $TESTPOOL/$TESTFS1 + log_must propertycheck $TESTPOOL/$TESTFS1 ${RW_FS_PROP[i]} log_must_busy zfs destroy -f $TESTPOOL/$TESTFS1 (( i = i + 1 )) done -log_pass "'zfs create -o property=value filesystem' can successfully create \ - a ZFS filesystem with correct property set." +log_pass "'zfs create -o property=value filesystem' can successfully create" \ + "a ZFS filesystem with correct property set." diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_005_pos.ksh index 98cf70938..1321854d2 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_005_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_005_pos.ksh @@ -48,15 +48,16 @@ verify_runnable "both" function cleanup { - datasetexists $TESTPOOL/$TESTFS1 && \ + datasetexists $TESTPOOL/$TESTFS1 && destroy_dataset $TESTPOOL/$TESTFS1 -f + log_must rm -df "/tmp/mnt$$" } log_onexit cleanup -log_assert "'zfs create -o property=value filesystem' can successfully create \ - a ZFS filesystem with multiple properties set." +log_assert "'zfs create -o property=value filesystem' can successfully create" \ + "a ZFS filesystem with multiple properties set." typeset -i i=0 typeset opts="" @@ -69,17 +70,15 @@ while (( $i < ${#RW_FS_PROP[*]} )); do done log_must zfs create $opts $TESTPOOL/$TESTFS1 -datasetexists $TESTPOOL/$TESTFS1 || \ - log_fail "zfs create $TESTPOOL/$TESTFS1 fail." +log_must datasetexists $TESTPOOL/$TESTFS1 i=0 while (( $i < ${#RW_FS_PROP[*]} )); do if [[ ${RW_FS_PROP[$i]} != *"checksum"* ]]; then - propertycheck $TESTPOOL/$TESTFS1 ${RW_FS_PROP[i]} || \ - log_fail "${RW_FS_PROP[i]} is failed to set." + log_must propertycheck $TESTPOOL/$TESTFS1 ${RW_FS_PROP[i]} fi (( i = i + 1 )) done -log_pass "'zfs create -o property=value filesystem' can successfully create \ - a ZFS filesystem with multiple properties set." +log_pass "'zfs create -o property=value filesystem' can successfully create" \ + "a ZFS filesystem with multiple properties set." diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh index 655f887b6..264c75279 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh @@ -49,12 +49,13 @@ verify_runnable "global" function cleanup { datasetexists $TESTPOOL && destroy_pool $TESTPOOL + log_must rm -df "/tmp/mnt$$" } log_onexit cleanup -log_assert "'zpool create -O property=value pool' can successfully create a pool \ - with correct filesystem property set." +log_assert "'zpool create -O property=value pool' can successfully create a pool" \ + "with correct filesystem property set." set -A RW_FS_PROP "quota=536870912" \ "reservation=536870912" \ @@ -80,14 +81,11 @@ fi typeset -i i=0 while (( $i < ${#RW_FS_PROP[*]} )); do log_must zpool create -O ${RW_FS_PROP[$i]} -f $TESTPOOL $DISKS - datasetexists $TESTPOOL || \ - log_fail "zpool create $TESTPOOL fail." - propertycheck $TESTPOOL ${RW_FS_PROP[i]} || \ - log_fail "${RW_FS_PROP[i]} is failed to set." + log_must datasetexists $TESTPOOL + log_must propertycheck $TESTPOOL ${RW_FS_PROP[i]} log_must zpool destroy $TESTPOOL (( i = i + 1 )) done -log_pass "'zpool create -O property=value pool' can successfully create a pool \ - with correct filesystem property set." - +log_pass "'zpool create -O property=value pool' can successfully create a pool" \ + "with correct filesystem property set." diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh index 4a918c0a6..717fcaa6e 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh @@ -49,12 +49,13 @@ verify_runnable "global" function cleanup { poolexists $TESTPOOL && destroy_pool $TESTPOOL + log_must rm -df "/tmp/mnt$$" } log_onexit cleanup -log_assert "'zpool create -O property=value pool' can successfully create a pool \ - with multiple filesystem properties set." +log_assert "'zpool create -O property=value pool' can successfully create a pool" \ + "with multiple filesystem properties set." set -A RW_FS_PROP "quota=536870912" \ "reservation=536870912" \ @@ -81,15 +82,13 @@ while (( $i < ${#RW_FS_PROP[*]} )); do done log_must zpool create $opts -f $TESTPOOL $DISKS -datasetexists $TESTPOOL || log_fail "zpool create $TESTPOOL fail." +log_must datasetexists $TESTPOOL i=0 while (( $i < ${#RW_FS_PROP[*]} )); do - propertycheck $TESTPOOL ${RW_FS_PROP[i]} || \ - log_fail "${RW_FS_PROP[i]} is failed to set." + log_must propertycheck $TESTPOOL ${RW_FS_PROP[i]} (( i = i + 1 )) done -log_pass "'zpool create -O property=value pool' can successfully create a pool \ - with multiple filesystem properties set." - +log_pass "'zpool create -O property=value pool' can successfully create a pool" \ + "with multiple filesystem properties set." diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh index 9b5b5e1a0..c16094f54 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh @@ -64,7 +64,7 @@ function cleanup if poolexists $POOL ; then zpool export $POOL fi - log_must rm -f $VDEV1 $VDEV2 $VDEV3 + log_must rm -fd $VDEV1 $VDEV2 $VDEV3 $SUPPLY $MOUNTDIR } function damage_and_repair @@ -130,4 +130,3 @@ else log_note observed $errcnt new checksum errors after a scrub log_pass "$assertion" fi - diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh index 08ab6a2fa..9097ac008 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh @@ -56,7 +56,7 @@ function cleanup if poolexists $POOL ; then destroy_pool $POOL fi - log_must rm -f $VDEV1 $VDEV2 + log_must rm -fd $VDEV1 $VDEV2 $MOUNTDIR } log_assert "Duplicate I/O ereport errors are not posted" diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh index b77437416..82a1a1131 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh @@ -59,7 +59,7 @@ function cleanup if poolexists $POOL ; then log_must destroy_pool $POOL fi - log_must rm -f $VDEV1 $VDEV2 $VDEV3 + log_must rm -fd $VDEV1 $VDEV2 $VDEV3 $MOUNTDIR } log_assert "Check that the number of zpool errors match the number of events" diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_devices.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_devices.ksh index d64c30d5c..83b12ab78 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_devices.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_devices.ksh @@ -33,7 +33,7 @@ function cleanup { destroy_pool $TESTPOOL destroy_pool $TESTPOOL2 - rm -f $FILEDEV_PREFIX* + rm -fd $FILEDEV_PREFIX* $altroot } function setup_mirror # <conf> diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_indirect.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_indirect.ksh index 13f0d08b7..e6e5d2457 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_indirect.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_indirect.ksh @@ -43,7 +43,7 @@ function cleanup if poolexists $TESTPOOL2 ; then destroy_pool $TESTPOOL2 fi - rm -f $VDEV_TEMP $VDEV_M1 $VDEV_M2 + rm -fd $VDEV_TEMP $VDEV_M1 $VDEV_M2 $altroot } log_onexit cleanup @@ -64,6 +64,6 @@ log_must zpool remove $TESTPOOL $VDEV_TEMP log_must wait_for_removal $TESTPOOL log_must zpool split -R $altroot $TESTPOOL $TESTPOOL2 log_must poolexists $TESTPOOL2 -log_must test "$(get_pool_prop 'altroot' $TESTPOOL2)" == "$altroot" +log_must test "$(get_pool_prop 'altroot' $TESTPOOL2)" = "$altroot" log_pass "'zpool split' works on pools with indirect VDEVs." diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_vdevs.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_vdevs.ksh index d2be9b65c..fff98cf83 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_vdevs.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_vdevs.ksh @@ -33,7 +33,7 @@ function cleanup { destroy_pool $TESTPOOL destroy_pool $TESTPOOL2 - rm -f $FILEDEV_PREFIX* + rm -fd $FILEDEV_PREFIX* $altroot } # diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_wholedisk.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_wholedisk.ksh index 085856c42..0725b77a3 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_wholedisk.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_wholedisk.ksh @@ -44,7 +44,7 @@ function cleanup destroy_pool $TESTPOOL destroy_pool $TESTPOOL2 unload_scsi_debug - rm -f "$FILE_DEVICE" + rm -fd "$FILE_DEVICE" "$ALTROOT" } function setup_mirror diff --git a/tests/zfs-tests/tests/functional/xattr/cleanup.ksh b/tests/zfs-tests/tests/functional/xattr/cleanup.ksh index ab0fbf812..625718cfe 100755 --- a/tests/zfs-tests/tests/functional/xattr/cleanup.ksh +++ b/tests/zfs-tests/tests/functional/xattr/cleanup.ksh @@ -31,7 +31,7 @@ . $STF_SUITE/tests/functional/xattr/xattr_common.kshlib USES_NIS=$(<$TEST_BASE_DIR/zfs-xattr-test-nis.txt) -rm $TEST_BASE_DIR/zfs-xattr-test-nis.txt +rm $TEST_BASE_DIR/zfs-xattr-test-nis.txt $TEST_BASE_DIR/zfs-xattr-test-user.txt if [ "${USES_NIS}" == "true" ] then diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh index 786322b30..2ed040d86 100755 --- a/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh +++ b/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh @@ -50,8 +50,8 @@ verify_runnable "global" function cleanup { if ismounted /tmp/$NEWFS_DEFAULT_FS.$$ $NEWFS_DEFAULT_FS; then log_must umount /tmp/$NEWFS_DEFAULT_FS.$$ - log_must rm -rf /tmp/$NEWFS_DEFAULT_FS.$$ fi + log_must rm -rf /tmp/$NEWFS_DEFAULT_FS.$$ } log_assert "Files from $NEWFS_DEFAULT_FS with xattrs copied to zfs retain xattr info." |