summaryrefslogtreecommitdiff
path: root/qa/509
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/509
downloadpcp-47e6e7c84f008a53061e661f31ae96629bc694ef.tar.gz
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/509')
-rwxr-xr-xqa/50966
1 files changed, 66 insertions, 0 deletions
diff --git a/qa/509 b/qa/509
new file mode 100755
index 0000000..1409f75
--- /dev/null
+++ b/qa/509
@@ -0,0 +1,66 @@
+#!/bin/sh
+# PCP QA Test No. 509
+# Expose bug in pmcd/dbpmda handling of derived metrics and unknown
+# metrics in same pmLookupName request.
+#
+# Copyright (c) 2012 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!
+username=`id -u -n`
+$sudo rm -rf $tmp.* $seq.full
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+cat <<End-of-File >$tmp.def
+my.derived = sample.bin
+End-of-File
+
+_filter()
+{
+ sed \
+ -e 's/0x[0-9a-f][0-9a-f]*/ADDR/g' \
+ -e "s; -U $username;;" \
+ -e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
+ -e '/PMNS Checksums/s/=[0-9a-f][0-9a-f]*/=CHECKSUM/g' \
+ -e '/Loaded Version 1 or 2/s/ent = [0-9][0-9]/ent = NN/' \
+ -e '/pmResult dump/s/ [0-9][0-9]*:00:00/ HH:00:00/' \
+ | $PCP_AWK_PROG '
+BEGIN { state = 0; outf = "'$tmp.tmp'.0" }
+state == "0" && $1 == "pmLoadNameSpace:" { state = 1; outf = "'$tmp.tmp'.1" }
+state == "1" && $1 != "pmLoadNameSpace:" { state = 2; outf = "'$tmp.tmp'.2" }
+ { print >outf }'
+
+ [ -f $tmp.tmp.0 ] && cat $tmp.tmp.0
+ if [ -f $tmp.tmp.1 ]
+ then
+ grep ' 29' $tmp.tmp.1 \
+ | LC_COLLATE=POSIX sort
+ fi
+ [ -f $tmp.tmp.2 ] && cat $tmp.tmp.2
+}
+
+# real QA test starts here
+pminfo -D pmns -mf -c $tmp.def \
+ sample.secret.foo.one my.derived foo.bar sample.secret.foo.two \
+ >$tmp.out 2>$tmp.err
+_filter <$tmp.out
+_filter <$tmp.err
+
+pipeargs="-d 29"
+id pcp >/dev/null 2>&1 && pipeargs="$pipeargs -U $username"
+
+export PCP_DERIVED_CONFIG=$tmp.def
+cat <<End-of-File | dbpmda -D pmns -ie >$tmp.out 2>$tmp.err
+open pipe $PCP_PMDAS_DIR/sample/pmdasample $pipeargs
+fetch sample.secret.foo.one, my.derived, sample.secret.foo.two
+End-of-File
+_filter <$tmp.out
+_filter <$tmp.err