xref: /spdk/test/json_config/json_config_extra_key.sh (revision 8ca6dbcdc56a4d16be5d9ac9c376e71ec463e4c8)
1921c92e2STom Nabarro#!/usr/bin/env bash
2eb53c232Spaul luse#  SPDX-License-Identifier: BSD-3-Clause
3eb53c232Spaul luse#  Copyright (C) 2021 Intel Corporation
4eb53c232Spaul luse#  All rights reserved.
5eb53c232Spaul luse#
6921c92e2STom Nabarro
7921c92e2STom Nabarrorootdir=$(readlink -f $(dirname $0)/../..)
8921c92e2STom Nabarrosource "$rootdir/test/common/autotest_common.sh"
9921c92e2STom Nabarrosource "$rootdir/test/nvmf/common.sh"
10*8ca6dbcdSKrzysztof Karassource "$rootdir/test/json_config/common.sh"
11921c92e2STom Nabarro
12921c92e2STom Nabarro# Check that adding arbitrary top-level key to JSON SPDK config alongside
13921c92e2STom Nabarro# "subsystems" doesn't break SPDK parsing that occurs when loading config
14921c92e2STom Nabarro# to initialize subsystems. This enables applications to use the same config
15921c92e2STom Nabarro# file to communicate private and SPDK data.
16921c92e2STom Nabarro
17921c92e2STom Nabarrodeclare -A app_pid=([target]="")
18921c92e2STom Nabarrodeclare -A app_socket=([target]='/var/tmp/spdk_tgt.sock')
19921c92e2STom Nabarrodeclare -A app_params=([target]='-m 0x1 -s 1024')
20921c92e2STom Nabarrodeclare -A configs_path=([target]="$rootdir/test/json_config/extra_key.json")
21921c92e2STom Nabarro
22921c92e2STom Nabarrotrap 'on_error_exit "${FUNCNAME}" "${LINENO}"' ERR
23921c92e2STom Nabarro
24921c92e2STom Nabarroecho "INFO: launching applications..."
25921c92e2STom Nabarrojson_config_test_start_app target --json ${configs_path[target]}
26921c92e2STom Nabarro
27921c92e2STom Nabarroecho "INFO: shutting down applications..."
28921c92e2STom Nabarrojson_config_test_shutdown_app target
29921c92e2STom Nabarro
30921c92e2STom Nabarroecho "Success"
31