mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user