diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 3ca6ddb66..59651178c 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -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 } diff --git a/test/nvme/nvme_opal.sh b/test/nvme/nvme_opal.sh index c587de573..39dd87774 100755 --- a/test/nvme/nvme_opal.sh +++ b/test/nvme/nvme_opal.sh @@ -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 &