diff --git a/tests/zfs-tests/include/blkdev.shlib b/tests/zfs-tests/include/blkdev.shlib index 51eff3023e73..5b505f925286 100644 --- a/tests/zfs-tests/include/blkdev.shlib +++ b/tests/zfs-tests/include/blkdev.shlib @@ -556,27 +556,15 @@ function list_file_blocks # input_file # 512B blocks for ease of use with dd. # typeset level vdev path offset length - if awk -n '' 2>/dev/null; then - # gawk needs -n to decode hex - AWK='awk -n' - else - AWK='awk' - fi sync_all_pools true - zdb -dddddd $ds $objnum | $AWK -v pad=$((4<<20)) -v bs=512 ' + zdb -dddddd $ds $objnum | awk ' /^$/ { looking = 0 } looking { level = $2 field = 3 while (split($field, dva, ":") == 3) { - # top level vdev id - vdev = int(dva[1]) - # offset + 4M label/boot pad in 512B blocks - offset = (int("0x"dva[2]) + pad) / bs - # length in 512B blocks - len = int("0x"dva[3]) / bs - print level, vdev, offset, len + print level, int(dva[1]), "0x"dva[2], "0x"dva[3] ++field } @@ -585,7 +573,8 @@ function list_file_blocks # input_file ' | \ while read level vdev offset length; do for path in ${VDEV_MAP[$vdev][@]}; do - echo "$level $path $offset $length" + echo "$level $path $(( ($offset + (4<<20)) / 512 ))" \ + "$(( $length / 512 ))" done done 2>/dev/null } diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh index c96961bf6419..679362bbef50 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh @@ -103,21 +103,16 @@ log_must zpool export $TESTPOOL1 log_must set_tunable64 METASLAB_DEBUG_LOAD 1 log_note "Starting zpool import in background at" $(date +'%H:%M:%S') zpool import -d $DEVICE_DIR -f $guid & -pid=$! # # capture progress until import is finished # -log_note waiting for pid $pid to exit kstat import_progress -while [[ -d /proc/"$pid" ]]; do +while [[ -n $(jobs) ]]; do line=$(kstat import_progress | grep -v pool_guid) if [[ -n $line ]]; then echo $line fi - if [[ -f /$TESTPOOL1/fs/00 ]]; then - break; - fi sleep 0.0001 done log_note "zpool import completed at" $(date +'%H:%M:%S') diff --git a/tests/zfs-tests/tests/functional/redacted_send/redacted_panic.ksh b/tests/zfs-tests/tests/functional/redacted_send/redacted_panic.ksh index 032d1fb91a2e..a2438c2cd731 100755 --- a/tests/zfs-tests/tests/functional/redacted_send/redacted_panic.ksh +++ b/tests/zfs-tests/tests/functional/redacted_send/redacted_panic.ksh @@ -39,7 +39,7 @@ function cleanup log_onexit cleanup log_must zfs create -o recsize=8k $sendfs -log_must dd if=/dev/urandom of=/$sendfs/file bs=1024k count=2048 +log_must dd if=/dev/urandom of=/$sendfs/file bs=1024k count=1024 log_must zfs snapshot $sendfs@init log_must zfs clone $sendfs@init $clone log_must stride_dd -i /dev/urandom -o /$clone/file -b 8192 -s 2 -c 7226