1c3e62d77SJim Harris#!/usr/bin/env bash 2c3e62d77SJim Harris# SPDX-License-Identifier: BSD-3-Clause 3c3e62d77SJim Harris# Copyright (C) 2022 Intel Corporation 40d0de8e7SJohn Levon# Copyright (C) 2022 Nutanix Inc. 5c3e62d77SJim Harris# All rights reserved. 6c3e62d77SJim Harris# 7c3e62d77SJim Harris 80d0de8e7SJohn Levon# Test --rpcs-allowed: only the given RPCs are allowed and reported. 90d0de8e7SJohn Levon 10c3e62d77SJim Harristestdir=$(readlink -f $(dirname $0)) 11c3e62d77SJim Harrisrootdir=$(readlink -f $testdir/../..) 12c3e62d77SJim Harrissource $rootdir/test/common/autotest_common.sh 13c3e62d77SJim Harris 1481b72533SMichal Bergertrap 'killprocess $spdk_tgt_pid' EXIT 15c3e62d77SJim Harris 160d0de8e7SJohn Levon$SPDK_BIN_DIR/spdk_tgt --rpcs-allowed spdk_get_version,rpc_get_methods & 17c3e62d77SJim Harrisspdk_tgt_pid=$! 18c3e62d77SJim Harriswaitforlisten $spdk_tgt_pid 19c3e62d77SJim Harris 200d0de8e7SJohn Levon$rootdir/scripts/rpc.py spdk_get_version 21*ac3bfcdaSMichal Berger 22*ac3bfcdaSMichal Bergerexpected_methods=() 23*ac3bfcdaSMichal Bergerexpected_methods+=("rpc_get_methods") 24*ac3bfcdaSMichal Bergerexpected_methods+=("spdk_get_version") 25*ac3bfcdaSMichal Berger 26*ac3bfcdaSMichal Bergermethods=($(rpc_cmd rpc_get_methods | jq -r ".[]" | sort)) 27*ac3bfcdaSMichal Berger((${#methods[@]} == 2)) 28*ac3bfcdaSMichal Berger[[ ${methods[*]} == "${expected_methods[*]}" ]] 290d0de8e7SJohn Levon 300d0de8e7SJohn LevonNOT $rootdir/scripts/rpc.py env_dpdk_get_mem_stats 31