test/opal: Enable OPAL test
Also add opal_revert_cleanup at the start of autotest.sh because opal test might fail before revert and the drive might be kept locked and will cause deny of service in later test. Change-Id: Icb9d571c59804daa559784cee457c7e804eff121 Signed-off-by: Chunyang Hui <chunyang.hui@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471973 Reviewed-by: Changpeng Liu <changpeng.liu@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:
parent
62c8e6cb14
commit
2176f081dd
@ -134,6 +134,10 @@ if [[ $SPDK_TEST_CRYPTO -eq 1 || $SPDK_TEST_REDUCE -eq 1 ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
opal_revert_cleanup
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# Unit Tests
|
# Unit Tests
|
||||||
#####################
|
#####################
|
||||||
@ -259,6 +263,10 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
|
|||||||
if [ $SPDK_TEST_REDUCE -eq 1 ]; then
|
if [ $SPDK_TEST_REDUCE -eq 1 ]; then
|
||||||
run_test suite ./test/compress/compress.sh
|
run_test suite ./test/compress/compress.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $SPDK_TEST_OPAL -eq 1 ]; then
|
||||||
|
run_test suite ./test/nvme/nvme_opal.sh
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
timing_enter cleanup
|
timing_enter cleanup
|
||||||
|
@ -62,6 +62,7 @@ export RUN_NIGHTLY_FAILING
|
|||||||
: ${SPDK_TEST_OCF=0}; export SPDK_TEST_OCF
|
: ${SPDK_TEST_OCF=0}; export SPDK_TEST_OCF
|
||||||
: ${SPDK_TEST_FTL_EXTENDED=0}; export SPDK_TEST_FTL_EXTENDED
|
: ${SPDK_TEST_FTL_EXTENDED=0}; export SPDK_TEST_FTL_EXTENDED
|
||||||
: ${SPDK_TEST_VMD=0}; export SPDK_TEST_VMD
|
: ${SPDK_TEST_VMD=0}; export SPDK_TEST_VMD
|
||||||
|
: ${SPDK_TEST_OPAL=0}; export SPDK_TEST_OPAL
|
||||||
: ${SPDK_AUTOTEST_X=true}; export SPDK_AUTOTEST_X
|
: ${SPDK_AUTOTEST_X=true}; export SPDK_AUTOTEST_X
|
||||||
|
|
||||||
# Export PYTHONPATH with addition of RPC framework. New scripts can be created
|
# Export PYTHONPATH with addition of RPC framework. New scripts can be created
|
||||||
@ -877,6 +878,23 @@ function get_nvme_name_from_bdf {
|
|||||||
printf '%s\n' "${blkname[@]}"
|
printf '%s\n' "${blkname[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function opal_revert_cleanup {
|
||||||
|
$rootdir/app/spdk_tgt/spdk_tgt &
|
||||||
|
spdk_tgt_pid=$!
|
||||||
|
waitforlisten $spdk_tgt_pid
|
||||||
|
|
||||||
|
# ignore the result
|
||||||
|
set +e
|
||||||
|
# OPAL test only runs on the first NVMe device
|
||||||
|
# So we just revert the first one here
|
||||||
|
bdf=$($rootdir/scripts/gen_nvme.sh --json | jq -r '.config[].params | select(.name=="Nvme0").traddr')
|
||||||
|
$rootdir/scripts/rpc.py bdev_nvme_attach_controller -b "nvme0" -t "pcie" -a $bdf
|
||||||
|
$rootdir/scripts/rpc.py bdev_nvme_opal_revert -b nvme0 -p test
|
||||||
|
set -e
|
||||||
|
|
||||||
|
killprocess $spdk_tgt_pid
|
||||||
|
}
|
||||||
|
|
||||||
set -o errtrace
|
set -o errtrace
|
||||||
trap "trap - ERR; print_backtrace >&2" ERR
|
trap "trap - ERR; print_backtrace >&2" ERR
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user