From ed1ce3197ff210e69327f0b406fbb9084a807bf9 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Wed, 28 Mar 2018 09:13:58 -0400 Subject: [PATCH] test/iscsi: use iSCSI configuration instead of hard coded values Change-Id: Ia536d956c7393c244afc29d44196207ac73f48be Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/405545 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris --- test/iscsi_tgt/calsoft/calsoft.sh | 2 +- test/iscsi_tgt/digests/digests.sh | 2 +- test/iscsi_tgt/filesystem/filesystem.sh | 2 +- test/iscsi_tgt/fio/fio.sh | 2 +- test/iscsi_tgt/initiator/initiator.sh | 2 +- test/iscsi_tgt/ip_migration/ip_migration.sh | 4 ++-- test/iscsi_tgt/multiconnection/multiconnection.sh | 4 ++-- test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh | 4 ++-- test/iscsi_tgt/rbd/rbd.sh | 2 +- test/iscsi_tgt/reset/reset.sh | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/iscsi_tgt/calsoft/calsoft.sh b/test/iscsi_tgt/calsoft/calsoft.sh index 4b2b5210df..18f572488e 100755 --- a/test/iscsi_tgt/calsoft/calsoft.sh +++ b/test/iscsi_tgt/calsoft/calsoft.sh @@ -42,7 +42,7 @@ $rpc_py construct_malloc_bdev -b MyBdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE # "1:2" ==> map PortalGroup1 to InitiatorGroup2 # "64" ==> iSCSI queue depth 64 # "0 0 0 1" ==> enable CHAP authentication using auth group 1 -$rpc_py construct_target_node Target3 Target3_alias 'MyBdev:0' '1:2' 64 -g 1 +$rpc_py construct_target_node Target3 Target3_alias 'MyBdev:0' $PORTAL_TAG:$INITIATOR_TAG 64 -g 1 sleep 1 if [ "$1" ]; then diff --git a/test/iscsi_tgt/digests/digests.sh b/test/iscsi_tgt/digests/digests.sh index 7ab22d149a..3e0e6b2b3b 100755 --- a/test/iscsi_tgt/digests/digests.sh +++ b/test/iscsi_tgt/digests/digests.sh @@ -85,7 +85,7 @@ $rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE # "1:2" ==> map PortalGroup1 to InitiatorGroup2 # "64" ==> iSCSI queue depth 64 # "-d" ==> disable CHAP authentication -$rpc_py construct_target_node Target3 Target3_alias 'Malloc0:0' '1:2' 64 -d +$rpc_py construct_target_node Target3 Target3_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d sleep 1 iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT diff --git a/test/iscsi_tgt/filesystem/filesystem.sh b/test/iscsi_tgt/filesystem/filesystem.sh index c74138c87d..91c9214b80 100755 --- a/test/iscsi_tgt/filesystem/filesystem.sh +++ b/test/iscsi_tgt/filesystem/filesystem.sh @@ -51,7 +51,7 @@ fi # "1:2" ==> map PortalGroup1 to InitiatorGroup2 # "256" ==> iSCSI queue depth 256 # "-d" ==> disable CHAP authentication -$rpc_py construct_target_node Target1 Target1_alias 'lvs_0/lbd_0:0' '1:2' 256 -d +$rpc_py construct_target_node Target1 Target1_alias 'lvs_0/lbd_0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d sleep 1 iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT diff --git a/test/iscsi_tgt/fio/fio.sh b/test/iscsi_tgt/fio/fio.sh index a6a070e0e5..13337fa905 100755 --- a/test/iscsi_tgt/fio/fio.sh +++ b/test/iscsi_tgt/fio/fio.sh @@ -72,7 +72,7 @@ $rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE # "1:2" ==> map PortalGroup1 to InitiatorGroup2 # "64" ==> iSCSI queue depth 64 # "-d" ==> disable CHAP authentication -$rpc_py construct_target_node Target3 Target3_alias 'Malloc0:0' '1:2' 64 -d +$rpc_py construct_target_node Target3 Target3_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d sleep 1 iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT diff --git a/test/iscsi_tgt/initiator/initiator.sh b/test/iscsi_tgt/initiator/initiator.sh index 5beeefffba..f67dccb476 100755 --- a/test/iscsi_tgt/initiator/initiator.sh +++ b/test/iscsi_tgt/initiator/initiator.sh @@ -32,7 +32,7 @@ $rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE # "1:2" ==> map PortalGroup1 to InitiatorGroup2 # "64" ==> iSCSI queue depth 64 # "-d" ==> disable CHAP authentication -$rpc_py construct_target_node disk1 disk1_alias 'Malloc0:0' '1:2' 256 -d +$rpc_py construct_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d sleep 1 trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT $rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdev.conf -q 128 -s 4096 -w verify -t 5 -d 512 diff --git a/test/iscsi_tgt/ip_migration/ip_migration.sh b/test/iscsi_tgt/ip_migration/ip_migration.sh index 8424d05195..341a26f1cf 100755 --- a/test/iscsi_tgt/ip_migration/ip_migration.sh +++ b/test/iscsi_tgt/ip_migration/ip_migration.sh @@ -22,14 +22,14 @@ function kill_all_iscsi_target() { function rpc_config() { # $1 = RPC server address # $2 = Netmask - $rpc_py -s $1 add_initiator_group 1 ANY $2 + $rpc_py -s $1 add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $2 $rpc_py -s $1 construct_malloc_bdev 64 512 } function rpc_add_target_node() { $rpc_py -s $1 add_ip_address 1 $MIGRATION_ADDRESS $rpc_py -s $1 add_portal_group $PORTAL_TAG $MIGRATION_ADDRESS:$ISCSI_PORT - $rpc_py -s $1 construct_target_node target1 target1_alias 'Malloc0:0' '1:1' 64 -d + $rpc_py -s $1 construct_target_node target1 target1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d } timing_enter ip_migration diff --git a/test/iscsi_tgt/multiconnection/multiconnection.sh b/test/iscsi_tgt/multiconnection/multiconnection.sh index 17a139e333..ab7098ebf0 100755 --- a/test/iscsi_tgt/multiconnection/multiconnection.sh +++ b/test/iscsi_tgt/multiconnection/multiconnection.sh @@ -57,7 +57,7 @@ waitforlisten $iscsipid timing_exit start_iscsi_tgt $rpc_py add_portal_group $PORTAL_TAG $TARGET_IP:$ISCSI_PORT -$rpc_py add_initiator_group 1 ANY $INITIATOR_IP/32 +$rpc_py add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $NETMASK echo "Creating an iSCSI target node." ls_guid=$($rpc_py construct_lvol_store "Nvme0n1" "lvs0" -c 1048576) @@ -71,7 +71,7 @@ done for i in `seq 1 $CONNECTION_NUMBER`; do lun="lvs0/lbd_$i:0" - $rpc_py construct_target_node Target$i Target${i}_alias "$lun" "1:1" 256 -d + $rpc_py construct_target_node Target$i Target${i}_alias "$lun" $PORTAL_TAG:$INITIATOR_TAG 256 -d done sleep 1 diff --git a/test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh b/test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh index 7283d1b540..6614da6464 100755 --- a/test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh +++ b/test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh @@ -54,11 +54,11 @@ timing_exit start_iscsi_tgt echo "Creating an iSCSI target node." $rpc_py -s "$iscsi_rpc_addr" add_portal_group $PORTAL_TAG $TARGET_IP:$ISCSI_PORT -$rpc_py -s "$iscsi_rpc_addr" add_initiator_group 1 ANY $INITIATOR_IP/32 +$rpc_py -s "$iscsi_rpc_addr" add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $NETMASK if [ $1 -eq 0 ]; then $rpc_py -s "$iscsi_rpc_addr" construct_nvme_bdev -b "Nvme0" -t "rdma" -f "ipv4" -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT -n nqn.2016-06.io.spdk:cnode1 fi -$rpc_py -s "$iscsi_rpc_addr" construct_target_node Target1 Target1_alias 'Nvme0n1:0' '1:1' 64 -d +$rpc_py -s "$iscsi_rpc_addr" construct_target_node Target1 Target1_alias 'Nvme0n1:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d sleep 1 echo "Logging in to iSCSI target." diff --git a/test/iscsi_tgt/rbd/rbd.sh b/test/iscsi_tgt/rbd/rbd.sh index 0aa0a8fd41..aec125de89 100755 --- a/test/iscsi_tgt/rbd/rbd.sh +++ b/test/iscsi_tgt/rbd/rbd.sh @@ -36,7 +36,7 @@ $rpc_py get_bdevs # "1:2" ==> map PortalGroup1 to InitiatorGroup2 # "64" ==> iSCSI queue depth 64 # "-d" ==> disable CHAP authentication -$rpc_py construct_target_node Target3 Target3_alias 'Ceph0:0' '1:2' 64 -d +$rpc_py construct_target_node Target3 Target3_alias 'Ceph0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d sleep 1 iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT diff --git a/test/iscsi_tgt/reset/reset.sh b/test/iscsi_tgt/reset/reset.sh index 21eb1e8f22..9f36c7cb5d 100755 --- a/test/iscsi_tgt/reset/reset.sh +++ b/test/iscsi_tgt/reset/reset.sh @@ -39,7 +39,7 @@ $rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE # "1:2" ==> map PortalGroup1 to InitiatorGroup2 # "64" ==> iSCSI queue depth 64 # "-d" ==> disable CHAP authentication -$rpc_py construct_target_node Target3 Target3_alias 'Malloc0:0' '1:2' 64 -d +$rpc_py construct_target_node Target3 Target3_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d sleep 1 iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT