#!/bin/bash
-
+set -e
######################################################################
# customize per survey
# Set this true to check file contents
verify=${verify:-0}
+# test targets
+targets=${targets:-""}
+# test case
+case=${case:-"disk"}
+
# total size (MBytes) per obd instance
# large enough to avoid cache effects
# and to make test startup/shutdown overhead insignificant
gawk < $rfile \
'/^Selected device [0-9]+$/ {n = 0; next}\
/error/ {n = -1; exit}\
+ /^Total/ {next}\
/^[0-9]+\/[0-9]+ Total: [0-9]+\.[0-9]+\/second$/ {n++; v=strtonum($3); \
if (n == 1 || v < min) min = v;\
if (n == 1 || v > max) max = v;\
esac
}
+# for "echo_client + obdfilter" case, "prep + commit" mode should be used
+# for "echo_client + osc" case, "BRW" mode should be used
+testcase2mode() {
+ case $case in
+ disk) echo "p$1";;
+ *) echo "g";;
+ esac
+}
+
print_summary () {
if [ "$1" = "-n" ]; then
minusn=$1; shift
#####################################################################
# One can change variable values in this section as per requirements
-targets=${targets:-""}
-case=${case:-"disk"}
if [ -n "$targets" ]; then
declare -a ost_names
declare -a client_names
ndevs=$((ndevs+1))
done
if [ $case == "disk" ]; then
- for ((i = 0; i < $ndevs; i++)); do
- ost_names[$i]=${client_names[$i]}
- done
+ if [ $rszhi -gt 1024 ]; then
+ echo "Test disk case support maximum 1024KB IO data" \
+ "(rszhi=$rszhi is too big) please use a smaller value."
+ exit 1
+ fi
+ for ((i = 0; i < $ndevs; i++)); do
+ ost_names[$i]=${client_names[$i]}
+ done
fi
if [ $case == "netdisk" ]; then
if [ "$targets" ]; then
echo >> ${cmdsf}_${host} \
"$lctl > $tmpfi 2>&1 \\
--threads $thr -$snap $devno \\
- test_brw $count `testname2type $test` q $pages ${thr_per_obj}t${first_obj} &"
+ test_brw $count `testname2type $test` q $pages \\
+ ${thr_per_obj}t${first_obj} `testcase2mode $pages` &"
done
pidcount=0
for host in ${unique_hosts[@]}; do