2015-09-21 21:48:40 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
rootdir=$(readlink -f $(dirname $0))
|
2019-02-07 12:22:12 +00:00
|
|
|
|
|
|
|
# In autotest_common.sh all tests are disabled by default.
|
|
|
|
# If the configuration of tests is not provided, no tests will be carried out.
|
2019-05-09 11:22:41 +00:00
|
|
|
if [[ ! -f $1 ]]; then
|
|
|
|
echo "ERROR: SPDK test configuration not specified"
|
2019-02-07 12:22:12 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-02-13 08:30:50 +00:00
|
|
|
# always test with SPDK shared objects.
|
|
|
|
export SPDK_LIB_DIR="$rootdir/build/lib"
|
|
|
|
|
2020-10-16 06:51:32 +00:00
|
|
|
# Autotest.sh, as part of autorun.sh, runs in a different
|
|
|
|
# shell process than autobuild.sh. Use helper file to pass
|
|
|
|
# over env variable containing libraries paths.
|
|
|
|
if [[ -e /tmp/spdk-ld-path ]]; then
|
|
|
|
source /tmp/spdk-ld-path
|
|
|
|
fi
|
|
|
|
|
2019-05-09 11:22:41 +00:00
|
|
|
source "$1"
|
2018-02-27 22:14:08 +00:00
|
|
|
source "$rootdir/test/common/autotest_common.sh"
|
2016-07-08 21:19:11 +00:00
|
|
|
source "$rootdir/test/nvmf/common.sh"
|
2015-09-21 21:48:40 +00:00
|
|
|
|
|
|
|
if [ $EUID -ne 0 ]; then
|
|
|
|
echo "$0 must be run as root"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-07-06 16:26:13 +00:00
|
|
|
if [ $(uname -s) = Linux ]; then
|
2020-07-30 14:15:19 +00:00
|
|
|
old_core_pattern=$(< /proc/sys/kernel/core_pattern)
|
2020-12-01 11:57:47 +00:00
|
|
|
mkdir -p "$output_dir/coredumps"
|
2016-07-06 16:26:13 +00:00
|
|
|
# set core_pattern to a known value to avoid ABRT, systemd-coredump, etc.
|
2020-12-01 11:57:47 +00:00
|
|
|
echo "|$rootdir/scripts/core-collector.sh %P %s %t $output_dir/coredumps" > /proc/sys/kernel/core_pattern
|
|
|
|
echo 2 > /proc/sys/kernel/core_pipe_limit
|
2018-11-26 08:04:25 +00:00
|
|
|
|
2020-05-06 20:34:57 +00:00
|
|
|
# Make sure that the hugepage state for our VM is fresh so we don't fail
|
2020-05-08 15:49:49 +00:00
|
|
|
# hugepage allocation. Allow time for this action to complete.
|
2020-05-06 20:34:57 +00:00
|
|
|
echo 1 > /proc/sys/vm/drop_caches
|
2020-05-08 15:49:49 +00:00
|
|
|
sleep 3
|
2020-05-06 20:34:57 +00:00
|
|
|
|
2018-11-26 08:04:25 +00:00
|
|
|
# make sure nbd (network block device) driver is loaded if it is available
|
|
|
|
# this ensures that when tests need to use nbd, it will be fully initialized
|
|
|
|
modprobe nbd || true
|
2020-08-03 14:01:53 +00:00
|
|
|
|
|
|
|
if udevadm=$(type -P udevadm); then
|
|
|
|
"$udevadm" monitor --property &> "$output_dir/udev.log" &
|
|
|
|
udevadm_pid=$!
|
|
|
|
fi
|
2016-07-06 16:26:13 +00:00
|
|
|
fi
|
|
|
|
|
2018-02-28 16:42:12 +00:00
|
|
|
trap "process_core; autotest_cleanup; exit 1" SIGINT SIGTERM EXIT
|
2015-09-25 16:48:11 +00:00
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
timing_enter autotest
|
|
|
|
|
2017-12-18 21:20:41 +00:00
|
|
|
create_test_list
|
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
src=$(readlink -f $(dirname $0))
|
2020-03-04 15:54:51 +00:00
|
|
|
out=$output_dir
|
2015-09-21 21:48:40 +00:00
|
|
|
cd $src
|
|
|
|
|
2018-04-26 23:46:08 +00:00
|
|
|
freebsd_update_contigmem_mod
|
|
|
|
|
2020-12-01 07:48:29 +00:00
|
|
|
# lcov takes considerable time to process clang coverage.
|
|
|
|
# Disabling lcov allow us to do this.
|
|
|
|
# More information: https://github.com/spdk/spdk/issues/1693
|
|
|
|
CC_TYPE=$(grep CC_TYPE mk/cc.mk)
|
|
|
|
if hash lcov && ! [[ "$CC_TYPE" == *"clang"* ]]; then
|
2017-05-08 20:57:23 +00:00
|
|
|
# setup output dir for unittest.sh
|
|
|
|
export UT_COVERAGE=$out/ut_coverage
|
2015-11-11 20:09:51 +00:00
|
|
|
export LCOV_OPTS="
|
|
|
|
--rc lcov_branch_coverage=1
|
|
|
|
--rc lcov_function_coverage=1
|
|
|
|
--rc genhtml_branch_coverage=1
|
|
|
|
--rc genhtml_function_coverage=1
|
|
|
|
--rc genhtml_legend=1
|
|
|
|
--rc geninfo_all_blocks=1
|
|
|
|
"
|
2016-09-13 17:16:41 +00:00
|
|
|
export LCOV="lcov $LCOV_OPTS --no-external"
|
2018-02-12 15:59:50 +00:00
|
|
|
# Print lcov version to log
|
|
|
|
$LCOV -v
|
2015-10-22 18:26:21 +00:00
|
|
|
# zero out coverage data
|
2020-03-04 15:54:51 +00:00
|
|
|
$LCOV -q -c -i -t "Baseline" -d $src -o $out/cov_base.info
|
2015-10-22 18:26:21 +00:00
|
|
|
fi
|
|
|
|
|
2016-08-15 17:43:53 +00:00
|
|
|
# Make sure the disks are clean (no leftover partition tables)
|
|
|
|
timing_enter cleanup
|
2017-11-09 23:33:29 +00:00
|
|
|
# Remove old domain socket pathname just in case
|
2017-11-22 19:10:29 +00:00
|
|
|
rm -f /var/tmp/spdk*.sock
|
2016-08-15 17:43:53 +00:00
|
|
|
|
2018-11-27 08:43:56 +00:00
|
|
|
# Load the kernel driver
|
|
|
|
./scripts/setup.sh reset
|
|
|
|
|
2019-02-01 09:26:39 +00:00
|
|
|
if [ $(uname -s) = Linux ]; then
|
|
|
|
# OCSSD devices drivers don't support IO issues by kernel so
|
2020-11-25 20:31:42 +00:00
|
|
|
# detect OCSSD devices and block them (unbind from any driver).
|
2019-02-01 09:26:39 +00:00
|
|
|
# If test scripts want to use this device it needs to do this explicitly.
|
|
|
|
#
|
|
|
|
# If some OCSSD device is bound to other driver than nvme we won't be able to
|
|
|
|
# discover if it is OCSSD or not so load the kernel driver first.
|
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
while IFS= read -r -d '' dev; do
|
2019-02-01 09:26:39 +00:00
|
|
|
# Send Open Channel 2.0 Geometry opcode "0xe2" - not supported by NVMe device.
|
2020-05-07 11:27:06 +00:00
|
|
|
if nvme admin-passthru $dev --namespace-id=1 --data-len=4096 --opcode=0xe2 --read > /dev/null; then
|
2019-02-01 09:26:39 +00:00
|
|
|
bdf="$(basename $(readlink -e /sys/class/nvme/${dev#/dev/}/device))"
|
2020-11-25 20:31:42 +00:00
|
|
|
echo "INFO: blocking OCSSD device: $dev ($bdf)"
|
|
|
|
PCI_BLOCKED+=" $bdf"
|
2019-02-07 10:35:21 +00:00
|
|
|
OCSSD_PCI_DEVICES+=" $bdf"
|
2019-02-01 09:26:39 +00:00
|
|
|
fi
|
2020-05-07 11:27:06 +00:00
|
|
|
done < <(find /dev -maxdepth 1 -regex '/dev/nvme[0-9]+' -print0)
|
2019-02-01 09:26:39 +00:00
|
|
|
|
2019-02-07 10:35:21 +00:00
|
|
|
export OCSSD_PCI_DEVICES
|
|
|
|
|
2020-11-25 20:31:42 +00:00
|
|
|
# Now, bind blocked devices to pci-stub module. This will prevent
|
2019-02-01 09:26:39 +00:00
|
|
|
# automatic grabbing these devices when we add device/vendor ID to
|
|
|
|
# proper driver.
|
2020-11-25 20:31:42 +00:00
|
|
|
if [[ -n "$PCI_BLOCKED" ]]; then
|
2019-12-04 14:44:12 +00:00
|
|
|
# shellcheck disable=SC2097,SC2098
|
2020-11-25 20:31:42 +00:00
|
|
|
PCI_ALLOWED="$PCI_BLOCKED" \
|
|
|
|
PCI_BLOCKED="" \
|
2020-05-07 11:27:06 +00:00
|
|
|
DRIVER_OVERRIDE="pci-stub" \
|
2019-02-01 09:26:39 +00:00
|
|
|
./scripts/setup.sh
|
|
|
|
|
2020-11-25 20:31:42 +00:00
|
|
|
# Export our blocked list so it will take effect during next setup.sh
|
|
|
|
export PCI_BLOCKED
|
2019-02-01 09:26:39 +00:00
|
|
|
fi
|
2020-11-27 08:22:54 +00:00
|
|
|
run_test "setup.sh" "$rootdir/test/setup/test-setup.sh"
|
2019-02-01 09:26:39 +00:00
|
|
|
fi
|
|
|
|
|
2020-11-27 08:22:54 +00:00
|
|
|
./scripts/setup.sh status
|
|
|
|
|
2020-10-14 12:36:37 +00:00
|
|
|
if [[ $(uname -s) == Linux ]]; then
|
|
|
|
# Revert NVMe namespaces to default state
|
|
|
|
nvme_namespace_revert
|
|
|
|
fi
|
2020-06-08 07:18:32 +00:00
|
|
|
|
2018-11-27 08:43:56 +00:00
|
|
|
# Delete all leftover lvols and gpt partitions
|
|
|
|
# Matches both /dev/nvmeXnY on Linux and /dev/nvmeXnsY on BSD
|
2019-02-01 09:26:39 +00:00
|
|
|
# Filter out nvme with partitions - the "p*" suffix
|
2018-11-27 08:43:56 +00:00
|
|
|
for dev in $(ls /dev/nvme*n* | grep -v p || true); do
|
|
|
|
dd if=/dev/zero of="$dev" bs=1M count=1
|
|
|
|
done
|
2017-11-01 20:08:50 +00:00
|
|
|
|
2018-11-27 08:43:56 +00:00
|
|
|
sync
|
|
|
|
|
2016-08-15 17:43:53 +00:00
|
|
|
timing_exit cleanup
|
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
# set up huge pages
|
|
|
|
timing_enter afterboot
|
2016-02-19 21:11:08 +00:00
|
|
|
./scripts/setup.sh
|
2016-03-07 22:11:36 +00:00
|
|
|
timing_exit afterboot
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2018-12-05 23:35:02 +00:00
|
|
|
if [[ $SPDK_TEST_CRYPTO -eq 1 || $SPDK_TEST_REDUCE -eq 1 ]]; then
|
2020-12-07 12:15:41 +00:00
|
|
|
# Make sure that memory is distributed across all NUMA nodes - by default, all goes to
|
|
|
|
# node0, but if QAT devices are attached to a different node, all of their VFs will end
|
|
|
|
# up under that node too and memory needs to be available there for the tests.
|
|
|
|
CLEAR_HUGE=yes HUGE_EVEN_ALLOC=yes ./scripts/setup.sh
|
|
|
|
./scripts/setup.sh status
|
2021-01-21 14:36:10 +00:00
|
|
|
if [[ $SPDK_TEST_USE_IGB_UIO -eq 1 ]]; then
|
2018-10-09 18:26:27 +00:00
|
|
|
./scripts/qat_setup.sh igb_uio
|
|
|
|
else
|
|
|
|
./scripts/qat_setup.sh
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2019-10-22 15:12:35 +00:00
|
|
|
# Revert existing OPAL to factory settings that may have been left from earlier failed tests.
|
|
|
|
# This ensures we won't hit any unexpected failures due to NVMe SSDs being locked.
|
2020-06-09 09:22:41 +00:00
|
|
|
opal_revert_cleanup
|
2019-10-22 15:12:35 +00:00
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
#####################
|
|
|
|
# Unit Tests
|
|
|
|
#####################
|
|
|
|
|
2017-05-24 16:25:45 +00:00
|
|
|
if [ $SPDK_TEST_UNITTEST -eq 1 ]; then
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "unittest" ./test/unit/unittest.sh
|
2020-06-19 23:14:41 +00:00
|
|
|
run_test "env" test/env/env.sh
|
2017-05-24 16:25:45 +00:00
|
|
|
fi
|
2017-01-24 22:47:46 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
|
|
|
|
timing_enter lib
|
2017-03-08 19:17:32 +00:00
|
|
|
|
scripts/rpc.py: add daemon mode
Add rpc_cmd() bash command that sends rpc command to an
rpc.py instance permanently running in background.
This makes sending RPC commands even 17 times faster.
We make use of bash coprocesses - a builtin bash feature
that allow starting background processes with stdin and
stdout connected to pipes. rpc.py will block trying to
read stdin, effectively being always "ready" to read
an RPC command.
The background rpc.py is started with a new --server flag
that's described as:
> Start listening on stdin, parse each line as a regular
> rpc.py execution and create a separate connection for each command.
> Each command's output ends with either **STATUS=0 if the
> command succeeded or **STATUS=1 if it failed.
> --server is meant to be used in conjunction with bash
> coproc, where stdin and stdout are named pipes and can be
> used as a faster way to send RPC commands.
As a part of this patch I'm attaching a sample test
that runs the following rpc commands first with the regular
rpc.py, then the new rpc_cmd() function.
```
time {
bdevs=$($rpc bdev_get_bdevs)
[ "$(jq length <<< "$bdevs")" == "0" ]
malloc=$($rpc bdev_malloc_create 8 512)
bdevs=$($rpc bdev_get_bdevs)
[ "$(jq length <<< "$bdevs")" == "1" ]
$rpc bdev_passthru_create -b "$malloc" -p Passthru0
bdevs=$($rpc bdev_get_bdevs)
[ "$(jq length <<< "$bdevs")" == "2" ]
$rpc bdev_passthru_delete Passthru0
$rpc bdev_malloc_delete $malloc
bdevs=$($rpc bdev_get_bdevs)
[ "$(jq length <<< "$bdevs")" == "0" ]
}
```
Regular rpc.py:
```
real 0m1.477s
user 0m1.289s
sys 0m0.139s
```
rpc_cmd():
```
real 0m0.085s
user 0m0.025s
sys 0m0.006s
```
autotest_common.sh will now spawn an rpc.py daemon if
it's not running yet, and it will offer rpc_cmd() function
to quickly send RPC commands. If the command is invalid or
SPDK returns with error, the bash function will return
a non-zero code and may trigger ERR trap just like a regular
rpc.py instance.
Pipes have major advantage over e.g. unix domain sockets - the pipes
will be automatically closed once the owner process exits.
This means we can create a named pipe in autotest_common.sh,
open it, then start rpc.py in background and never worry
about it again - it will be closed automatically once the
test exits. It doesn't even matter if the test is executed
manually in isolation, or as a part of the entire autotest.
(check_so_deps.sh needs to be modified not to wait for *all*
background processes to finish, but just the ones it started)
Change-Id: If0ded961b7fef3af3837b44532300dee8b5b4663
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/621
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-06-21 07:38:47 +00:00
|
|
|
run_test "rpc" test/rpc/rpc.sh
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "rpc_client" test/rpc_client/rpc_client.sh
|
|
|
|
run_test "json_config" ./test/json_config/json_config.sh
|
|
|
|
run_test "alias_rpc" test/json_config/alias_rpc/alias_rpc.sh
|
|
|
|
run_test "spdkcli_tcp" test/spdkcli/tcp.sh
|
2020-05-07 11:27:06 +00:00
|
|
|
run_test "dpdk_mem_utility" test/dpdk_memory_utility/test_dpdk_mem_info.sh
|
2020-03-26 13:30:52 +00:00
|
|
|
run_test "event" test/event/event.sh
|
2021-01-19 11:25:41 +00:00
|
|
|
run_test "accel_engine" test/accel_engine/accel_engine.sh
|
2018-07-26 01:32:05 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_BLOCKDEV -eq 1 ]; then
|
2019-12-17 20:31:51 +00:00
|
|
|
run_test "blockdev_general" test/bdev/blockdev.sh
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "bdev_raid" test/bdev/bdev_raid.sh
|
2020-07-10 12:15:45 +00:00
|
|
|
run_test "bdevperf_config" test/bdev/bdevperf/test_config.sh
|
2020-06-15 14:14:28 +00:00
|
|
|
if [[ $(uname -s) == Linux ]]; then
|
|
|
|
run_test "spdk_dd" test/dd/dd.sh
|
|
|
|
fi
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2017-03-08 19:17:32 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_JSON -eq 1 ]; then
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "test_converter" test/config_converter/test_converter.sh
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2017-03-08 19:17:32 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_NVME -eq 1 ]; then
|
2019-12-17 20:31:51 +00:00
|
|
|
run_test "blockdev_nvme" test/bdev/blockdev.sh "nvme"
|
|
|
|
run_test "blockdev_nvme_gpt" test/bdev/blockdev.sh "gpt"
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "nvme" test/nvme/nvme.sh
|
2021-02-25 11:21:04 +00:00
|
|
|
if [[ $SPDK_TEST_NVME_PMR -eq 1 ]]; then
|
|
|
|
run_test "nvme_pmr" test/nvme/nvme_pmr.sh
|
|
|
|
fi
|
2019-10-24 18:11:51 +00:00
|
|
|
if [[ $SPDK_TEST_NVME_CUSE -eq 1 ]]; then
|
2020-06-08 11:42:52 +00:00
|
|
|
run_test "nvme_cuse" test/nvme/cuse/nvme_cuse.sh
|
2019-10-24 18:11:51 +00:00
|
|
|
fi
|
2020-01-28 14:39:52 +00:00
|
|
|
run_test "nvme_rpc" test/nvme/nvme_rpc.sh
|
2019-01-28 12:21:57 +00:00
|
|
|
# Only test hotplug without ASAN enabled. Since if it is
|
|
|
|
# enabled, it catches SEGV earlier than our handler which
|
|
|
|
# breaks the hotplug logic.
|
2019-09-19 10:46:21 +00:00
|
|
|
if [ $SPDK_RUN_ASAN -eq 0 ]; then
|
2020-10-07 14:16:34 +00:00
|
|
|
run_test "nvme_hotplug" test/nvme/hotplug.sh root
|
2019-09-19 10:46:21 +00:00
|
|
|
fi
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_IOAT -eq 1 ]; then
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "ioat" test/ioat/ioat.sh
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
timing_exit lib
|
2016-08-03 21:37:16 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_ISCSI -eq 1 ]; then
|
2020-08-11 10:36:11 +00:00
|
|
|
run_test "iscsi_tgt" ./test/iscsi_tgt/iscsi_tgt.sh
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "spdkcli_iscsi" ./test/spdkcli/iscsi.sh
|
2019-04-26 17:30:50 +00:00
|
|
|
|
|
|
|
# Run raid spdkcli test under iSCSI since blockdev tests run on systems that can't run spdkcli yet
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "spdkcli_raid" test/spdkcli/raid.sh
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2017-03-22 20:35:00 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_BLOBFS -eq 1 ]; then
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "rocksdb" ./test/blobfs/rocksdb/rocksdb.sh
|
|
|
|
run_test "blobstore" ./test/blobstore/blobstore.sh
|
|
|
|
run_test "blobfs" ./test/blobfs/blobfs.sh
|
2020-05-11 22:02:01 +00:00
|
|
|
run_test "hello_blob" $SPDK_EXAMPLE_DIR/hello_blob \
|
2020-06-19 09:01:54 +00:00
|
|
|
examples/blob/hello_world/hello_blob.json
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2016-06-07 15:49:44 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_NVMF -eq 1 ]; then
|
2019-12-05 23:43:36 +00:00
|
|
|
# The NVMe-oF run test cases are split out like this so that the parser that compiles the
|
|
|
|
# list of all tests can properly differentiate them. Please do not merge them into one line.
|
|
|
|
if [ "$SPDK_TEST_NVMF_TRANSPORT" = "rdma" ]; then
|
2021-03-22 16:51:26 +00:00
|
|
|
timing_enter rdma_setup
|
|
|
|
rdma_device_init
|
|
|
|
timing_exit rdma_setup
|
2019-12-05 23:43:36 +00:00
|
|
|
run_test "nvmf_rdma" ./test/nvmf/nvmf.sh --transport=$SPDK_TEST_NVMF_TRANSPORT
|
2021-03-22 16:51:26 +00:00
|
|
|
run_test "spdkcli_nvmf_rdma" ./test/spdkcli/nvmf.sh --transport=$SPDK_TEST_NVMF_TRANSPORT
|
2019-12-05 23:43:36 +00:00
|
|
|
elif [ "$SPDK_TEST_NVMF_TRANSPORT" = "tcp" ]; then
|
2021-03-18 13:31:27 +00:00
|
|
|
timing_enter tcp_setup
|
|
|
|
tcp_device_init
|
|
|
|
timing_exit tcp_setup
|
2019-12-05 23:43:36 +00:00
|
|
|
run_test "nvmf_tcp" ./test/nvmf/nvmf.sh --transport=$SPDK_TEST_NVMF_TRANSPORT
|
2021-03-22 16:51:26 +00:00
|
|
|
run_test "spdkcli_nvmf_tcp" ./test/spdkcli/nvmf.sh --transport=$SPDK_TEST_NVMF_TRANSPORT
|
2020-01-16 22:27:01 +00:00
|
|
|
run_test "nvmf_identify_passthru" test/nvmf/target/identify_passthru.sh --transport=$SPDK_TEST_NVMF_TRANSPORT
|
2020-12-14 15:54:12 +00:00
|
|
|
run_test "nvmf_dif" test/nvmf/target/dif.sh
|
2019-12-05 23:43:36 +00:00
|
|
|
elif [ "$SPDK_TEST_NVMF_TRANSPORT" = "fc" ]; then
|
2020-05-07 11:27:06 +00:00
|
|
|
run_test "nvmf_fc" ./test/nvmf/nvmf.sh --transport=$SPDK_TEST_NVMF_TRANSPORT
|
|
|
|
run_test "spdkcli_nvmf_fc" ./test/spdkcli/nvmf.sh
|
2019-12-05 23:43:36 +00:00
|
|
|
else
|
|
|
|
echo "unknown NVMe transport, please specify rdma, tcp, or fc."
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2017-10-23 15:03:18 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_VHOST -eq 1 ]; then
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "vhost" ./test/vhost/vhost.sh
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2017-03-02 14:12:20 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_LVOL -eq 1 ]; then
|
2020-10-08 12:08:56 +00:00
|
|
|
run_test "lvol" ./test/lvol/lvol.sh
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "blob_io_wait" ./test/blobstore/blob_io_wait/blob_io_wait.sh
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2017-09-12 13:47:30 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_VHOST_INIT -eq 1 ]; then
|
|
|
|
timing_enter vhost_initiator
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "vhost_blockdev" ./test/vhost/initiator/blockdev.sh
|
|
|
|
run_test "spdkcli_virtio" ./test/spdkcli/virtio.sh
|
|
|
|
run_test "vhost_shared" ./test/vhost/shared/shared.sh
|
|
|
|
run_test "vhost_fuzz" ./test/vhost/fuzz/fuzz.sh
|
2019-01-28 12:21:57 +00:00
|
|
|
timing_exit vhost_initiator
|
|
|
|
fi
|
2017-09-26 13:02:52 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_PMDK -eq 1 ]; then
|
2019-12-17 20:31:51 +00:00
|
|
|
run_test "blockdev_pmem" ./test/bdev/blockdev.sh "pmem"
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "pmem" ./test/pmem/pmem.sh -x
|
|
|
|
run_test "spdkcli_pmem" ./test/spdkcli/pmem.sh
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2018-07-03 01:37:42 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_RBD -eq 1 ]; then
|
2019-12-17 20:31:51 +00:00
|
|
|
run_test "blockdev_rbd" ./test/bdev/blockdev.sh "rbd"
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "spdkcli_rbd" ./test/spdkcli/rbd.sh
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2018-11-02 00:00:24 +00:00
|
|
|
|
2019-01-28 12:21:57 +00:00
|
|
|
if [ $SPDK_TEST_OCF -eq 1 ]; then
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "ocf" ./test/ocf/ocf.sh
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2018-10-29 14:40:34 +00:00
|
|
|
|
2019-10-25 07:31:14 +00:00
|
|
|
if [ $SPDK_TEST_FTL -eq 1 ]; then
|
|
|
|
run_test "ftl" ./test/ftl/ftl.sh
|
|
|
|
fi
|
2019-06-27 14:49:26 +00:00
|
|
|
|
|
|
|
if [ $SPDK_TEST_VMD -eq 1 ]; then
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "vmd" ./test/vmd/vmd.sh
|
2019-06-27 14:49:26 +00:00
|
|
|
fi
|
2019-08-01 04:27:15 +00:00
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
if [ $SPDK_TEST_REDUCE -eq 1 ]; then
|
|
|
|
run_test "compress_qat" ./test/compress/compress.sh "qat"
|
|
|
|
run_test "compress_isal" ./test/compress/compress.sh "isal"
|
|
|
|
fi
|
2019-10-22 15:12:35 +00:00
|
|
|
|
|
|
|
if [ $SPDK_TEST_OPAL -eq 1 ]; then
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "nvme_opal" ./test/nvme/nvme_opal.sh
|
2019-10-22 15:12:35 +00:00
|
|
|
fi
|
2019-12-17 20:31:51 +00:00
|
|
|
|
|
|
|
if [ $SPDK_TEST_CRYPTO -eq 1 ]; then
|
2020-02-26 11:35:23 +00:00
|
|
|
run_test "blockdev_crypto_aesni" ./test/bdev/blockdev.sh "crypto_aesni"
|
|
|
|
# Proceed with the test only if QAT devices are in place
|
|
|
|
if [[ $(lspci -d:37c8) ]]; then
|
|
|
|
run_test "blockdev_crypto_qat" ./test/bdev/blockdev.sh "crypto_qat"
|
|
|
|
fi
|
2019-12-17 20:31:51 +00:00
|
|
|
fi
|
2020-12-29 13:55:28 +00:00
|
|
|
|
|
|
|
if [[ $SPDK_TEST_SCHEDULER -eq 1 ]]; then
|
|
|
|
run_test "scheduler" ./test/scheduler/scheduler.sh
|
|
|
|
fi
|
2019-01-28 12:21:57 +00:00
|
|
|
fi
|
2018-11-07 13:57:38 +00:00
|
|
|
|
2016-03-07 22:11:36 +00:00
|
|
|
timing_enter cleanup
|
2018-02-28 16:42:12 +00:00
|
|
|
autotest_cleanup
|
2016-03-07 22:11:36 +00:00
|
|
|
timing_exit cleanup
|
2015-09-21 21:48:40 +00:00
|
|
|
|
|
|
|
timing_exit autotest
|
|
|
|
chmod a+r $output_dir/timing.txt
|
|
|
|
|
2015-09-25 16:48:11 +00:00
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
# catch any stray core files
|
|
|
|
process_core
|
2015-10-22 18:26:21 +00:00
|
|
|
|
2020-11-19 10:47:05 +00:00
|
|
|
if hash lcov && ! [[ "$CC_TYPE" == *"clang"* ]]; then
|
2015-10-22 18:26:21 +00:00
|
|
|
# generate coverage data and combine with baseline
|
2020-03-04 15:54:51 +00:00
|
|
|
$LCOV -q -c -d $src -t "$(hostname)" -o $out/cov_test.info
|
|
|
|
$LCOV -q -a $out/cov_base.info -a $out/cov_test.info -o $out/cov_total.info
|
2017-06-30 16:58:21 +00:00
|
|
|
$LCOV -q -r $out/cov_total.info '*/dpdk/*' -o $out/cov_total.info
|
2017-07-12 22:11:57 +00:00
|
|
|
$LCOV -q -r $out/cov_total.info '/usr/*' -o $out/cov_total.info
|
2017-05-08 20:57:23 +00:00
|
|
|
git clean -f "*.gcda"
|
2017-06-20 22:29:43 +00:00
|
|
|
rm -f cov_base.info cov_test.info OLD_STDOUT OLD_STDERR
|
2015-10-22 18:26:21 +00:00
|
|
|
fi
|