From 35ac0ed1fd78a820474658f34dd7661af1bf635f Mon Sep 17 00:00:00 2001
From: Will Andrews <will@firepipe.net>
Date: Sun, 11 Oct 2020 15:11:06 -0500
Subject: [PATCH] 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 <behlendorf1@llnl.gov>
Signed-off-by:	Will Andrews <will@firepipe.net>
Closes #11517
---
 .../cli_root/zfs_set/zfs_set_common.kshlib         | 14 ++++++++------
 1 file 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 5e9f719dfcfe..12082076322c 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
 }
 
 #