2015-09-21 21:48:40 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
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
|
|
|
|
"
|
|
|
|
export LCOV="lcov $LCOV_OPTS"
|
|
|
|
export GENHTML="genhtml $LCOV_OPTS"
|
2015-10-22 18:26:21 +00:00
|
|
|
# zero out coverage data
|
2015-11-11 20:09:51 +00:00
|
|
|
$LCOV -q -c -i -t "Baseline" -d $src -o cov_base.info
|
2015-10-22 18:26:21 +00:00
|
|
|
fi
|
|
|
|
|
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
|
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
#####################
|
|
|
|
# Unit Tests
|
|
|
|
#####################
|
|
|
|
|
|
|
|
timing_enter lib
|
|
|
|
|
2016-07-20 18:16:23 +00:00
|
|
|
time test/lib/bdev/blockdev.sh
|
2016-05-24 18:04:20 +00:00
|
|
|
time test/lib/event/event.sh
|
2015-09-21 21:48:40 +00:00
|
|
|
time test/lib/nvme/nvme.sh
|
2016-06-07 17:34:03 +00:00
|
|
|
time test/lib/nvmf/nvmf.sh
|
2015-09-21 21:48:40 +00:00
|
|
|
time test/lib/memory/memory.sh
|
2015-12-03 21:30:38 +00:00
|
|
|
time test/lib/ioat/ioat.sh
|
2016-05-09 20:16:32 +00:00
|
|
|
time test/lib/json/json.sh
|
2016-05-23 22:01:04 +00:00
|
|
|
time test/lib/jsonrpc/jsonrpc.sh
|
2016-05-09 22:27:37 +00:00
|
|
|
time test/lib/log/log.sh
|
2016-07-27 16:32:00 +00:00
|
|
|
time test/lib/scsi/scsi.sh
|
2015-09-21 21:48:40 +00:00
|
|
|
|
|
|
|
timing_exit lib
|
|
|
|
|
2016-06-07 15:49:44 +00:00
|
|
|
timing_enter nvmf
|
|
|
|
|
|
|
|
time test/nvmf/fio/fio.sh
|
|
|
|
time test/nvmf/filesystem/filesystem.sh
|
2016-06-22 23:23:36 +00:00
|
|
|
time test/nvmf/discovery/discovery.sh
|
2016-06-07 15:49:44 +00:00
|
|
|
|
|
|
|
timing_exit nvmf
|
|
|
|
|
2016-03-07 22:11:36 +00:00
|
|
|
timing_enter 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
|
2015-11-11 20:09:51 +00:00
|
|
|
$LCOV -q -c -d $src -t "$(hostname)" -o cov_test.info
|
|
|
|
$LCOV -q -a cov_base.info -a cov_test.info -o cov_total.info
|
|
|
|
$LCOV -q -r cov_total.info '/usr/*' -o cov_total.info
|
|
|
|
$LCOV -q -r cov_total.info 'test/*' -o cov_total.info
|
|
|
|
$GENHTML cov_total.info -t "$(hostname)" -o $out/coverage
|
2015-10-22 18:26:21 +00:00
|
|
|
chmod -R a+rX $out/coverage
|
|
|
|
rm cov_base.info cov_test.info
|
|
|
|
mv cov_total.info $out/cov_total.info
|
|
|
|
find . -name "*.gcda" -delete
|
|
|
|
fi
|