ZTS: Remove some path workarounds for FreeBSD
These are no longer needed after fixing device name matching for whole disks in libzutil on FreeBSD. Reviewed-by: Igor Kozhukhov <igor@dilos.org> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl> Signed-off-by: Ryan Moeller <ryan@ixsystems.com> Closes #9839
This commit is contained in:
parent
2476f10306
commit
900010daf1
|
@ -40,12 +40,12 @@ function cleanup
|
||||||
for DISK in $DISKS; do
|
for DISK in $DISKS; do
|
||||||
zpool labelclear -f $DEV_RDSKDIR/$DISK
|
zpool labelclear -f $DEV_RDSKDIR/$DISK
|
||||||
done
|
done
|
||||||
if is_freebsd ; then
|
if is_freebsd; then
|
||||||
log_must sysctl kern.geom.debugflags=$saved_debugflags
|
log_must sysctl kern.geom.debugflags=$saved_debugflags
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if is_freebsd ; then
|
if is_freebsd; then
|
||||||
# FreeBSD won't allow writing to an in-use device without this set
|
# FreeBSD won't allow writing to an in-use device without this set
|
||||||
saved_debugflags=$(sysctl -n kern.geom.debugflags)
|
saved_debugflags=$(sysctl -n kern.geom.debugflags)
|
||||||
log_must sysctl kern.geom.debugflags=16
|
log_must sysctl kern.geom.debugflags=16
|
||||||
|
@ -54,32 +54,21 @@ fi
|
||||||
verify_runnable "global"
|
verify_runnable "global"
|
||||||
verify_disk_count "$DISKS" 2
|
verify_disk_count "$DISKS" 2
|
||||||
set -A DISK $DISKS
|
set -A DISK $DISKS
|
||||||
if is_freebsd ; then
|
|
||||||
WHOLE_DISK=/dev/${DISK[0]}
|
|
||||||
else
|
|
||||||
WHOLE_DISK=${DISK[0]}
|
|
||||||
fi
|
|
||||||
|
|
||||||
default_mirror_setup_noexit $DISKS
|
default_mirror_setup_noexit $DISKS
|
||||||
DEVS=$(get_pool_devices ${TESTPOOL} ${DEV_RDSKDIR})
|
DEVS=$(get_pool_devices ${TESTPOOL} ${DEV_RDSKDIR})
|
||||||
[[ -n $DEVS ]] && set -A DISK $DEVS
|
[[ -n $DEVS ]] && set -A DISK $DEVS
|
||||||
|
|
||||||
log_must zpool offline $TESTPOOL ${WHOLE_DISK}
|
log_must zpool offline $TESTPOOL ${DISK[0]}
|
||||||
log_must dd if=/dev/urandom of=$TESTDIR/testfile bs=1K count=2
|
log_must dd if=/dev/urandom of=$TESTDIR/testfile bs=1K count=2
|
||||||
log_must zpool export $TESTPOOL
|
log_must zpool export $TESTPOOL
|
||||||
|
|
||||||
log_must dd if=$DEV_RDSKDIR/${DISK[0]} of=$DEV_RDSKDIR/${DISK[1]} bs=1K count=256 conv=notrunc
|
log_must dd if=$DEV_RDSKDIR/${DISK[0]} of=$DEV_RDSKDIR/${DISK[1]} bs=1K count=256 conv=notrunc
|
||||||
|
|
||||||
if is_freebsd; then
|
ubs=$(zdb -lu ${DISK[1]} | grep -e LABEL -e Uberblock -e 'labels = ')
|
||||||
DISK1="/dev/${DISK[1]}"
|
|
||||||
else
|
|
||||||
DISK1="${DISK[1]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
ubs=$(zdb -lu ${DISK1} | grep -e LABEL -e Uberblock -e 'labels = ')
|
|
||||||
log_note "vdev 1: ubs $ubs"
|
log_note "vdev 1: ubs $ubs"
|
||||||
|
|
||||||
ub_dump_counts=$(zdb -lu ${DISK1} | \
|
ub_dump_counts=$(zdb -lu ${DISK[1]} | \
|
||||||
awk ' /LABEL/ {label=$NF; blocks[label]=0};
|
awk ' /LABEL/ {label=$NF; blocks[label]=0};
|
||||||
/Uberblock/ {blocks[label]++};
|
/Uberblock/ {blocks[label]++};
|
||||||
END {print blocks[0],blocks[1],blocks[2],blocks[3]}')
|
END {print blocks[0],blocks[1],blocks[2],blocks[3]}')
|
||||||
|
|
Loading…
Reference in New Issue