3 # Expose bug in pmcd/dbpmda handling of derived metrics and unknown
4 # metrics in same pmLookupName request.
6 # Copyright (c) 2012 Ken McDonell. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard filters
17 status
=0 # success is the default!
19 $sudo rm -rf $tmp.
* $seq.full
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
22 cat <<End-of-File >$tmp.def
23 my.derived = sample.bin
29 -e 's/0x[0-9a-f][0-9a-f]*/ADDR/g' \
30 -e "s; -U $username;;" \
31 -e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
32 -e '/PMNS Checksums/s/=[0-9a-f][0-9a-f]*/=CHECKSUM/g' \
33 -e '/Loaded Version 1 or 2/s/ent = [0-9][0-9]/ent = NN/' \
34 -e '/pmResult dump/s/ [0-9][0-9]*:00:00/ HH:00:00/' \
36 BEGIN { state = 0; outf = "'$tmp.tmp
'.0" }
37 state == "0" && $1 == "pmLoadNameSpace:" { state = 1; outf = "'$tmp.tmp
'.1" }
38 state == "1" && $1 != "pmLoadNameSpace:" { state = 2; outf = "'$tmp.tmp
'.2" }
41 [ -f $tmp.tmp
.0 ] && cat $tmp.tmp
.0
44 grep ' 29' $tmp.tmp
.1 \
45 | LC_COLLATE
=POSIX
sort
47 [ -f $tmp.tmp
.2 ] && cat $tmp.tmp
.2
50 # real QA test starts here
51 pminfo
-D pmns
-mf -c $tmp.def \
52 sample.secret.foo.one my.derived foo.bar sample.secret.foo.two \
58 id pcp
>/dev
/null
2>&1 && pipeargs
="$pipeargs -U $username"
60 export PCP_DERIVED_CONFIG
=$tmp.def
61 cat <<End-of-File | dbpmda -D pmns -ie >$tmp.out 2>$tmp.err
62 open pipe $PCP_PMDAS_DIR/sample/pmdasample $pipeargs
63 fetch sample.secret.foo.one, my.derived, sample.secret.foo.two