From f697ca088e4a156f7d0d340949ba0e9e535c1b2c Mon Sep 17 00:00:00 2001 From: chenlo2x Date: Wed, 28 Feb 2018 17:12:53 +0800 Subject: [PATCH] test/iscsi_tgt: remove almost repeated lines from digests.sh Change-Id: I781c1ffcde45c4d9dd08188b5c5ca4351ab2b3e9 Signed-off-by: chenlo2x Reviewed-on: https://review.gerrithub.io/401785 Tested-by: SPDK Automated Test System Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris --- test/iscsi_tgt/digests/digests.sh | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/test/iscsi_tgt/digests/digests.sh b/test/iscsi_tgt/digests/digests.sh index db3a798d91..55e82411ba 100755 --- a/test/iscsi_tgt/digests/digests.sh +++ b/test/iscsi_tgt/digests/digests.sh @@ -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 }