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 # $1 = "iso" - triggers isolation mode (setting up required environment).
9 # $2 = test type posix or vpp. defaults to posix.
12 timing_enter iscsi_lvol
16 if [ $RUN_NIGHTLY -eq 1 ]; then
24 rpc_py
="$rootdir/scripts/rpc.py"
25 fio_py
="$rootdir/scripts/fio.py"
27 timing_enter start_iscsi_tgt
29 $ISCSI_APP -m $ISCSI_TEST_CORE_MASK --wait-for-rpc &
31 echo "Process pid: $pid"
33 trap "iscsicleanup; killprocess $pid; iscsitestfini $1 $2; exit 1" SIGINT SIGTERM EXIT
36 $rpc_py set_iscsi_options
-o 30 -a 16
37 $rpc_py start_subsystem_init
38 echo "iscsi_tgt is listening. Running tests..."
40 timing_exit start_iscsi_tgt
43 $rpc_py add_portal_group
$PORTAL_TAG $TARGET_IP:$ISCSI_PORT
44 # Create the first LVS from a Raid-0 bdev, which is created from two malloc bdevs
45 # Create remaining LVSs from a malloc bdev, respectively
46 for i
in $
(seq 1 $NUM_LVS); do
47 INITIATOR_TAG
=$
((i
+ 2))
48 $rpc_py add_initiator_group
$INITIATOR_TAG $INITIATOR_NAME $NETMASK
50 # construct RAID bdev and put its name in $bdev
51 malloc_bdevs
="$($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE) "
52 malloc_bdevs
+="$($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
53 $rpc_py construct_raid_bdev
-n raid0
-s 64 -r 0 -b "$malloc_bdevs"
56 # construct malloc bdev and put its name in $bdev
57 bdev
=$
($rpc_py construct_malloc_bdev
$MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)
59 ls_guid
=$
($rpc_py construct_lvol_store
$bdev lvs_
$i -c 1048576)
61 for j
in $
(seq 1 $NUM_LVOL); do
62 lb_name
=$
($rpc_py construct_lvol_bdev
-u $ls_guid lbd_
$j 10)
63 LUNs
+="$lb_name:$((j - 1)) "
65 $rpc_py construct_target_node Target
$i Target
${i}_alias
"$LUNs" "1:$INITIATOR_TAG" 256 -d
71 timing_enter discovery
72 iscsiadm
-m discovery
-t sendtargets
-p $TARGET_IP:$ISCSI_PORT
73 iscsiadm
-m node
--login -p $TARGET_IP:$ISCSI_PORT
77 $fio_py -p iscsi
-i 131072 -d 8 -t randwrite
-r 10 -v
80 rm -f .
/local-job0-0-verify.state
81 trap - SIGINT SIGTERM EXIT
87 timing_exit iscsi_lvol