summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/simple/52_ctdb_fetch.sh
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-07-30 12:02:27 +0200
committerMichael Adam <obnox@samba.org>2009-08-04 09:46:40 +0200
commit6cf67b9bb00f6c134c0c49c95d9825eab266cdd4 (patch)
tree63c93b94e2e9c2c7b1a3dc1e513dfd3cf27662b9 /ctdb/tests/simple/52_ctdb_fetch.sh
parent572d397626d8faa822d3d2b4b707a83d8b4feb62 (diff)
downloadsamba-6cf67b9bb00f6c134c0c49c95d9825eab266cdd4.tar.gz
samba-6cf67b9bb00f6c134c0c49c95d9825eab266cdd4.tar.xz
samba-6cf67b9bb00f6c134c0c49c95d9825eab266cdd4.zip
tests: fix the 52_ctdb_fetch.sh test.
The parser for the output of the ctdb_fetch program did not match the output that ctdb_fetch generates. It seemed to rather come from the ctdb_bench test... This patch adapts the parser to correctly interpret the output of ctdb_fetch. Michael (This used to be ctdb commit 836b95f32724cf37e4f643f20653f78842613692)
Diffstat (limited to 'ctdb/tests/simple/52_ctdb_fetch.sh')
-rwxr-xr-xctdb/tests/simple/52_ctdb_fetch.sh45
1 files changed, 9 insertions, 36 deletions
diff --git a/ctdb/tests/simple/52_ctdb_fetch.sh b/ctdb/tests/simple/52_ctdb_fetch.sh
index 3f0ecffb5c0..236b697e9cd 100755
--- a/ctdb/tests/simple/52_ctdb_fetch.sh
+++ b/ctdb/tests/simple/52_ctdb_fetch.sh
@@ -40,17 +40,20 @@ num_nodes=$(echo "$out" | wc -l)
echo "Running ctdb_fetch on all $num_nodes nodes."
try_command_on_node -v -pq all $CTDB_TEST_WRAPPER $VALGRIND ctdb_fetch -n $num_nodes
+pat='^(Fetch: [[:digit:]]+(\.[[:digit:]]+)? msgs/sec[[:space:]]?|msg_count=[[:digit:]]+ on node [[:digit:]]|Fetching final record|DATA:|Test data|Waiting for cluster[[:space:]]?|)+$'
+sanity_check_output 1 "$pat" "$out"
+
+# Filter out the performance figures:
+out_fetch=$(echo "$out" | egrep '^(Fetch: .*)+$')
+
# Get the last line of output.
while read line ; do
prev=$line
-done <<<"$out"
-
-pat='^(Ring: [[:digit:]]+(\.[[:digit:]]+)? msgs/sec \(\+ve=[[:digit:]]+ -ve=[[:digit:]]+\)[[:space:]]?|Waiting for cluster[[:space:]]?)+$'
-sanity_check_output 1 "$pat" "$out"
+done <<<"$out_fetch"
# $prev should look like this:
-# Ring: 10670.93 msgs/sec (+ve=53391 -ve=53373)
-stuff="${prev##*Ring: }"
+# Fetch: 10670.93 msgs/sec
+stuff="${prev##*Fetch: }"
mps="${stuff% msgs/sec*}"
if [ ${mps%.*} -ge 10 ] ; then
@@ -59,33 +62,3 @@ else
echo "BAD: $mps msgs/sec < 10 msgs/sec"
exit 1
fi
-
-stuff="${stuff#*msgs/sec (+ve=}"
-positive="${stuff%% *}"
-
-if [ $positive -gt 0 ] ; then
- echo "OK: +ive ($positive) > 0"
-else
- echo "BAD: +ive ($positive) = 0"
- exit 1
-fi
-
-stuff="${stuff#*-ve=}"
-negative="${stuff%)}"
-
-if [ $negative -gt 0 ] ; then
- echo "OK: -ive ($negative) > 0"
-else
- echo "BAD: -ive ($negative) = 0"
- exit 1
-fi
-
-perc_diff=$(( ($positive - $negative) * 100 / $positive ))
-perc_diff=${perc_diff#-}
-
-if [ $perc_diff -le 1 ] ; then
- echo "OK: percentage difference between +ive and -ive ($perc_diff%) <= 1%"
-else
- echo "BAD: percentage difference between +ive and -ive ($perc_diff%) > 1%"
- exit 1
-fi