]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/test/iscsi_tgt/rpc_config/rpc_config.sh
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / spdk / test / iscsi_tgt / rpc_config / rpc_config.sh
1 #!/usr/bin/env bash
2
3 testdir=$(readlink -f $(dirname $0))
4 rootdir=$(readlink -f $testdir/../../..)
5 source $rootdir/scripts/autotest_common.sh
6
7 if [ -z "$TARGET_IP" ]; then
8 echo "TARGET_IP not defined in environment"
9 exit 1
10 fi
11
12 if [ -z "$INITIATOR_IP" ]; then
13 echo "INITIATOR_IP not defined in environment"
14 exit 1
15 fi
16
17 timing_enter rpc_config
18
19 # iSCSI target configuration
20 PORT=3260
21 RPC_PORT=5260
22 INITIATOR_TAG=2
23 INITIATOR_NAME=ALL
24 NETMASK=$INITIATOR_IP/32
25 MALLOC_BDEV_SIZE=64
26
27
28 rpc_py=$rootdir/scripts/rpc.py
29 rpc_config_py="python $testdir/rpc_config.py"
30
31
32 ./app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf &
33 pid=$!
34 echo "Process pid: $pid"
35
36 trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
37
38 waitforlisten $pid ${RPC_PORT}
39 echo "iscsi_tgt is listening. Running tests..."
40
41 $rpc_config_py $rpc_py
42
43 $rpc_py get_bdevs
44
45 trap - SIGINT SIGTERM EXIT
46
47 iscsicleanup
48 killprocess $pid
49 timing_exit rpc_config