2022-11-05 04:23:30 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2022 Intel Corporation
|
2022-11-04 17:01:11 +00:00
|
|
|
# Copyright (C) 2022 Nutanix Inc.
|
2022-11-05 04:23:30 +00:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
|
2022-11-04 17:01:11 +00:00
|
|
|
# Test --rpcs-allowed: only the given RPCs are allowed and reported.
|
|
|
|
|
2022-11-05 04:23:30 +00:00
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../..)
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
|
|
|
|
trap 'killprocess $spdk_tgt_pid; exit 1' ERR
|
|
|
|
|
2022-11-04 17:01:11 +00:00
|
|
|
$SPDK_BIN_DIR/spdk_tgt --rpcs-allowed spdk_get_version,rpc_get_methods &
|
2022-11-05 04:23:30 +00:00
|
|
|
spdk_tgt_pid=$!
|
|
|
|
waitforlisten $spdk_tgt_pid
|
|
|
|
|
2022-11-04 17:01:11 +00:00
|
|
|
$rootdir/scripts/rpc.py spdk_get_version
|
|
|
|
declare -a methods=($(rpc_cmd rpc_get_methods | jq -rc ".[]"))
|
|
|
|
[[ "${methods[0]}" = "spdk_get_version" ]]
|
|
|
|
[[ "${methods[1]}" = "rpc_get_methods" ]]
|
|
|
|
[[ "${#methods[@]}" = 2 ]]
|
|
|
|
|
|
|
|
NOT $rootdir/scripts/rpc.py env_dpdk_get_mem_stats
|
2022-11-05 04:23:30 +00:00
|
|
|
|
|
|
|
killprocess $spdk_tgt_pid
|