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 <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #9996
This commit is contained in:
Ryan Moeller 2020-02-13 15:10:36 -05:00 committed by GitHub
parent 3e725f0ad2
commit 3bdc4f6314
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 47 deletions

View File

@ -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

View File

@ -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

View File

@ -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
{

View File

@ -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"

View File

@ -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