Commit 4af13749 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

test/json_config: Sort notifications



On some systems it's been noticed that the lvol notifications were
being recorded out of the expected order. Null and void similar
discrepancy by sorting all the events.

Change-Id: I31a8695d07d20b4a10d847c118107f5e4d65aabe
Signed-off-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/18526


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 0db4d79d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -70,10 +70,10 @@ function tgt_check_notifications() {
	local events_to_check
	local recorded_events

	events_to_check=("$@")
	recorded_events=($(get_notifications))
	# Seems like notifications don't necessarily have to come in order, so make sure they are sorted
	events_to_check=($(printf '%s\n' "$@" | sort))
	recorded_events=($(get_notifications | sort))

	# These should be in order hence compare entire arrays
	if [[ ${events_to_check[*]} != "${recorded_events[*]}" ]]; then
		cat <<- ERROR
			Expected events did not match.