test/iscsi_tgt: remove almost repeated lines from digests.sh

Change-Id: I781c1ffcde45c4d9dd08188b5c5ca4351ab2b3e9
Signed-off-by: chenlo2x <longx.o.chen@intel.com>
Reviewed-on: https://review.gerrithub.io/401785
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
chenlo2x 2018-02-28 17:12:53 +08:00 committed by Jim Harris
parent e23fe2fc80
commit f697ca088e

View File

@ -7,6 +7,10 @@ source $rootdir/test/iscsi_tgt/common.sh
function node_login_fio_logout()
{
for arg in "$@"
do
iscsiadm -m node -p $TARGET_IP:$PORT -o update -n node.conn[0].iscsi.$arg
done
iscsiadm -m node --login -p $TARGET_IP:$PORT
sleep 1
$fio_py 512 1 write 2
@ -19,15 +23,13 @@ function iscsi_header_digest_test()
{
# Enable HeaderDigest to CRC32C
timing_enter HeaderDigest_enabled
iscsiadm -m node -p $TARGET_IP:$PORT -o update -n node.conn[0].iscsi.HeaderDigest -v CRC32C
node_login_fio_logout
node_login_fio_logout "HeaderDigest -v CRC32C"
timing_exit HeaderDigest_enabled
# Let iscsi target to decide its preference on
# HeaderDigest based on its capability.
timing_enter preferred
iscsiadm -m node -p $TARGET_IP:$PORT -o update -n node.conn[0].iscsi.HeaderDigest -v CRC32C,None
node_login_fio_logout
node_login_fio_logout "HeaderDigest -v CRC32C,None"
timing_exit preferred
}
@ -35,31 +37,23 @@ function iscsi_header_data_digest_test()
{
# Only enable HeaderDigest to CRC32C
timing_enter HeaderDigest_enabled
iscsiadm -m node -p $TARGET_IP:$PORT -o update -n node.conn[0].iscsi.HeaderDigest -v CRC32C
iscsiadm -m node -p $TARGET_IP:$PORT -o update -n node.conn[0].iscsi.DataDigest -v None
node_login_fio_logout
node_login_fio_logout "HeaderDigest -v CRC32C" "DataDigest -v None"
timing_exit HeaderDigest_enabled
# Only enable DataDigest to CRC32C
timing_enter DataDigest_enabled
iscsiadm -m node -p $TARGET_IP:$PORT -o update -n node.conn[0].iscsi.HeaderDigest -v None
iscsiadm -m node -p $TARGET_IP:$PORT -o update -n node.conn[0].iscsi.DataDigest -v CRC32C
node_login_fio_logout
node_login_fio_logout "HeaderDigest -v None" "DataDigest -v CRC32C"
timing_exit DataDigest_enabled
# Let iscsi target to decide its preference on both
# HeaderDigest and DataDigest based on its capability.
timing_enter both_preferred
iscsiadm -m node -p $TARGET_IP:$PORT -o update -n node.conn[0].iscsi.HeaderDigest -v CRC32C,None
iscsiadm -m node -p $TARGET_IP:$PORT -o update -n node.conn[0].iscsi.DataDigest -v CRC32C,None
node_login_fio_logout
node_login_fio_logout "HeaderDigest -v CRC32C,None" "DataDigest -v CRC32C,None"
timing_exit both_preferred
# Enable HeaderDigest and DataDigest both.
timing_enter both_enabled
iscsiadm -m node -p $TARGET_IP:$PORT -o update -n node.conn[0].iscsi.HeaderDigest -v CRC32C
iscsiadm -m node -p $TARGET_IP:$PORT -o update -n node.conn[0].iscsi.DataDigest -v CRC32C
node_login_fio_logout
node_login_fio_logout "HeaderDigest -v CRC32C" "DataDigest -v CRC32C"
timing_exit both_enabled
}