blob: 3d409ca95682e99465d0650f470433c1686f7300 [file] [log] [blame]
koder aka kdanilov4a72f122015-02-09 12:25:54 +02001#!/bin/bash
koder aka kdanilov4a72f122015-02-09 12:25:54 +02002set -e
3
koder aka kdanilov83cd7132015-02-14 21:37:14 -08004# don't forget to change it in prepare.sh as well
5my_dir="$(dirname "$0")"
6source "$my_dir/config.sh"
koder aka kdanilov4a72f122015-02-09 12:25:54 +02007
koder aka kdanilov83cd7132015-02-14 21:37:14 -08008BLOCK_SIZES="1k 4k 64k 256k 1m"
9OPERATIONS="randwrite write randread read"
10SYNC_TYPES="s a d"
11REPEAT_COUNT="3"
12CONCURRENCES="1 8 64"
13IODEPTHS="16"
koder aka kdanilov4a72f122015-02-09 12:25:54 +020014
koder aka kdanilov4a72f122015-02-09 12:25:54 +020015
koder aka kdanilov83cd7132015-02-14 21:37:14 -080016SYNC_FACTOR="x500"
17DIRECT_FACTOR="x500"
18ASYNC_FACTOR="r2"
koder aka kdanilov3f356262015-02-13 08:06:14 -080019
koder aka kdanilove21d7472015-02-14 19:02:04 -080020
koder aka kdanilov83cd7132015-02-14 21:37:14 -080021function get_file_size_opts() {
22 SYNC_TYPE="$1"
23 if [ "$SYNC_TYPE" = "s" ] ; then
24 echo "--iosize $SYNC_FACTOR -s"
25 elif [ "$SYNC_TYPE" = "d" ] ; then
26 echo "--iosize $DIRECT_FACTOR -d"
27 else
28 echo "--iosize $ASYNC_FACTOR"
29 fi
30}
koder aka kdanilov3f356262015-02-13 08:06:14 -080031
koder aka kdanilov83cd7132015-02-14 21:37:14 -080032function echo_combinations() {
33 for IODEPTH in $IODEPTHS ; do
34 for CONCURRENCE in $CONCURRENCES ; do
35 for BSIZE in $BLOCK_SIZES ; do
36 for OPERATION in $OPERATIONS ; do
37 for SYNC_TYPE in $SYNC_TYPES ; do
koder aka kdanilov4a72f122015-02-09 12:25:54 +020038
koder aka kdanilov83cd7132015-02-14 21:37:14 -080039 # filter out too slow options
koder aka kdanilov7dec9df2015-02-15 21:35:19 -080040 if [ "$BSIZE" = "1k" -o "$BSIZE" = "4k" ] ; then
koder aka kdanilov83cd7132015-02-14 21:37:14 -080041 if [ "$SYNC_TYPE" = "a" ] ; then
42 continue
43 fi
44 fi
koder aka kdanilov4a72f122015-02-09 12:25:54 +020045
koder aka kdanilov83cd7132015-02-14 21:37:14 -080046 # filter out sync reads
47 if [ "$OPERATION" = "read" -o "$OPERATION" = "randread" ] ; then
48 if [ "$SYNC_TYPE" = "s" ] ; then
49 continue
50 fi
51 fi
koder aka kdanilov4a72f122015-02-09 12:25:54 +020052
koder aka kdanilov83cd7132015-02-14 21:37:14 -080053 FILE_SIZE_AND_SYNC=$(get_file_size_opts "$SYNC_TYPE")
koder aka kdanilov4a72f122015-02-09 12:25:54 +020054
koder aka kdanilov4a72f122015-02-09 12:25:54 +020055
koder aka kdanilov83cd7132015-02-14 21:37:14 -080056 IO_OPTS="--type $TESTER_TYPE "
57 IO_OPTS="$IO_OPTS -a $OPERATION "
58 IO_OPTS="$IO_OPTS --iodepth $IODEPTH "
59 IO_OPTS="$IO_OPTS --blocksize $BSIZE "
60 IO_OPTS="$IO_OPTS $FILE_SIZE_AND_SYNC "
61 IO_OPTS="$IO_OPTS --concurrency $CONCURRENCE"
koder aka kdanilov4a72f122015-02-09 12:25:54 +020062
koder aka kdanilov83cd7132015-02-14 21:37:14 -080063 for COUNTER in $(seq 1 $REPEAT_COUNT) ; do
64 echo $IO_OPTS
65 done
66 done
67 done
68 done
69 done
70 done
71}
72
73
74function run_test() {
75 OPTION_FILE="$1"
76
77 if [ ! -f "$OPTION_FILE" ] ; then
78 echo "Path to file with io.py options list should be passed"
79 exit 1
80 fi
81
82 if [ "$RUNNER" = "ssh" ] ; then
83 GROUP_ID=$(nova server-group-list | grep " $SERV_GROUP " | awk '{print $2}' )
84 EXTRA_OPTS="user=$IMAGE_USER"
85 EXTRA_OPTS="${EXTRA_OPTS},keypair_name=$KEYPAIR_NAME"
86 EXTRA_OPTS="${EXTRA_OPTS},img_name=$IMAGE_NAME"
87 EXTRA_OPTS="${EXTRA_OPTS},flavor_name=$FLAVOR_NAME"
88 EXTRA_OPTS="${EXTRA_OPTS},network_zone_name=$NETWORK_ZONE_NAME"
89 EXTRA_OPTS="${EXTRA_OPTS},flt_ip_pool=$FL_NETWORK_ZONE_NAME"
90 EXTRA_OPTS="${EXTRA_OPTS},key_file=$KEY_FILE_NAME"
91 EXTRA_OPTS="${EXTRA_OPTS},aff_group=$GROUP_ID"
92 EXTRA_OPTS="${EXTRA_OPTS},count=$VM_COUNT"
93 else
94 echo "Unsupported runner $RUNNER"
95 exit 1
96 fi
97
koder aka kdanilov6e2ae792015-03-04 18:02:24 -080098 RUN_TEST_OPTS="-t io -l --runner $RUNNER"
koder aka kdanilov83cd7132015-02-14 21:37:14 -080099 set -x
koder aka kdanilov6e2ae792015-03-04 18:02:24 -0800100 python run_test.py $RUN_TEST_OPTS --create-vms-opts="$EXTRA_OPTS" -f "$OPTION_FILE" $TESTER_TYPE
koder aka kdanilov83cd7132015-02-14 21:37:14 -0800101 set +x
102}
103
104if [ "$1" = '--prepare-opts' ] ; then
105 echo_combinations
106else
107 run_test $1
108fi
109