aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-02-21 19:00:23 -0500
committerGitHub <[email protected]>2020-02-21 16:00:22 -0800
commit24fcd9fc5c999385785d73414bfd1cf72c1b230d (patch)
treed5f7dc205af3be1d29252571f9f4edcdf0e730ba /tests/zfs-tests
parentb7dbbf6aa782b10e2645b3cf748406443ccd7052 (diff)
ZTS: Eliminate partitioning from zpool_destroy
The zpool destroy tests partition a single disk to create two pools. This can be done using two disks and no partitioning instead. And temporarily allow vol recursion for FreeBSD while in here. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10036
Diffstat (limited to 'tests/zfs-tests')
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy.cfg10
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_001_pos.ksh18
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_002_pos.ksh5
3 files changed, 10 insertions, 23 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy.cfg
index 9349e5ff6..bf6026747 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy.cfg
@@ -28,18 +28,10 @@
# Copyright (c) 2012 by Delphix. All rights reserved.
#
-export DISK=${DISKS%% *}
export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
export DISKSARRAY=$DISKS
+echo $DISKS | read DISK0 DISK1
if is_linux; then
set_device_dir
- set_slice_prefix
- export SLICE0=1
- export SLICE1=2
-else
- export SLICE0=0
- export SLICE1=1
-
fi
-export SLICE_SIZE=500m
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_001_pos.ksh
index 041a1d00c..3323f1db0 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_001_pos.ksh
@@ -56,26 +56,24 @@ function cleanup
poolexists $pool && destroy_pool $pool
done
- zero_partitions $DISK
+ [ -n "$recursive" ] && set_tunable64 VOL_RECURSIVE $recursive
}
set -A datasets "$TESTPOOL" "$TESTPOOL2"
-if ! is_physical_device $DISKS; then
- log_unsupported "This case cannot be run on raw files."
-fi
-
log_assert "'zpool destroy <pool>' can destroy a specified pool."
log_onexit cleanup
-partition_disk $SLICE_SIZE $DISK 2
-
-create_pool "$TESTPOOL" "${DISK}${SLICE_PREFIX}${SLICE0}"
-create_pool "$TESTPOOL1" "${DISK}${SLICE_PREFIX}${SLICE1}"
+create_pool $TESTPOOL $DISK0
+create_pool $TESTPOOL1 $DISK1
log_must zfs create -s -V $VOLSIZE $TESTPOOL1/$TESTVOL
block_device_wait
-create_pool "$TESTPOOL2" "${ZVOL_DEVDIR}/$TESTPOOL1/$TESTVOL"
+if is_freebsd; then
+ typeset recursive=$(get_tunable VOL_RECURSIVE)
+ log_must set_tunable64 VOL_RECURSIVE 1
+fi
+create_pool $TESTPOOL2 $ZVOL_DEVDIR/$TESTPOOL1/$TESTVOL
typeset -i i=0
while (( i < ${#datasets[*]} )); do
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_002_pos.ksh
index ad9425795..794a6c37c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_002_pos.ksh
@@ -73,9 +73,7 @@ log_assert "'zpool destroy -f <pool>' can forcely destroy the specified pool"
log_onexit cleanup
-typeset cwd=""
-
-create_pool "$TESTPOOL" "$DISK"
+create_pool $TESTPOOL $DISK0
log_must zfs create $TESTPOOL/$TESTFS
log_must mkdir -p $TESTDIR
log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
@@ -90,7 +88,6 @@ while (( $i < ${#datasets[*]} )); do
((i = i + 1))
done
-cwd=$PWD
log_note "'zpool destroy' without '-f' will fail " \
"while pool is busy."