Commit b64ff135 authored by paul luse's avatar paul luse Committed by Darek Stojaczyk
Browse files

test/compress: add bdevio and bdevperf tests



Will execute short run per patch, longer nightly. This
path only covers the ISAL PMD as there are QAT upgrades
needed in CI. It does so by using the new 'perform_tests'
RPC in both bdevio and bdevperf.

Change-Id: I93afda336d7411b695b2ddd0332cce0050d075a4
Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455113


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBroadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarChunyang Hui <chunyang.hui@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent a81bdcf3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -148,6 +148,10 @@ fi
if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
	timing_enter lib

        if [ $SPDK_TEST_REDUCE -eq 1 ]; then
                run_test suite ./test/compress/compress.sh
        fi

	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
+2 −1
Original line number Diff line number Diff line
@@ -80,7 +80,8 @@ spdk_rpc_set_compress_pmd(struct spdk_jsonrpc_request *request,
		spdk_jsonrpc_end_result(request, w);
	}
}
SPDK_RPC_REGISTER("set_compress_pmd", spdk_rpc_set_compress_pmd, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER("set_compress_pmd", spdk_rpc_set_compress_pmd,
		  SPDK_RPC_STARTUP | SPDK_RPC_RUNTIME)

/* Structure to hold the parameters for this RPC method. */
struct rpc_construct_compress {
+72 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash

set -e

testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
plugindir=$rootdir/examples/bdev/fio_plugin
rpc_py="$rootdir/scripts/rpc.py"
source "$rootdir/scripts/common.sh"
source "$rootdir/test/common/autotest_common.sh"

function compress_err_cleanup() {
	rm -rf /tmp/pmem
	$rootdir/examples/nvme/perf/perf -q 1 -o 131072 -w write -t 2
}

# use the bdev svc to create a compress bdev, this assumes
# there is no other metadata on the nvme device, we will put a
# compress vol on a thin provisioned lvol on nvme
mkdir -p /tmp/pmem
$rootdir/test/app/bdev_svc/bdev_svc &
bdev_svc_pid=$!
trap "killprocess $bdev_svc_pid; compress_err_cleanup; exit 1" SIGINT SIGTERM EXIT
waitforlisten $bdev_svc_pid
bdf=$(iter_pci_class_code 01 08 02 | head -1)
$rpc_py construct_nvme_bdev -b "Nvme0" -t "pcie" -a $bdf
lvs_u=$($rpc_py construct_lvol_store Nvme0n1 lvs0)
$rpc_py construct_lvol_bdev -t -u $lvs_u lv0 100
# this will force isal_pmd as some of the CI systems need a qat driver update
$rpc_py set_compress_pmd -p 2
compress_bdev=$($rpc_py construct_compress_bdev -b lvs0/lv0 -p /tmp)
trap - SIGINT SIGTERM EXIT
killprocess $bdev_svc_pid

# run bdevio test
timing_enter compress_test
$rootdir/test/bdev/bdevio/bdevio -w &
bdevio_pid=$!
trap "killprocess $bdevio_pid; compress_err_cleanup; exit 1" SIGINT SIGTERM EXIT
waitforlisten $bdevio_pid
$rpc_py set_compress_pmd -p 2
$rpc_py construct_nvme_bdev -b "Nvme0" -t "pcie" -a $bdf
waitforbdev $compress_bdev
$rootdir/test/bdev/bdevio/tests.py perform_tests
trap - SIGINT SIGTERM EXIT
killprocess $bdevio_pid

#run bdevperf with slightly different params for nightly
qd=32
runtime=3
iosize=4096
if [ $RUN_NIGHTLY -eq 1 ]; then
	qd=64
	runtime=30
	iosize=16384
fi
$rootdir/test/bdev/bdevperf/bdevperf -z -q $qd  -o $iosize -w verify -t $runtime &
bdevperf_pid=$!
trap "killprocess $bdevperf_pid; compress_err_cleanup; exit 1" SIGINT SIGTERM EXIT
waitforlisten $bdevperf_pid
$rpc_py set_compress_pmd -p 2
$rpc_py construct_nvme_bdev -b "Nvme0" -t "pcie" -a $bdf
waitforbdev $compress_bdev
$rootdir/test/bdev/bdevperf/bdevperf.py perform_tests

# now cleanup the vols, deleting the compression vol also deletes the pmem file
$rpc_py delete_compress_bdev COMP_lvs0/lv0
$rpc_py destroy_lvol_store -l lvs0

trap - SIGINT SIGTERM EXIT
killprocess $bdevperf_pid
timing_exit compress_test