Added shard performance tests (shard_perf_test.py and shard_multi_test.sh)
[integration/test.git] / test / tools / odl-mdsal-clustering-tests / clustering-performance-test / shard_multi_test.sh
1 #!/bin/sh
2
3 # author__ = "Jan Medved"
4 # copyright__ = "Copyright(c) 2014, Cisco Systems, Inc."
5 # license__ = "New-style BSD"
6 # email__ = "jmedved@cisco.com"
7
8 # Initialize our own variables:
9 instances=0
10 resource="both"
11 auth=false
12 threads=1
13 requests=1000
14
15 while getopts "h?ai:n:r:t:" opt; do
16     case "$opt" in
17     h|\?)
18         echo "This would be help"
19         exit 0
20         ;;
21     a)  auth=true
22         ;;
23     i)  instances=$OPTARG
24         ;;
25     n)  requests=$OPTARG
26         ;;
27     r)  resource=$OPTARG
28         ;;
29     t)  threads=$OPTARG
30         ;;
31     esac
32 done
33
34 shift $((OPTIND-1))
35
36 [ "$1" = "--" ] && shift
37
38 echo "Running $instances instances, parameters:\n  resource='$resource', requests=$requests, threads=$threads"
39
40 i=0
41 while [  $i -lt $instances ]; do
42     echo "Starting instance $i"
43     let i=$i+1
44     ./shard_perf_test.py --auth --resource $resource --requests $requests --threads $threads &
45 done
46
47 wait
48 echo "Done."
49
50 # End of file