Spdk/test/bdev
tongkunkun bb432b4eea json: fix parsing json problems when json config is invalid.
Add parsing json as invalid cases:
1.json content that not enclosed in {}, it should be parsed as invalid, e.g.

"abc":"not encloesed in {}"

2.json content that 'subsystems' not associate with array, it will report error and return failure, e.g.

{"subsystems":"123"}

3.handle other invalid json formats, report and return failure, e.g. duplicate keys.

Added `spdk_json_find` API return errcode: EPROTOTYPE - json not enclosed in {}.

json config with content:
1."not enclosed in {}"
2."'subsystems' not be an array"
3."duplicate key in json"
and some other invaild cases will be regarded as invalid json config, and will fail to start app.

Fixes #2599

Signed-off-by: tongkunkun <tongkunkun_yewu@cmss.chinamobile.com>
Change-Id: I02574c9acd7671e336d4c589ebbff8ed21eb3681
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13754
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-02 07:32:21 +00:00
..
bdevio test/bdevio: fix missing free 2022-08-23 07:20:27 +00:00
bdevperf accel: Rename public header to accel.h 2022-08-16 10:22:55 +00:00
bdev_raid.sh autotest_common.sh: change rpc_py to rpc_cmd 2022-09-01 11:15:03 +00:00
blockdev.sh json: fix parsing json problems when json config is invalid. 2022-09-02 07:32:21 +00:00
Makefile Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
nbd_common.sh tests: Switch to $SPDK_TEST_STORAGE for writing out bigger tmp files 2020-05-20 14:17:02 +00:00
nonarray.json json: fix parsing json problems when json config is invalid. 2022-09-02 07:32:21 +00:00
nonenclosed.json json: fix parsing json problems when json config is invalid. 2022-09-02 07:32:21 +00:00