test/iscsi_tgt: Drop .ini config in favor of json
Change-Id: I7c6d9b01176526a3c255846891d48fe2745ab313 Signed-off-by: Michal Berger <michalx.berger@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1335 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
1f7d7a78e8
commit
d3f04b6463
@ -36,16 +36,12 @@ $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
|
|||||||
# "-d" ==> disable CHAP authentication
|
# "-d" ==> disable CHAP authentication
|
||||||
$rpc_py iscsi_create_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
$rpc_py iscsi_create_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
||||||
sleep 1
|
sleep 1
|
||||||
trap 'killprocess $pid; rm -f $testdir/bdev.conf; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
|
trap 'killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
|
||||||
|
|
||||||
# Prepare config file for iSCSI initiator
|
"$rootdir/test/bdev/bdevperf/bdevperf" --json <(initiator_json_config) -q 128 -o 4096 -w write -t 1
|
||||||
echo "[iSCSI_Initiator]" > $testdir/bdev.conf
|
"$rootdir/test/bdev/bdevperf/bdevperf" --json <(initiator_json_config) -q 128 -o 4096 -w read -t 1
|
||||||
echo " URL iscsi://$TARGET_IP/iqn.2016-06.io.spdk:disk1/0 iSCSI0" >> $testdir/bdev.conf
|
"$rootdir/test/bdev/bdevperf/bdevperf" --json <(initiator_json_config) -q 128 -o 4096 -w flush -t 1
|
||||||
$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdev.conf -q 128 -o 4096 -w write -t 1
|
"$rootdir/test/bdev/bdevperf/bdevperf" --json <(initiator_json_config) -q 128 -o 4096 -w unmap -t 1
|
||||||
$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdev.conf -q 128 -o 4096 -w read -t 1
|
|
||||||
$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdev.conf -q 128 -o 4096 -w flush -t 1
|
|
||||||
$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdev.conf -q 128 -o 4096 -w unmap -t 1
|
|
||||||
rm -f $testdir/bdev.conf
|
|
||||||
|
|
||||||
trap - SIGINT SIGTERM EXIT
|
trap - SIGINT SIGTERM EXIT
|
||||||
|
|
||||||
|
@ -185,3 +185,25 @@ function kill_vpp() {
|
|||||||
|
|
||||||
killprocess $vpp_pid
|
killprocess $vpp_pid
|
||||||
}
|
}
|
||||||
|
function initiator_json_config() {
|
||||||
|
# Prepare config file for iSCSI initiator
|
||||||
|
jq . <<-JSON
|
||||||
|
{
|
||||||
|
"subsystems": [
|
||||||
|
{
|
||||||
|
"subsystem": "bdev",
|
||||||
|
"config": [
|
||||||
|
{
|
||||||
|
"method": "bdev_iscsi_create",
|
||||||
|
"params": {
|
||||||
|
"name": "iSCSI0",
|
||||||
|
"url": "iscsi://$TARGET_IP/iqn.2016-06.io.spdk:disk1/0",
|
||||||
|
"initiator_iqn": "iqn.2016-06.io.spdk:disk1/0"
|
||||||
|
}
|
||||||
|
}${*:+,$*}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
JSON
|
||||||
|
}
|
||||||
|
@ -36,18 +36,14 @@ $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
|
|||||||
# "-d" ==> disable CHAP authentication
|
# "-d" ==> disable CHAP authentication
|
||||||
$rpc_py iscsi_create_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
$rpc_py iscsi_create_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
|
||||||
sleep 1
|
sleep 1
|
||||||
trap 'killprocess $pid; rm -f $testdir/bdev.conf; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
|
trap 'killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
|
||||||
|
|
||||||
# Prepare config file for iSCSI initiator
|
"$rootdir/test/bdev/bdevperf/bdevperf" --json <(initiator_json_config) -q 128 -o 4096 -w verify -t 5 -s 512
|
||||||
echo "[iSCSI_Initiator]" > $testdir/bdev.conf
|
|
||||||
echo " URL iscsi://$TARGET_IP/iqn.2016-06.io.spdk:disk1/0 iSCSI0" >> $testdir/bdev.conf
|
|
||||||
$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdev.conf -q 128 -o 4096 -w verify -t 5 -s 512
|
|
||||||
if [ $RUN_NIGHTLY -eq 1 ]; then
|
if [ $RUN_NIGHTLY -eq 1 ]; then
|
||||||
$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdev.conf -q 128 -o 4096 -w unmap -t 5 -s 512
|
"$rootdir/test/bdev/bdevperf/bdevperf" --json <(initiator_json_config) -q 128 -o 4096 -w unmap -t 5 -s 512
|
||||||
$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdev.conf -q 128 -o 4096 -w flush -t 5 -s 512
|
"$rootdir/test/bdev/bdevperf/bdevperf" --json <(initiator_json_config) -q 128 -o 4096 -w flush -t 5 -s 512
|
||||||
$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdev.conf -q 128 -o 4096 -w reset -t 10 -s 512
|
"$rootdir/test/bdev/bdevperf/bdevperf" --json <(initiator_json_config) -q 128 -o 4096 -w reset -t 10 -s 512
|
||||||
fi
|
fi
|
||||||
rm -f $testdir/bdev.conf
|
|
||||||
|
|
||||||
trap - SIGINT SIGTERM EXIT
|
trap - SIGINT SIGTERM EXIT
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user