summaryrefslogtreecommitdiff
path: root/qa/438
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
commit47e6e7c84f008a53061e661f31ae96629bc694ef (patch)
tree648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /qa/438
downloadpcp-debian.tar.gz
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/438')
-rwxr-xr-xqa/43851
1 files changed, 51 insertions, 0 deletions
diff --git a/qa/438 b/qa/438
new file mode 100755
index 0000000..e27ce82
--- /dev/null
+++ b/qa/438
@@ -0,0 +1,51 @@
+#!/bin/sh
+# PCP QA Test No. 438
+# Better code coverage for libpcp/src/logutil.c
+#
+# Copyright (c) 2010 Ken McDonell. All Rights Reserved.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+# get standard filters
+. ./common.product
+. ./common.filter
+. ./common.check
+
+status=0 # success is the default!
+$sudo rm -rf $tmp.* $seq.full
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# __pmLogChkLabel: fd=3 vol=0 [magic=50052602 version=2 vol=0 pid=3901 host=bozo]
+# __pmLogSetTime(0) 17:29:20.472 delta=0 at ti[0]@17:29:20.472 vol=0 posn=132 serial=1
+_filter()
+{
+ sed \
+ -e 's/pid=[0-9][0-9]*/pid=PID/' \
+ -e 's/host=[a-zA-Z][a-zA-Z0-9_]*/host=HOST/' \
+ -e 's/[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9]/TIME/g' \
+ -e 's/TIME (t=[0-9][0-9.]*)/TIME/g' \
+ -e 's/bad trailer len=132/bad trailer len=0/' \
+ -e '/__pmLogChkLabel/s/fd=[0-9]/fd=N/' \
+ | $PCP_AWK_PROG '
+$1 == "__pmLogOpen:" { print >"'$tmp'.0"; next }
+ { print >"'$tmp'.1" }'
+ LC_COLLATE=POSIX sort $tmp.0
+ cat $tmp.1
+}
+
+# real QA test starts here
+for i in src/badlen-*.0
+do
+ [ "$i" = "src/badlen-0.0" ] && continue
+ i=`echo $i | sed -e 's/\.0$//'`
+ echo | tee -a $seq.full
+ echo "--- $i ---" | tee -a $seq.full
+ pmdumplog -Dlog $i 2>&1 \
+ | tee -a $seq.full \
+ | _filter
+done
+
+# success, all done
+exit