From 900010daf1d45f970917dc0169c754e59a59ad07 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Wed, 15 Jan 2020 12:24:55 -0500 Subject: [PATCH] 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 Reviewed-by: John Kennedy Reviewed-by: Brian Behlendorf Reviewed-by: Kjeld Schouten Signed-off-by: Ryan Moeller Closes #9839 --- .../functional/cli_root/zdb/zdb_004_pos.ksh | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_004_pos.ksh index 2adaf8facf..b20eee6729 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_004_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_004_pos.ksh @@ -40,12 +40,12 @@ function cleanup for DISK in $DISKS; do zpool labelclear -f $DEV_RDSKDIR/$DISK done - if is_freebsd ; then + if is_freebsd; then log_must sysctl kern.geom.debugflags=$saved_debugflags fi } -if is_freebsd ; then +if is_freebsd; then # FreeBSD won't allow writing to an in-use device without this set saved_debugflags=$(sysctl -n kern.geom.debugflags) log_must sysctl kern.geom.debugflags=16 @@ -54,32 +54,21 @@ fi verify_runnable "global" verify_disk_count "$DISKS" 2 set -A DISK $DISKS -if is_freebsd ; then - WHOLE_DISK=/dev/${DISK[0]} -else - WHOLE_DISK=${DISK[0]} -fi default_mirror_setup_noexit $DISKS DEVS=$(get_pool_devices ${TESTPOOL} ${DEV_RDSKDIR}) [[ -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 zpool export $TESTPOOL log_must dd if=$DEV_RDSKDIR/${DISK[0]} of=$DEV_RDSKDIR/${DISK[1]} bs=1K count=256 conv=notrunc -if is_freebsd; then - DISK1="/dev/${DISK[1]}" -else - DISK1="${DISK[1]}" -fi - -ubs=$(zdb -lu ${DISK1} | grep -e LABEL -e Uberblock -e 'labels = ') +ubs=$(zdb -lu ${DISK[1]} | grep -e LABEL -e Uberblock -e 'labels = ') 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}; /Uberblock/ {blocks[label]++}; END {print blocks[0],blocks[1],blocks[2],blocks[3]}')