2015-09-21 21:48:40 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-03-08 19:17:32 +00:00
|
|
|
if [[ ! -z $1 ]]; then
|
|
|
|
if [ -f $1 ]; then
|
|
|
|
source $1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set defaults for missing test config options
|
|
|
|
: ${SPDK_TEST_ISCSI=1}; export SPDK_TEST_ISCSI
|
|
|
|
: ${SPDK_TEST_NVME=1}; export SPDK_TEST_NVME
|
|
|
|
: ${SPDK_TEST_NVMF=1}; export SPDK_TEST_NVMF
|
|
|
|
: ${SPDK_TEST_VHOST=1}; export SPDK_TEST_VHOST
|
|
|
|
: ${SPDK_TEST_BLOCKDEV=1}; export SPDK_TEST_BLOCKDEV
|
|
|
|
: ${SPDK_TEST_IOAT=1}; export SPDK_TEST_IOAT
|
|
|
|
: ${SPDK_TEST_EVENT=1}; export SPDK_TEST_EVENT
|
|
|
|
|
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
rootdir=$(readlink -f $(dirname $0))
|
|
|
|
source "$rootdir/scripts/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
|
|
|
|
|
|
|
set -xe
|
|
|
|
|
|
|
|
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
|
|
|
|
# set core_pattern to a known value to avoid ABRT, systemd-coredump, etc.
|
|
|
|
echo "core" > /proc/sys/kernel/core_pattern
|
|
|
|
fi
|
|
|
|
|
2016-02-19 21:11:08 +00:00
|
|
|
trap "process_core; $rootdir/scripts/setup.sh reset; exit 1" SIGINT SIGTERM EXIT
|
2015-09-25 16:48:11 +00:00
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
timing_enter autotest
|
|
|
|
|
|
|
|
src=$(readlink -f $(dirname $0))
|
|
|
|
out=$PWD
|
|
|
|
cd $src
|
|
|
|
|
2015-10-22 18:26:21 +00:00
|
|
|
if hash lcov; then
|
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"
|
2015-10-22 18:26:21 +00:00
|
|
|
# zero out coverage data
|
2017-02-27 19:37:33 +00:00
|
|
|
$LCOV -q -c -i -t "Baseline" -d $src -o 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
|
|
|
|
if [ $(uname -s) = Linux ]; then
|
|
|
|
# Load the kernel driver
|
|
|
|
./scripts/setup.sh reset
|
|
|
|
|
|
|
|
# Let the kernel discover any filesystems or partitions
|
|
|
|
sleep 10
|
|
|
|
|
|
|
|
# Delete all partitions on NVMe devices
|
2016-10-04 16:44:55 +00:00
|
|
|
devs=`lsblk -l -o NAME | grep nvme | grep -v p`
|
2016-08-15 17:43:53 +00:00
|
|
|
for dev in $devs; do
|
|
|
|
parted -s /dev/$dev mklabel msdos
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
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
|
|
|
|
2016-07-08 21:19:11 +00:00
|
|
|
timing_enter nvmf_setup
|
|
|
|
rdma_device_init
|
|
|
|
timing_exit nvmf_setup
|
|
|
|
|
2016-11-16 18:18:40 +00:00
|
|
|
timing_enter rbd_setup
|
|
|
|
rbd_setup
|
|
|
|
timing_exit rbd_setup
|
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
#####################
|
|
|
|
# Unit Tests
|
|
|
|
#####################
|
|
|
|
|
2017-01-24 22:47:46 +00:00
|
|
|
timing_enter unittest
|
|
|
|
run_test ./unittest.sh
|
|
|
|
timing_exit unittest
|
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
timing_enter lib
|
|
|
|
|
2017-03-08 19:17:32 +00:00
|
|
|
if [ $SPDK_TEST_BLOCKDEV -eq 1 ]; then
|
|
|
|
run_test test/lib/bdev/blockdev.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $SPDK_TEST_EVENT -eq 1 ]; then
|
|
|
|
run_test test/lib/event/event.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $SPDK_TEST_NVME -eq 1 ]; then
|
|
|
|
run_test test/lib/nvme/nvme.sh
|
|
|
|
if [ $RUN_NIGHTLY -eq 1 ]; then
|
|
|
|
run_test test/lib/nvme/hotplug.sh intel
|
|
|
|
run_test test/lib/nvme/nvmemp.sh
|
|
|
|
fi
|
2016-11-15 06:54:52 +00:00
|
|
|
fi
|
2017-03-08 19:17:32 +00:00
|
|
|
|
2016-11-22 20:03:26 +00:00
|
|
|
run_test test/lib/env/env.sh
|
2017-03-08 19:17:32 +00:00
|
|
|
|
|
|
|
if [ $SPDK_TEST_IOAT -eq 1 ]; then
|
|
|
|
run_test test/lib/ioat/ioat.sh
|
|
|
|
fi
|
2015-09-21 21:48:40 +00:00
|
|
|
|
|
|
|
timing_exit lib
|
|
|
|
|
2016-08-03 21:37:16 +00:00
|
|
|
|
2017-03-08 19:17:32 +00:00
|
|
|
if [ $(uname -s) = Linux ] && [ $SPDK_TEST_ISCSI -eq 1 ]; then
|
2016-08-03 21:37:16 +00:00
|
|
|
export TARGET_IP=127.0.0.1
|
|
|
|
export INITIATOR_IP=127.0.0.1
|
|
|
|
|
|
|
|
timing_enter iscsi_tgt
|
2016-10-06 16:57:09 +00:00
|
|
|
run_test ./test/iscsi_tgt/calsoft/calsoft.sh
|
|
|
|
run_test ./test/iscsi_tgt/filesystem/filesystem.sh
|
|
|
|
run_test ./test/iscsi_tgt/fio/fio.sh
|
|
|
|
run_test ./test/iscsi_tgt/reset/reset.sh
|
|
|
|
run_test ./test/iscsi_tgt/rpc_config/rpc_config.sh
|
|
|
|
run_test ./test/iscsi_tgt/idle_migration/idle_migration.sh
|
2016-11-23 03:04:34 +00:00
|
|
|
if [ $RUN_NIGHTLY -eq 1 ]; then
|
|
|
|
run_test ./test/iscsi_tgt/ip_migration/ip_migration.sh
|
|
|
|
fi
|
2016-10-06 16:57:09 +00:00
|
|
|
run_test ./test/iscsi_tgt/ext4test/ext4test.sh
|
2016-10-17 02:15:21 +00:00
|
|
|
run_test ./test/iscsi_tgt/rbd/rbd.sh
|
2016-12-12 07:42:43 +00:00
|
|
|
run_test ./test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh
|
2016-08-03 21:37:16 +00:00
|
|
|
timing_exit iscsi_tgt
|
2016-11-22 19:47:04 +00:00
|
|
|
|
|
|
|
run_test test/lib/iscsi/iscsi.sh
|
2016-08-03 21:37:16 +00:00
|
|
|
fi
|
|
|
|
|
2017-03-08 19:17:32 +00:00
|
|
|
if [ $SPDK_TEST_NVMF -eq 1 ]; then
|
|
|
|
timing_enter nvmf
|
2016-06-07 15:49:44 +00:00
|
|
|
|
2017-03-08 19:17:32 +00:00
|
|
|
run_test test/nvmf/fio/fio.sh
|
|
|
|
run_test test/nvmf/filesystem/filesystem.sh
|
|
|
|
run_test test/nvmf/discovery/discovery.sh
|
|
|
|
run_test test/nvmf/nvme_cli/nvme_cli.sh
|
|
|
|
run_test test/nvmf/shutdown/shutdown.sh
|
|
|
|
run_test test/nvmf/rpc/rpc.sh
|
2017-02-15 20:10:20 +00:00
|
|
|
|
2017-03-08 19:17:32 +00:00
|
|
|
if [ $RUN_NIGHTLY -eq 1 ]; then
|
|
|
|
run_test test/nvmf/multiconnection/multiconnection.sh
|
|
|
|
fi
|
2016-11-28 20:41:54 +00:00
|
|
|
|
2017-03-08 19:17:32 +00:00
|
|
|
timing_enter host
|
2016-11-28 20:41:54 +00:00
|
|
|
|
2017-03-08 19:17:32 +00:00
|
|
|
if [ $RUN_NIGHTLY -eq 1 ]; then
|
|
|
|
run_test test/nvmf/host/aer.sh
|
|
|
|
fi
|
|
|
|
run_test test/nvmf/host/identify.sh
|
|
|
|
run_test test/nvmf/host/perf.sh
|
|
|
|
run_test test/nvmf/host/identify_kernel_nvmf.sh
|
2016-06-07 15:49:44 +00:00
|
|
|
|
2017-03-08 19:17:32 +00:00
|
|
|
timing_exit host
|
2016-11-28 20:41:54 +00:00
|
|
|
|
2017-03-08 19:17:32 +00:00
|
|
|
timing_exit nvmf
|
|
|
|
fi
|
2016-06-07 15:49:44 +00:00
|
|
|
|
2017-03-08 19:17:32 +00:00
|
|
|
if [ $SPDK_TEST_VHOST -eq 1 ]; then
|
|
|
|
timing_enter vhost
|
|
|
|
run_test ./test/vhost/spdk_vhost.sh --integrity
|
|
|
|
timing_exit vhost
|
|
|
|
fi
|
2017-03-02 14:12:20 +00:00
|
|
|
|
2016-03-07 22:11:36 +00:00
|
|
|
timing_enter cleanup
|
2016-11-16 18:18:40 +00:00
|
|
|
rbd_cleanup
|
2016-02-19 21:11:08 +00:00
|
|
|
./scripts/setup.sh reset
|
2016-01-19 03:36:50 +00:00
|
|
|
./scripts/build_kmod.sh clean
|
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
|
|
|
|
|
|
|
if hash lcov; then
|
|
|
|
# generate coverage data and combine with baseline
|
2017-02-27 19:37:33 +00:00
|
|
|
$LCOV -q -c -d $src -t "$(hostname)" -o cov_test.info
|
|
|
|
$LCOV -q -a cov_base.info -a cov_test.info -o $out/cov_total.info
|
2015-10-22 18:26:21 +00:00
|
|
|
find . -name "*.gcda" -delete
|
2017-02-27 19:37:33 +00:00
|
|
|
rm -f cov_base.info cov_test.info
|
2015-10-22 18:26:21 +00:00
|
|
|
fi
|