Implement MOL-168 - Allow to run set of tests on single vm
diff --git a/scripts/data.py b/scripts/data.py
index dfe97a2..c53871d 100644
--- a/scripts/data.py
+++ b/scripts/data.py
@@ -16,7 +16,7 @@
         for val in eval(block):
             meta = val['__meta__']
             meta['sync'] = 's' if meta['sync'] else 'a'
-            key = "{action} {sync} {blocksize}k".format(**meta)
+            key = "{action} {sync} {blocksize}k {concurence}".format(**meta)
             results.setdefault(key, []).append(val['bw_mean'])
 
     processed_res = {}
@@ -31,8 +31,8 @@
 
 
 def ksort(x):
-    op, sync, sz = x.split(" ")
-    return (op, sync, int(sz[:-1]))
+    op, sync, sz, conc = x.split(" ")
+    return (op, sync, int(sz[:-1]), int(conc))
 
 
 def create_json_results(meta, file_data):
@@ -44,7 +44,7 @@
 
 
 def show_data(*pathes):
-    begin = "|  {:>10}  {:>5}  {:>5}"
+    begin = "|  {:>10}  {:>5}  {:>5} {:>3}"
     first_file_templ = "  |  {:>6} ~ {:>5} {:>2}% {:>5}"
     other_file_templ = "  |  {:>6} ~ {:>5} {:>2}% {:>5} ----  {:>6}%"
 
@@ -53,7 +53,7 @@
 
     header_ln = line_templ.replace("<", "^").replace(">", "^")
 
-    params = ["Oper", "Sync", "BSZ", "BW1", "DEV1", "%", "IOPS1"]
+    params = ["Oper", "Sync", "BSZ", "CC", "BW1", "DEV1", "%", "IOPS1"]
     for pos in range(1, len(pathes)):
         params += "BW{0}+DEV{0}+%+IOPS{0}+DIFF %".format(pos).split("+")
 
@@ -75,7 +75,7 @@
 
     for k in sorted(common_keys, key=ksort):
         tp = k.rsplit(" ", 1)[0]
-        op, s, sz = k.split(" ")
+        op, s, sz, conc = k.split(" ")
         s = 'sync' if s == 's' else 'async'
 
         if tp != prev_tp and prev_tp is not None:
@@ -88,7 +88,7 @@
         iops0 = m0 / int(sz[:-1])
         perc0 = int(d0 * 100.0 / m0 + 0.5)
 
-        data = [op, s, sz, m0, d0, perc0, iops0]
+        data = [op, s, sz, conc, m0, d0, perc0, iops0]
 
         for result in results[1:]:
             m, d = result[k]
diff --git a/scripts/run.sh b/scripts/run.sh
index b5bc41c..a5c8aaf 100644
--- a/scripts/run.sh
+++ b/scripts/run.sh
@@ -1,36 +1,48 @@
 #!/bin/bash
-set -x
 set -e
 
 type="iozone"
 
-bsizes="1k 4k 64k 256k 1m"
-ops="write randwrite"
-osync="s a"
-num_times=3
+bsizes="1k" # 4k 64k 256k 1m
+ops="write" # randwrite"
+osync="s" # a
+num_times="1"
+concurrences="1 2 4 8 16 32 64 128"
+aff_group="0077d59c-bf5b-4326-8940-027e77d655ee"
 
-for bsize in $bsizes ; do
-	for op in $ops ; do 
-		for sync in $osync ; do 
-			for counter in $(seq 1 $num_times) ; do
-				if [[ "$ops" == "write" && "$osync" == "s" ]] ; then
-					continue
-				fi
+for concurrence in $concurrences; do
+	for bsize in $bsizes ; do
+		for op in $ops ; do 
+			for sync in $osync ; do 
+				for counter in $(seq 1 $num_times) ; do
+					# if [[ "$ops" == "write" && "$osync" == "s" ]] ; then
+					# 	continue
+					# fi
 
-				if [[ "$sync" == "s" ]] ; then
-					ssync="-s"
-					factor="x500"
-				else
-					if [[ "$bsize" == "1k" || "$bsize" == "4k" ]] ; then
-						continue
+					if [[ "$sync" == "s" ]] ; then
+						ssync="-s"
+						factor="x500"
+					else
+						if [[ "$bsize" == "1k" || "$bsize" == "4k" ]] ; then
+							continue
+						fi
+
+						ssync=
+						factor="r2"
 					fi
 
-					ssync=
-					factor="r2"
-				fi
+					extra_opts="user=ubuntu,keypair_name=ceph,img_name=ubuntu,flavor_name=ceph.512"
+					extra_opts="${extra_opts},network_zone_name=net04,flt_ip_pool=net04_ext,key_file=ceph.pem"
+					extra_opts="${extra_opts},aff_group=${aff_group}"
 
-				io_opts="--type $type -a $op --iodepth 16 --blocksize $bsize --iosize $factor $ssync"
-				python run_test.py --runner rally -l -o "$io_opts" -t io-scenario $type --runner-extra-opts="--deployment $1"
+					io_opts="--type $type -a $op --iodepth 16 --blocksize $bsize --iosize $factor $ssync --concurrency $concurrence"
+
+					echo $io_opts
+					# python run_test.py --runner ssh -l -o "$io_opts" -t io-scenario $type --runner-extra-opts="$extra_opts"
+
+					# io_opts="--type $type -a $op --iodepth 16 --blocksize $bsize --iosize $factor $ssync"
+					# python run_test.py --runner rally -l -o "$io_opts" -t io-scenario $type --runner-extra-opts="--deployment $1"
+				done
 			done
 		done
 	done
diff --git a/scripts/run_2.sh b/scripts/run_2.sh
index 2265176..d343d69 100644
--- a/scripts/run_2.sh
+++ b/scripts/run_2.sh
@@ -24,10 +24,20 @@
 # 	nova keypair-add ceph > ceph.pem
 # fi
 
+# nova server-group-list | grep ' ceph ' | awk '{print $2}'
+aff_group="0077d59c-bf5b-4326-8940-027e77d655ee"
+
 set -e
 
-io_opts="--type $type -a write --iodepth 16 --blocksize 1m --iosize x20"
-python run_test.py --runner ssh -l -o "$io_opts" -t io-scenario $type --runner-extra-opts="ubuntu ceph.pem"
+iodepts="1"
+for iodepth in $iodepts; do
+	extra_opts="user=ubuntu,keypair_name=ceph,img_name=ubuntu,flavor_name=ceph.512"
+	extra_opts="${extra_opts},network_zone_name=net04,flt_ip_pool=net04_ext,key_file=ceph.pem"
+	extra_opts="${extra_opts},aff_group=${aff_group}"
+
+	io_opts="--type $type -a write --iodepth 16 --blocksize 1m --iosize x20"
+	python run_test.py --runner ssh -l -o "$io_opts" -t io-scenario $type --runner-extra-opts="$extra_opts"
+done
 
 # io_opts="--type $type -a write --iodepth 16 --blocksize 1m --iosize x20"
 # python run_test.py --runner rally -l -o "$io_opts" -t io-scenario $type --runner-extra-opts="--deployment perf-1"