rally/samples/tasks/support/instance_dd_test.sh
Pavel Boldin 62c1f40efa Fix instance_dd_tests.sh always reading 1MiB
The dummy test script `instance_dd_test.sh' used for
`boot_runcommand_delete' reads only 1MiB disregarding thus reporting
wrong read performance.

Change-Id: I37f2913d6b525e7d65396e5db96a233987cc6679
Closes-Bug: #1448300
2015-04-24 23:43:09 +03:00

13 lines
362 B
Bash

#!/bin/sh
time_seconds(){ (time -p $1 ) 2>&1 |awk '/real/{print $2}'; }
file=/tmp/test.img
c=1000 #1GB
write_seq_1gb=$(time_seconds "dd if=/dev/zero of=$file bs=1M count=$c")
read_seq_1gb=$(time_seconds "dd if=$file of=/dev/null bs=1M count=$c")
[ -f $file ] && rm $file
echo "{
\"write_seq_1gb\": $write_seq_1gb,
\"read_seq_1gb\": $read_seq_1gb
}"