Commit a07b9b7e authored by Anton Nayshtut's avatar Anton Nayshtut Committed by Tomasz Zawadzki
Browse files

test/json_config/json_config.sh: order-agnostic comparison



It seems that notify_get_types RPC does not guarantee the order. This is
probably due to the dynamic loader's logic the SOs are, in turn, loaded
in a nondeterministic order.

This patch replaces the array comparison in the tgt_check_notification_types()
by an order-agnostic one.

Change-Id: I10d6008bfd188f6843495b62305396304007a215
Signed-off-by: default avatarAnton Nayshtut <anayshtut@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24104


Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent e4e763a5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -46,7 +46,11 @@ function tgt_check_notification_types() {
	local enabled_types=("bdev_register" "bdev_unregister")

	local get_types=($(tgt_rpc notify_get_types | jq -r '.[]'))
	if [[ ${enabled_types[*]} != "${get_types[*]}" ]]; then

	local type_diff
	type_diff=$(echo "${enabled_types[@]}" "${get_types[@]}" | tr ' ' '\n' | sort | uniq -u)

	if [[ -n "$type_diff" ]]; then
		echo "ERROR: expected types: ${enabled_types[*]}, but got: ${get_types[*]}"
		ret=1
	fi