test/nvmf: don't use set +e
In fio.sh we used `set +e` for bdev deletion RPCs and for `wait $fio_pid`. Disabling errors from those RPCs doesn't make sense. We expect FIO to fail due to bdev hotremoval, but the bdev hotremoval itself must succeed. Besides, it's easy to forget to undo `set +e` so don't use it. For `wait` we can use the following paradigm instead: ``` rc=0 wait $pid || rc=$? ``` The same applies to nmic.sh, where we expect some RPC to fail. Change-Id: I66ce3504a0c6b5da497759f0688b6c0ea6480b61 Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457463 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com>
This commit is contained in:
parent
e2918289a1
commit
fafd4ec9fe
@ -52,15 +52,14 @@ $rootdir/scripts/fio.py -p nvmf -i 4096 -d 1 -t read -r 10 &
|
||||
fio_pid=$!
|
||||
|
||||
sleep 3
|
||||
set +e
|
||||
|
||||
$rpc_py destroy_raid_bdev "raid0"
|
||||
for malloc_bdev in $malloc_bdevs; do
|
||||
$rpc_py delete_malloc_bdev "$malloc_bdev"
|
||||
done
|
||||
|
||||
wait $fio_pid
|
||||
fio_status=$?
|
||||
fio_status=0
|
||||
wait $fio_pid || fio_status=$?
|
||||
|
||||
nvme disconnect -n "nqn.2016-06.io.spdk:cnode1" || true
|
||||
|
||||
@ -72,7 +71,6 @@ if [ $fio_status -eq 0 ]; then
|
||||
else
|
||||
echo "nvmf hotplug test: fio failed as expected"
|
||||
fi
|
||||
set -e
|
||||
|
||||
$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
|
||||
|
||||
|
@ -27,11 +27,10 @@ $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0
|
||||
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s "$NVMF_PORT"
|
||||
|
||||
echo "test case1: single bdev can't be used in multiple subsystems"
|
||||
set +e
|
||||
$rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode2 -a -s SPDK2
|
||||
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode2 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s "$NVMF_PORT"
|
||||
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode2 Malloc0
|
||||
nmic_status=$?
|
||||
nmic_status=0
|
||||
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode2 Malloc0 || nmic_status=$?
|
||||
|
||||
if [ $nmic_status -eq 0 ]; then
|
||||
echo " Adding namespace passed - failure expected."
|
||||
@ -41,7 +40,6 @@ if [ $nmic_status -eq 0 ]; then
|
||||
else
|
||||
echo " Adding namespace failed - expected result."
|
||||
fi
|
||||
set -e
|
||||
|
||||
echo "test case2: host connect to nvmf target in multiple paths"
|
||||
if [ ! -z $NVMF_SECOND_TARGET_IP ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user