1#!/usr/bin/env bash 2# SPDX-License-Identifier: BSD-3-Clause 3# Copyright (C) 2022 Intel Corporation 4# Copyright (C) 2022 Nutanix Inc. 5# All rights reserved. 6# 7 8# Test --rpcs-allowed: only the given RPCs are allowed and reported. 9 10testdir=$(readlink -f $(dirname $0)) 11rootdir=$(readlink -f $testdir/../..) 12source $rootdir/test/common/autotest_common.sh 13 14trap 'killprocess $spdk_tgt_pid' EXIT 15 16$SPDK_BIN_DIR/spdk_tgt --rpcs-allowed spdk_get_version,rpc_get_methods & 17spdk_tgt_pid=$! 18waitforlisten $spdk_tgt_pid 19 20$rootdir/scripts/rpc.py spdk_get_version 21 22expected_methods=() 23expected_methods+=("rpc_get_methods") 24expected_methods+=("spdk_get_version") 25 26methods=($(rpc_cmd rpc_get_methods | jq -r ".[]" | sort)) 27((${#methods[@]} == 2)) 28[[ ${methods[*]} == "${expected_methods[*]}" ]] 29 30NOT $rootdir/scripts/rpc.py env_dpdk_get_mem_stats 31