From 9c536b9a7824f17ab85ba9dfafc95f65eac68e0e Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Wed, 12 Feb 2020 16:01:55 -0500 Subject: [PATCH] ZTS: Fix zdb_display_block on FreeBSD Missed this in the review, but wc output on FreeBSD is indented, so string comparisons mismatch when comparing to an unindented number. Compare counts as integers instead of strings. Reviewed-by: Igor Kozhukhov Reviewed-by: Brian Behlendorf Reviewed-by: John Kennedy Reviewed-by: Paul Zuchowski Signed-off-by: Ryan Moeller Closes #9980 --- .../tests/functional/cli_root/zdb/zdb_display_block.ksh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_display_block.ksh b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_display_block.ksh index c8a52def40..5cc4575851 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_display_block.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_display_block.ksh @@ -111,7 +111,7 @@ offset=$(echo "$dva" |awk '{split($0,array,":")} END{print array[2]}') output=$(export ZDB_NO_ZLE=\"true\";\ zdb -R $TESTPOOL $vdev:$offset:$l1_read_size:id 2> /dev/null) block_cnt=$(echo "$output" | grep 'L0' | wc -l) -if [ "$block_cnt" != "$write_count" ]; then +if [ $block_cnt -ne $write_count ]; then log_fail "zdb -R :id (indirect block display) failed" fi @@ -121,7 +121,7 @@ log_note "Reading from DVA $vdev:$offset:$l1_read_size" output=$(export ZDB_NO_ZLE=\"true\";\ zdb -R $TESTPOOL $vdev:$offset:$l1_read_size:id 2> /dev/null) block_cnt=$(echo "$output" | grep 'L0' | wc -l) -if [ "$block_cnt" != "$write_count" ]; then +if [ $block_cnt -ne $write_count ]; then log_fail "zdb -R 0.0:offset:length:id (indirect block display) failed" fi