3 testdir
=$
(readlink
-f $
(dirname $0))
4 rootdir
=$
(readlink
-f $testdir/..
/..
/..
)
5 source $rootdir/test
/common
/autotest_common.sh
6 source $rootdir/test
/iscsi_tgt
/common.sh
8 timing_enter bdev_io_wait
13 rpc_py
="$rootdir/scripts/rpc.py"
15 timing_enter start_iscsi_tgt
17 # Start the iSCSI target without using stub
18 # Reason: Two SPDK processes will be started
19 $ISCSI_APP -m 0x2 -p 1 -s 512 --wait-for-rpc &
21 echo "iSCSI target launched. pid: $pid"
22 trap "killprocess $pid;exit 1" SIGINT SIGTERM EXIT
24 $rpc_py set_iscsi_options
-o 30 -a 4
25 # Minimal number of bdev io pool (5) and cache (1)
26 $rpc_py set_bdev_options
-p 5 -c 1
27 $rpc_py start_subsystem_init
28 echo "iscsi_tgt is listening. Running tests..."
30 timing_exit start_iscsi_tgt
32 $rpc_py add_portal_group
$PORTAL_TAG $TARGET_IP:$ISCSI_PORT
33 $rpc_py add_initiator_group
$INITIATOR_TAG $INITIATOR_NAME $NETMASK
34 $rpc_py construct_malloc_bdev
$MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
35 # "Malloc0:0" ==> use Malloc0 blockdev for LUN0
36 # "1:2" ==> map PortalGroup1 to InitiatorGroup2
37 # "64" ==> iSCSI queue depth 64
38 # "-d" ==> disable CHAP authentication
39 $rpc_py construct_target_node disk1 disk1_alias
'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
41 trap "killprocess $pid; rm -f $testdir/bdev.conf; exit 1" SIGINT SIGTERM EXIT
43 # Prepare config file for iSCSI initiator
44 echo "[iSCSI_Initiator]" > $testdir/bdev.conf
45 echo " URL iscsi://$TARGET_IP/iqn.2016-06.io.spdk:disk1/0 iSCSI0" >> $testdir/bdev.conf
46 $rootdir/test
/bdev
/bdevperf
/bdevperf
-c $testdir/bdev.conf
-q 128 -o 4096 -w write -t 1
47 $rootdir/test
/bdev
/bdevperf
/bdevperf
-c $testdir/bdev.conf
-q 128 -o 4096 -w read -t 1
48 $rootdir/test
/bdev
/bdevperf
/bdevperf
-c $testdir/bdev.conf
-q 128 -o 4096 -w flush
-t 1
49 $rootdir/test
/bdev
/bdevperf
/bdevperf
-c $testdir/bdev.conf
-q 128 -o 4096 -w unmap
-t 1
50 rm -f $testdir/bdev.conf
52 trap - SIGINT SIGTERM EXIT
56 report_test_completion
"bdev_io_wait"
57 timing_exit bdev_io_wait