Commit f3244a4f authored by Krzysztof Sprzaczkowski's avatar Krzysztof Sprzaczkowski Committed by Tomasz Zawadzki
Browse files

test/accel: Add script to test accel RPC methods for DSA module



The accel dsa_scan_accel_module may be performed to use
the DSA Module before starting the framework but double-calling
of this function is not allowed.

The RPC accel_assign_opc method may be performed to override
the operation code assignments to modules before starting
the framework. So, the assigned opcode can be verified after
starting the framework.

Change-Id: I51292520471c3c56a875d80f29d71624ce7b33b7
Signed-off-by: default avatarKrzysztof Sprzaczkowski <krzysztof.sprzaczkowski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21162


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 3cac0518
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
	run_test "event" $rootdir/test/event/event.sh
	run_test "thread" $rootdir/test/thread/thread.sh
	run_test "accel" $rootdir/test/accel/accel.sh
	run_test "accel_rpc" $rootdir/test/accel/accel_rpc.sh
	run_test "app_cmdline" $rootdir/test/app/cmdline.sh
	run_test "version" $rootdir/test/app/version.sh

+0 −12
Original line number Diff line number Diff line
@@ -85,15 +85,3 @@ if [[ $CONFIG_DPDK_COMPRESSDEV == y ]]; then
	run_test "accel_cdev_deomp_full_mthread" accel_perf -t 1 -w decompress -l $testdir/bib -y -o 0 -T 2
	unset COMPRESSDEV
fi

trap 'killprocess $spdk_tgt_pid; exit 1' ERR

$SPDK_BIN_DIR/spdk_tgt --wait-for-rpc &
spdk_tgt_pid=$!
waitforlisten $spdk_tgt_pid

$rpc_py accel_assign_opc -o copy -m software
$rpc_py framework_start_init
$rpc_py accel_get_opc_assignments | jq -r '.copy' | grep software

killprocess $spdk_tgt_pid
+40 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash
#  SPDX-License-Identifier: BSD-3-Clause
#  Copyright (C) 2023 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

$SPDK_BIN_DIR/spdk_tgt --wait-for-rpc &
spdk_tgt_pid=$!
waitforlisten $spdk_tgt_pid

# The RPC dsa_scan_accel_module method may be performed to use the DSA Module
# before starting the framework.
# Should FAIL - double-calling of this function is not allowed.
function accel_scan_dsa_modules_test_suite() {
	$rpc_py dsa_scan_accel_module
	NOT $rpc_py dsa_scan_accel_module
}

# The RPC accel_assign_opc method may be performed to override the operation code
# assignments to modules before starting the framework.
# Should PASS - opcode assignments can be verified after starting the framework.
function accel_assign_opcode_test_suite() {
	$rpc_py accel_assign_opc -o copy -m software
	$rpc_py framework_start_init
	$rpc_py accel_get_opc_assignments | jq -r '.copy' | grep software
}

if [[ $CONFIG_IDXD == y && $SPDK_TEST_ACCEL_DSA -gt 0 ]]; then
	run_test "accel_scan_dsa_modules" accel_scan_dsa_modules_test_suite
fi

run_test "accel_assign_opcode" accel_assign_opcode_test_suite

killprocess $spdk_tgt_pid
+3 −0
Original line number Diff line number Diff line
@@ -38,6 +38,9 @@ vmd_hello_world
vmd_identify
vmd_perf

# Waiting for CI tests on the platform equipped with DSA
accel_scan_dsa_modules

# nightly tests
bdev_fio_rw_verify_ext
bdev_fio_trim_ext