opal: Don't use set +e to ignore errors.

For errors that we do want to ignore, use || true after the commands.
This allows crashes in the background target application to fail
the tests.

Change-Id: I1fcd711c17ad0a956b6778260b2db8c0b801584f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475156
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ben Walker 2019-11-19 12:09:25 -07:00 committed by Tomasz Zawadzki
parent 91cc56ac15
commit 1a903f9c52
2 changed files with 4 additions and 10 deletions

View File

@ -914,14 +914,12 @@ function opal_revert_cleanup {
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
# Ignore if this fails.
$rootdir/scripts/rpc.py bdev_nvme_opal_revert -b nvme0 -p test || true
killprocess $spdk_tgt_pid
}

View File

@ -14,9 +14,7 @@ function opal_init() {
# Ignore bdev_nvme_opal_init failure because sometimes revert TPer might fail and
# in another run we don't want init to return errors to stop other tests.
set +e
$rpc_py bdev_nvme_opal_init -b nvme0 -p test
set -e
$rpc_py bdev_nvme_opal_init -b nvme0 -p test || true
}
function test_opal_cmds() {
@ -72,9 +70,7 @@ function clean_up() {
function revert() {
# Ignore revert failure and kill the process
set +e
$rpc_py bdev_nvme_opal_revert -b nvme0 -p test
set -e
$rpc_py bdev_nvme_opal_revert -b nvme0 -p test || true
}
$rootdir/app/spdk_tgt/spdk_tgt &