2015-09-21 14:48:40 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
rootdir=$(readlink -f $(dirname $0))
|
2018-02-27 15:14:08 -07:00
|
|
|
source "$rootdir/test/common/autotest_common.sh"
|
2016-07-08 14:19:11 -07:00
|
|
|
source "$rootdir/test/nvmf/common.sh"
|
2015-09-21 14:48:40 -07:00
|
|
|
|
|
|
|
set -xe
|
|
|
|
|
|
|
|
if [ $EUID -ne 0 ]; then
|
|
|
|
echo "$0 must be run as root"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-07-06 09:26:13 -07: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
|
|
|
|
|
2018-02-28 09:42:12 -07:00
|
|
|
trap "process_core; autotest_cleanup; exit 1" SIGINT SIGTERM EXIT
|
2015-09-25 09:48:11 -07:00
|
|
|
|
2015-09-21 14:48:40 -07:00
|
|
|
timing_enter autotest
|
|
|
|
|
2017-12-18 14:20:41 -07:00
|
|
|
create_test_list
|
|
|
|
|
2015-09-21 14:48:40 -07:00
|
|
|
src=$(readlink -f $(dirname $0))
|
|
|
|
out=$PWD
|
|
|
|
cd $src
|
|
|
|
|
2018-01-04 20:56:49 -07:00
|
|
|
./scripts/setup.sh status
|
|
|
|
|
2015-10-22 11:26:21 -07:00
|
|
|
if hash lcov; then
|
2017-05-08 13:57:23 -07:00
|
|
|
# setup output dir for unittest.sh
|
|
|
|
export UT_COVERAGE=$out/ut_coverage
|
2015-11-11 13:09:51 -07: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 10:16:41 -07:00
|
|
|
export LCOV="lcov $LCOV_OPTS --no-external"
|
2018-02-12 08:59:50 -07:00
|
|
|
# Print lcov version to log
|
|
|
|
$LCOV -v
|
2015-10-22 11:26:21 -07:00
|
|
|
# zero out coverage data
|
2017-02-27 12:37:33 -07:00
|
|
|
$LCOV -q -c -i -t "Baseline" -d $src -o cov_base.info
|
2015-10-22 11:26:21 -07:00
|
|
|
fi
|
|
|
|
|
2016-08-15 10:43:53 -07:00
|
|
|
# Make sure the disks are clean (no leftover partition tables)
|
|
|
|
timing_enter cleanup
|
2017-11-09 16:33:29 -07:00
|
|
|
# Remove old domain socket pathname just in case
|
2017-11-22 12:10:29 -07:00
|
|
|
rm -f /var/tmp/spdk*.sock
|
2016-08-15 10:43:53 -07:00
|
|
|
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
|
2017-05-30 16:17:51 -07:00
|
|
|
devs=`lsblk -l -o NAME | grep nvme | grep -v p` || true
|
2016-08-15 10:43:53 -07:00
|
|
|
for dev in $devs; do
|
|
|
|
parted -s /dev/$dev mklabel msdos
|
|
|
|
done
|
2017-11-01 13:08:50 -07:00
|
|
|
|
|
|
|
# Load RAM disk driver if available
|
|
|
|
modprobe brd || true
|
2016-08-15 10:43:53 -07:00
|
|
|
fi
|
|
|
|
timing_exit cleanup
|
|
|
|
|
2015-09-21 14:48:40 -07:00
|
|
|
# set up huge pages
|
|
|
|
timing_enter afterboot
|
2016-02-19 14:11:08 -07:00
|
|
|
./scripts/setup.sh
|
2016-03-07 15:11:36 -07:00
|
|
|
timing_exit afterboot
|
2015-09-21 14:48:40 -07:00
|
|
|
|
2016-07-08 14:19:11 -07:00
|
|
|
timing_enter nvmf_setup
|
|
|
|
rdma_device_init
|
|
|
|
timing_exit nvmf_setup
|
|
|
|
|
2015-09-21 14:48:40 -07:00
|
|
|
#####################
|
|
|
|
# Unit Tests
|
|
|
|
#####################
|
|
|
|
|
2017-05-24 09:25:45 -07:00
|
|
|
if [ $SPDK_TEST_UNITTEST -eq 1 ]; then
|
|
|
|
timing_enter unittest
|
2018-02-27 16:07:35 -07:00
|
|
|
run_test ./test/unit/unittest.sh
|
2017-12-18 14:20:41 -07:00
|
|
|
report_test_completion "unittest"
|
2017-05-24 09:25:45 -07:00
|
|
|
timing_exit unittest
|
|
|
|
fi
|
2017-01-24 15:47:46 -07:00
|
|
|
|
2015-09-21 14:48:40 -07:00
|
|
|
timing_enter lib
|
|
|
|
|
2017-03-08 12:17:32 -07:00
|
|
|
if [ $SPDK_TEST_BLOCKDEV -eq 1 ]; then
|
2018-03-22 12:43:32 -07:00
|
|
|
run_test test/bdev/blockdev.sh
|
2017-03-08 12:17:32 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $SPDK_TEST_EVENT -eq 1 ]; then
|
2018-03-22 16:23:30 -07:00
|
|
|
run_test test/event/event.sh
|
2017-03-08 12:17:32 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $SPDK_TEST_NVME -eq 1 ]; then
|
2018-03-22 15:18:32 -07:00
|
|
|
run_test test/nvme/nvme.sh
|
|
|
|
run_test test/nvme/spdk_nvme_cli.sh
|
2017-06-12 13:08:19 +08:00
|
|
|
# Only test hotplug without ASAN enabled. Since if it is
|
|
|
|
# enabled, it catches SEGV earlier than our handler which
|
|
|
|
# breaks the hotplug logic
|
|
|
|
if [ $SPDK_RUN_ASAN -eq 0 ]; then
|
2018-03-22 15:18:32 -07:00
|
|
|
run_test test/nvme/hotplug.sh intel
|
2017-06-12 13:08:19 +08:00
|
|
|
fi
|
2016-11-15 01:54:52 -05:00
|
|
|
fi
|
2017-03-08 12:17:32 -07:00
|
|
|
|
2018-03-22 16:10:42 -07:00
|
|
|
run_test test/env/env.sh
|
2017-03-08 12:17:32 -07:00
|
|
|
|
|
|
|
if [ $SPDK_TEST_IOAT -eq 1 ]; then
|
2018-03-22 15:26:12 -07:00
|
|
|
run_test test/ioat/ioat.sh
|
2017-03-08 12:17:32 -07:00
|
|
|
fi
|
2015-09-21 14:48:40 -07:00
|
|
|
|
|
|
|
timing_exit lib
|
|
|
|
|
2017-05-10 15:01:26 -07:00
|
|
|
if [ $SPDK_TEST_ISCSI -eq 1 ]; then
|
|
|
|
run_test ./test/iscsi_tgt/iscsi_tgt.sh
|
2016-08-03 14:37:16 -07:00
|
|
|
fi
|
|
|
|
|
2017-03-22 13:35:00 -07:00
|
|
|
if [ $SPDK_TEST_BLOBFS -eq 1 ]; then
|
|
|
|
run_test ./test/blobfs/rocksdb/rocksdb.sh
|
2017-11-08 18:06:22 +08:00
|
|
|
run_test ./test/blobstore/blobstore.sh
|
2017-03-22 13:35:00 -07:00
|
|
|
fi
|
|
|
|
|
2017-03-08 12:17:32 -07:00
|
|
|
if [ $SPDK_TEST_NVMF -eq 1 ]; then
|
2017-05-27 08:05:26 +08:00
|
|
|
run_test ./test/nvmf/nvmf.sh
|
2017-03-08 12:17:32 -07:00
|
|
|
fi
|
2016-06-07 08:49:44 -07:00
|
|
|
|
2017-03-08 12:17:32 -07:00
|
|
|
if [ $SPDK_TEST_VHOST -eq 1 ]; then
|
|
|
|
timing_enter vhost
|
2017-11-15 14:56:07 +01:00
|
|
|
timing_enter negative
|
|
|
|
run_test ./test/vhost/spdk_vhost.sh --negative
|
|
|
|
timing_exit negative
|
2017-11-09 16:38:44 -07:00
|
|
|
|
2017-11-21 10:33:20 +01:00
|
|
|
if [ $RUN_NIGHTLY -eq 1 ]; then
|
2018-01-22 20:51:56 -05:00
|
|
|
timing_enter integrity_blk
|
|
|
|
run_test ./test/vhost/spdk_vhost.sh --integrity-blk
|
|
|
|
timing_exit integrity_blk
|
2017-11-21 10:33:20 +01:00
|
|
|
|
|
|
|
timing_enter integrity
|
|
|
|
run_test ./test/vhost/spdk_vhost.sh --integrity
|
|
|
|
timing_exit integrity
|
2017-10-17 20:59:36 +02:00
|
|
|
|
2018-02-06 12:20:21 +01:00
|
|
|
timing_enter fs_integrity_scsi
|
|
|
|
run_test ./test/vhost/spdk_vhost.sh --fs-integrity-scsi
|
|
|
|
timing_exit fs_integrity_scsi
|
2017-12-07 19:14:29 +08:00
|
|
|
|
2018-02-06 12:20:21 +01:00
|
|
|
timing_enter fs_integrity_blk
|
|
|
|
run_test ./test/vhost/spdk_vhost.sh --fs-integrity-blk
|
|
|
|
timing_exit fs_integrity_blk
|
2017-11-28 00:47:15 +08:00
|
|
|
|
|
|
|
timing_enter integrity_lvol_scsi_nightly
|
|
|
|
run_test ./test/vhost/spdk_vhost.sh --integrity-lvol-scsi-nightly
|
|
|
|
timing_exit integrity_lvol_scsi_nightly
|
|
|
|
|
|
|
|
timing_enter integrity_lvol_blk_nightly
|
|
|
|
run_test ./test/vhost/spdk_vhost.sh --integrity-lvol-blk-nightly
|
|
|
|
timing_exit integrity_lvol_blk_nightly
|
2018-04-16 21:27:56 +02:00
|
|
|
|
|
|
|
timing_enter vhost_migration
|
|
|
|
run_test ./test/vhost/spdk_vhost.sh --migration
|
|
|
|
timing_exit vhost_migration
|
2017-11-21 10:33:20 +01:00
|
|
|
fi
|
2017-11-09 16:38:44 -07:00
|
|
|
|
2018-03-15 19:40:13 +01:00
|
|
|
if [ $RUN_NIGHTLY_FAILING -eq 1 ]; then
|
|
|
|
timing_enter readonly
|
|
|
|
run_test ./test/vhost/spdk_vhost.sh --readonly
|
|
|
|
timing_exit readonly
|
|
|
|
fi
|
|
|
|
|
2017-11-09 16:38:44 -07:00
|
|
|
timing_enter integrity_lvol_scsi
|
2017-07-25 12:27:43 +02:00
|
|
|
run_test ./test/vhost/spdk_vhost.sh --integrity-lvol-scsi
|
2017-11-09 16:38:44 -07:00
|
|
|
timing_exit integrity_lvol_scsi
|
|
|
|
|
2018-01-22 20:51:56 -05:00
|
|
|
timing_enter integrity_lvol_blk
|
|
|
|
run_test ./test/vhost/spdk_vhost.sh --integrity-lvol-blk
|
|
|
|
timing_exit integrity_lvol_blk
|
2017-11-09 16:38:44 -07:00
|
|
|
|
2017-10-23 17:03:18 +02:00
|
|
|
timing_exit vhost
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $SPDK_TEST_LVOL -eq 1 ]; then
|
2017-11-09 16:38:44 -07:00
|
|
|
timing_enter lvol
|
2018-02-07 14:57:05 +01:00
|
|
|
test_cases="1,50,51,52,53,100,101,102,150,200,201,250,251,252,253,254,255,"
|
2018-01-30 05:24:15 -05:00
|
|
|
test_cases+="300,301,450,451,452,550,600,601,650,651,652,654,655,"
|
2018-03-08 23:09:32 +01:00
|
|
|
test_cases+="700,701,750,751,752,753,754,755,800,801,802,803,804,10000"
|
2017-11-27 17:42:39 +01:00
|
|
|
run_test ./test/lvol/lvol.sh --test-cases=$test_cases
|
2017-12-18 14:20:41 -07:00
|
|
|
report_test_completion "lvol"
|
2017-11-09 16:38:44 -07:00
|
|
|
timing_exit lvol
|
2017-03-08 12:17:32 -07:00
|
|
|
fi
|
2017-03-02 15:12:20 +01:00
|
|
|
|
2017-09-12 15:47:30 +02:00
|
|
|
if [ $SPDK_TEST_VHOST_INIT -eq 1 ]; then
|
|
|
|
run_test ./test/vhost/initiator/blockdev.sh
|
2018-04-02 12:56:09 -07:00
|
|
|
report_test_completion "vhost_initiator"
|
2017-09-12 15:47:30 +02:00
|
|
|
fi
|
|
|
|
|
2018-04-03 16:07:39 -07:00
|
|
|
if [ $SPDK_TEST_PMDK -eq 1 ]; then
|
2018-03-07 19:46:11 +01:00
|
|
|
run_test ./test/pmem/pmem.sh -x
|
2017-09-26 15:02:52 +02:00
|
|
|
fi
|
|
|
|
|
2016-03-07 15:11:36 -07:00
|
|
|
timing_enter cleanup
|
2018-02-28 09:42:12 -07:00
|
|
|
autotest_cleanup
|
2016-03-07 15:11:36 -07:00
|
|
|
timing_exit cleanup
|
2015-09-21 14:48:40 -07:00
|
|
|
|
|
|
|
timing_exit autotest
|
|
|
|
chmod a+r $output_dir/timing.txt
|
|
|
|
|
2015-09-25 09:48:11 -07:00
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
2015-09-21 14:48:40 -07:00
|
|
|
# catch any stray core files
|
|
|
|
process_core
|
2015-10-22 11:26:21 -07:00
|
|
|
|
|
|
|
if hash lcov; then
|
|
|
|
# generate coverage data and combine with baseline
|
2017-02-27 12:37:33 -07: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
|
2017-06-30 09:58:21 -07:00
|
|
|
$LCOV -q -r $out/cov_total.info '*/dpdk/*' -o $out/cov_total.info
|
2017-07-12 15:11:57 -07:00
|
|
|
$LCOV -q -r $out/cov_total.info '/usr/*' -o $out/cov_total.info
|
2017-05-08 13:57:23 -07:00
|
|
|
git clean -f "*.gcda"
|
2017-06-20 15:29:43 -07:00
|
|
|
rm -f cov_base.info cov_test.info OLD_STDOUT OLD_STDERR
|
2015-10-22 11:26:21 -07:00
|
|
|
fi
|