tests: vdev_zaps: cleanup library

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13259
This commit is contained in:
наб
2022-03-09 23:54:26 +01:00
committed by Brian Behlendorf
parent 25aeffadb2
commit 41ebf40375
4 changed files with 17 additions and 51 deletions
+3 -11
View File
@@ -1229,7 +1229,6 @@ function poolexists
fi
zpool get name "$pool" > /dev/null 2>&1
return $?
}
# Return 0 if all the specified datasets exist; $? otherwise
@@ -1242,13 +1241,7 @@ function datasetexists
return 1
fi
while (($# > 0)); do
zfs get name $1 > /dev/null 2>&1 || \
return $?
shift
done
return 0
zfs get name "$@" > /dev/null 2>&1
}
# return 0 if none of the specified datasets exists, otherwise return 1.
@@ -1776,7 +1769,7 @@ function create_dataset #dataset dataset_options
# $2 - custom arguments for zfs destroy
# Destroy dataset with the given parameters.
function destroy_dataset #dataset #args
function destroy_dataset # dataset [args]
{
typeset dataset=$1
typeset mtpt
@@ -1792,8 +1785,7 @@ function destroy_dataset #dataset #args
mtpt=$(get_prop mountpoint "$dataset")
log_must_busy zfs destroy $args $dataset
[[ -d $mtpt ]] && \
log_must rm -rf $mtpt
[ -d $mtpt ] && log_must rm -rf $mtpt
else
log_note "Dataset does not exist. ($dataset)"
return 1