summaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests
diff options
context:
space:
mode:
authorJohn Wren Kennedy <[email protected]>2019-10-18 19:27:02 +0200
committerBrian Behlendorf <[email protected]>2019-10-18 13:27:02 -0400
commit4063440b73af79be9792029ada17b01c51ad7172 (patch)
treefbfcabdf780eb1264ba06dd0f1124741fce0eb57 /tests/zfs-tests
parent9f3c72a2a849dcf121679cb483be33b68880c519 (diff)
ZTS: Written props test fails with 4k disks
With 4k disks, this test will fail in the last section because the expected human readable value of 20.0M is reported as 20.1M. Rather than use the human readable property, switch to the parsable property and verify that the values are reasonably close. Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: John Kennedy <[email protected]> Closes #9477
Diffstat (limited to 'tests/zfs-tests')
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_property/zfs_written_property_001_pos.ksh10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_property/zfs_written_property_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_property/zfs_written_property_001_pos.ksh
index 9a2d3cb80..cbbacace1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_property/zfs_written_property_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_property/zfs_written_property_001_pos.ksh
@@ -11,7 +11,7 @@
#
#
-# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2017 by Delphix. All rights reserved.
#
#
@@ -216,15 +216,15 @@ for ds in $datasets; do
count=$blocks
sync_pool
done
-recursive_output=$(zfs get -r written@current $TESTPOOL | \
+recursive_output=$(zfs get -p -r written@current $TESTPOOL | \
grep -v $TESTFS1@ | grep -v $TESTFS2@ | grep -v $TESTFS3@ | \
grep -v "VALUE" | grep -v "-")
-expected="20.0M"
+expected="$((20 * mb_block))"
for ds in $datasets; do
writtenat=$(echo "$recursive_output" | grep -v $ds/)
writtenat=$(echo "$writtenat" | grep $ds | awk '{print $3}')
- [[ $writtenat == $expected ]] || \
- log_fail "recursive written property output mismatch"
+ within_percent $writtenat $expected 99.5 || \
+ log_fail "Unexpected written@ value on $ds"
done
log_pass "zfs written and written@ property fields print correct values"