aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-02-13 15:10:36 -0500
committerGitHub <[email protected]>2020-02-13 12:10:35 -0800
commit3bdc4f6314ab55d1ee78ec8a2a6b77e5a3282ca3 (patch)
tree888c3a22ad923aebe583baa097a6444c1cd2ff83
parent3e725f0ad2d379f3bff42ac3127a5948226274fd (diff)
ZTS: Eliminate partitioning from zpool_remove
These tests do not need to use partitions. Get rid of the partitioning and just use the disks directly. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #9996
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_remove/setup.ksh6
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove.cfg27
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh11
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_002_pos.ksh5
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_003_pos.ksh10
5 files changed, 12 insertions, 47 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/setup.ksh
index c63e17945..8ce094bcc 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/setup.ksh
@@ -34,10 +34,4 @@
verify_runnable "global"
-if ! is_physical_device $DISKS ; then
- log_unsupported "This directory cannot be run on raw files."
-fi
-
-partition_disk $SIZE $DISK 6
-
log_pass
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove.cfg
index bf4b3e3d0..1b8312e99 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove.cfg
@@ -28,29 +28,4 @@
# Copyright (c) 2012 by Delphix. All rights reserved.
#
-export DISK=${DISKS%% *}
-export SIZE="200m"
-export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}')
-export DISKSARRAY=$DISKS
-
-if is_linux; then
- set_device_dir
- set_slice_prefix
- export SLICE0=1
- export SLICE1=2
- export SLICE2=3
- export SLICE3=4
- export SLICE4=5
- export SLICE5=6
- export SLICE6=7
- export SLICE7=8
-else
- export SLICE0=0
- export SLICE1=1
- export SLICE2=2
- export SLICE3=3
- export SLICE4=4
- export SLICE5=5
- export SLICE6=6
- export SLICE7=7
-fi
+echo $DISKS | read DISK0 DISK1 DISK2
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh
index 365e86cfa..0c098a61e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh
@@ -42,14 +42,13 @@
# 3. Verify that the remove failed.
#
-typeset disk=${DISK}
-typeset vdev_devs="${disk}${SLICE_PREFIX}${SLICE0}"
-typeset mirror_devs="${disk}${SLICE_PREFIX}${SLICE0} ${disk}${SLICE_PREFIX}${SLICE1}"
+typeset vdev_devs="${DISK0}"
+typeset mirror_devs="${DISK0} ${DISK1}"
typeset raidz_devs=${mirror_devs}
typeset raidz1_devs=${mirror_devs}
-typeset raidz2_devs="${mirror_devs} ${disk}${SLICE_PREFIX}${SLICE3}"
-typeset spare_devs1="${disk}${SLICE_PREFIX}${SLICE0}"
-typeset spare_devs2="${disk}${SLICE_PREFIX}${SLICE1}"
+typeset raidz2_devs="${mirror_devs} ${DISK2}"
+typeset spare_devs1="${DISK0}"
+typeset spare_devs2="${DISK1}"
function check_remove
{
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_002_pos.ksh
index 340735aa0..4ab7ac659 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_002_pos.ksh
@@ -50,10 +50,9 @@ function cleanup
}
log_onexit cleanup
-typeset disk=${DISK}
-typeset spare_devs1="${disk}${SLICE_PREFIX}${SLICE0}"
-typeset spare_devs2="${disk}${SLICE_PREFIX}${SLICE1}"
+typeset spare_devs1="${DISK0}"
+typeset spare_devs2="${DISK1}"
log_assert "zpool remove can only remove inactive hotspare device from pool"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_003_pos.ksh
index c27c4c7d8..4e132d9d0 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_003_pos.ksh
@@ -54,17 +54,15 @@ function cleanup
log_onexit cleanup
typeset disk=${DISK}
-typeset spare_devs1="${disk}${SLICE_PREFIX}${SLICE0}"
-typeset spare_devs2="${disk}${SLICE_PREFIX}${SLICE1}"
-typeset spare_devs3="${disk}${SLICE_PREFIX}${SLICE3}"
-typeset spare_devs4="${disk}${SLICE_PREFIX}${SLICE4}"
+typeset spare_devs1="${DISK0}"
+typeset spare_devs2="${DISK1}"
+typeset spare_devs3="${DISK2}"
log_assert "zpool remove can remove hotspare device which state go though" \
" active to inactive in pool"
log_note "Check spare device which state go through active to inactive"
-log_must zpool create $TESTPOOL $spare_devs1 $spare_devs2 spare \
- $spare_devs3 $spare_devs4
+log_must zpool create $TESTPOOL $spare_devs1 $spare_devs2 spare $spare_devs3
log_must zpool replace $TESTPOOL $spare_devs2 $spare_devs3
log_mustnot zpool remove $TESTPOOL $spare_devs3
log_must zpool detach $TESTPOOL $spare_devs3