aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Andrews <[email protected]>2020-10-11 15:11:06 -0500
committerBrian Behlendorf <[email protected]>2021-01-25 14:39:58 -0800
commit35ac0ed1fd78a820474658f34dd7661af1bf635f (patch)
tree4a08fc2312cbc2c9574164d97d368945d4d7181f
parenta57acbb627b20dc911cb83dd8340da0545745de0 (diff)
ZTS: improve output clarity of check_prop_source
Instead of just failing, indicate the expected and actual value and source as a NOTE. Tests using this failed in an earlier version of the changeset and this information helped find the cause. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Will Andrews <[email protected]> Closes #11517
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
index 5e9f719df..120820763 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
@@ -287,12 +287,14 @@ function check_prop_source
typeset chk_value=$(get_prop "$prop" "$dataset")
typeset chk_source=$(get_source "$prop" "$dataset")
- if [[ "$chk_value" != "$value" || "$chk_source" != "$4" ]]
- then
- return 1
- else
- return 0
- fi
+ if [[ "$chk_value" != "$value" || "$chk_source" != "$source" ]]
+ then
+ log_note "expected (value '$value', source '$source'), got \
+ (value '$chk_value', source '$chk_source')"
+ return 1
+ else
+ return 0
+ fi
}
#