lib/rpc: Test if aliases are handled properly.

Use old rpc in conf.json to check
if rpc alias if handled properly.

Change-Id: I466e39dd6b4adf140225060e46752250ae30ddb4
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465666
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Pawel Kaminski 2019-08-19 08:48:34 -04:00 committed by Jim Harris
parent 4368937b4e
commit eb401ec12e
3 changed files with 65 additions and 0 deletions

View File

@ -151,6 +151,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
run_test suite test/env/env.sh
run_test suite test/rpc_client/rpc_client.sh
run_test suite ./test/json_config/json_config.sh
run_test suite test/json_config/alias_rpc/alias_rpc.sh
if [ $SPDK_TEST_BLOCKDEV -eq 1 ]; then
run_test suite test/bdev/blockdev.sh

View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
trap 'killprocess $spdk_tgt_pid; exit 1' ERR
$rootdir/app/spdk_tgt/spdk_tgt &
spdk_tgt_pid=$!
waitforlisten $spdk_tgt_pid
# Test deprecated rpcs in json
cat $testdir/conf.json | $rootdir/scripts/rpc.py load_config -i
# Test deprecated rpcs in rpc.py
$rootdir/scripts/rpc.py delete_malloc_bdev "Malloc0"
$rootdir/scripts/rpc.py delete_malloc_bdev "Malloc1"
killprocess $spdk_tgt_pid

View File

@ -0,0 +1,44 @@
{
"subsystems": [
{
"subsystem": "copy",
"config": null
},
{
"subsystem": "interface",
"config": null
},
{
"subsystem": "net_framework",
"config": null
},
{
"subsystem": "bdev",
"config": [
{
"params": {
"block_size": 4096,
"num_blocks": 32
},
"method": "construct_malloc_bdev"
},
{
"params": {
"name": "Malloc1",
"block_size": 4096,
"num_blocks": 32
},
"method": "construct_malloc_bdev"
}
]
},
{
"subsystem": "nbd",
"config": []
},
{
"subsystem": "scsi",
"config": null
}
]
}