test/json_config: Fix string notify_get_types is compared with
The $enabled_types consisted of a newline, two tabs and a trailing space. In that form it was checked against a string that consisted of array items returned in a form of: foo bar The check initially was failing since plain [ was splitting these strings into multiple words without proper quoting in place. This could be seen in the build log: line 52: [: too many arguments This is fixed by replacing [ with [[ and using proper quoting on the rhs of the expression. Additionally, $enabled_types is now converted to an array to make the comparision more natural without worrying about the whitespaces. Change-Id: I6e3e539f36567443b36327f3bcc083de387b8474 Signed-off-by: Michal Berger <michalx.berger@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1864 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
5fbd7a9e55
commit
8109f45e1d
@ -45,12 +45,11 @@ function tgt_check_notification_types() {
|
||||
timing_enter "${FUNCNAME[0]}"
|
||||
|
||||
local ret=0
|
||||
local enabled_types="bdev_register
|
||||
bdev_unregister "
|
||||
local enabled_types=("bdev_register" "bdev_unregister")
|
||||
|
||||
get_types=$(tgt_rpc notify_get_types | jq -r '.[]')
|
||||
if [ $enabled_types != $get_types ]; then
|
||||
echo "ERROR: expected types:" $enabled_types ", but got:" $get_types
|
||||
local get_types=($(tgt_rpc notify_get_types | jq -r '.[]'))
|
||||
if [[ ${enabled_types[*]} != "${get_types[*]}" ]]; then
|
||||
echo "ERROR: expected types: ${enabled_types[*]}, but got: ${get_types[*]}"
|
||||
ret=1
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user