Commit df828306 authored by Karol Latecki's avatar Karol Latecki Committed by Tomasz Zawadzki
Browse files

test/nvmf/digest: group digest error tests



Group these tests under a function, so that
we can run other digest tests which don't
rely on error injection.

Change-Id: I3589fc817d079c337278c0b3d30569f77398aebb
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20964


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent 67174d0f
Loading
Loading
Loading
Loading
+27 −23
Original line number Diff line number Diff line
@@ -55,13 +55,11 @@ run_bperf() {
	killprocess $bperfpid
}

# This test only makes sense for the TCP transport
[[ "$TEST_TRANSPORT" != "tcp" ]] && exit 1

run_digest_error() {
	nvmftestinit
	nvmfappstart --wait-for-rpc

rpc_cmd << CONFIG
	rpc_cmd <<- CONFIG
		accel_assign_opc -o crc32c -m error
		framework_start_init
		bdev_null_create null0 100 4096
@@ -71,8 +69,6 @@ rpc_cmd << CONFIG
		nvmf_subsystem_add_listener -t tcp -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT" "$nqn"
	CONFIG

trap cleanup SIGINT SIGTERM EXIT

	# Test the reads - the host should detect digest errors and retry the requests until successful.
	run_bperf randread 4096 128
	run_bperf randread $((128 * 1024)) 16
@@ -82,6 +78,14 @@ run_bperf randread $((128 * 1024)) 16
	# within a CapsuleCmd as well as large ones requiring H2CData PDUs.
	run_bperf randwrite 4096 128
	run_bperf randwrite $((128 * 1024)) 16
	nvmftestfini
}

# This test only makes sense for the TCP transport
[[ "$TEST_TRANSPORT" != "tcp" ]] && exit 1

trap cleanup SIGINT SIGTERM EXIT

run_test "nvmf_digest_error" run_digest_error

trap - SIGINT SIGTERM EXIT
nvmftestfini