test/nvme: Move ASAN check out of for loop

Check whether ASAN is enabled up front, before entering the loop over all PCI devices.

Change-Id: Iede6a0466014745b77190b79fb8255e7b61bb260
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453512
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
yidong0635 2019-05-07 12:32:40 -04:00 committed by Jim Harris
parent e560d53c12
commit 62966da34c

View File

@ -169,19 +169,15 @@ if [ `uname` = Linux ]; then
trap - SIGINT SIGTERM EXIT
kill_stub
fi
PLUGIN_DIR=$rootdir/examples/nvme/fio_plugin
if [ -d /usr/src/fio ]; then
if [ -d /usr/src/fio ] && [ $SPDK_RUN_ASAN -eq 0 ]; then
# Only test when ASAN is not enabled. If ASAN is enabled, we cannot test.
timing_enter fio_plugin
PLUGIN_DIR=$rootdir/examples/nvme/fio_plugin
for bdf in $(iter_pci_class_code 01 08 02); do
# Only test when ASAN is not enabled. If ASAN is enabled, we cannot test.
if [ $SPDK_RUN_ASAN -eq 0 ]; then
LD_PRELOAD=$PLUGIN_DIR/fio_plugin /usr/src/fio/fio $PLUGIN_DIR/example_config.fio --filename="trtype=PCIe traddr=${bdf//:/.} ns=1"
report_test_completion "bdev_fio"
fi
break
LD_PRELOAD=$PLUGIN_DIR/fio_plugin /usr/src/fio/fio $PLUGIN_DIR/example_config.fio --filename="trtype=PCIe traddr=${bdf//:/.} ns=1"
report_test_completion "bdev_fio"
done
timing_exit fio_plugin
fi