From c3e62d77295b3e4cf4108377c3ef8d5350003710 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Sat, 5 Nov 2022 04:23:30 +0000 Subject: [PATCH] test: add new cmdline.sh test script This can be used to test various app command line parameters - in this case, the new RPC allowlist parameter. Signed-off-by: Jim Harris Change-Id: Iaa0e90940ac4fb0b044ab96bc2912afa9f48ddae Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15310 Reviewed-by: Paul Luse Reviewed-by: Aleksey Marchuk Tested-by: SPDK CI Jenkins --- autotest.sh | 2 ++ test/app/cmdline.sh | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 test/app/cmdline.sh diff --git a/autotest.sh b/autotest.sh index d92a0e93b..19cc820a7 100755 --- a/autotest.sh +++ b/autotest.sh @@ -162,6 +162,8 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then run_test "event" test/event/event.sh run_test "thread" test/thread/thread.sh run_test "accel" test/accel/accel.sh + # Uncomment this line when ready + # run_test "app_cmdline" test/app/cmdline.sh if [ $SPDK_TEST_BLOCKDEV -eq 1 ]; then run_test "blockdev_general" test/bdev/blockdev.sh diff --git a/test/app/cmdline.sh b/test/app/cmdline.sh new file mode 100755 index 000000000..ee7444039 --- /dev/null +++ b/test/app/cmdline.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (C) 2022 Intel Corporation +# All rights reserved. +# + +testdir=$(readlink -f $(dirname $0)) +rootdir=$(readlink -f $testdir/../..) +source $rootdir/test/common/autotest_common.sh + +trap 'killprocess $spdk_tgt_pid; exit 1' ERR + +# Add an allowlist here... +$SPDK_BIN_DIR/spdk_tgt & +spdk_tgt_pid=$! +waitforlisten $spdk_tgt_pid + +# Do both some positive and negative testing on that allowlist here... +# You can use the NOT() function to help with the negative test +# $rootdir/scripts/rpc.py some_rpc + +killprocess $spdk_tgt_pid