pmrep: update TODO, man page
[pcp.git] / qa / 210
blobfa481ba1d6c8eecf1e30587d6e3736eb417c8b35
1 #! /bin/sh
2 # PCP QA Test No. 210
3 # Check dynamic metrics work with PMAPI clients - DSO PMDA version
4 # See also 467 for the related tests using pmdumptext
6 # Copyright (c) 2009 Ken McDonell. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
13 . ./common.product
14 . ./common.filter
15 . ./common.check
17 if grep -q ' RESERVED_DO_NOT_USE[ ]*511' $PCP_VAR_DIR/pmns/stdpmid
18 then
20 else
21 echo "No support for dynamic PMNS entries" >$seq.notrun
22 echo "$seq: [not run] `cat $seq.notrun`"
23 exit 0
26 status=0 # success is the default!
27 $sudo rm -rf $tmp.*
28 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
29 rm -f $seq.full
31 _filter_probe()
33 $PCP_AWK_PROG '
34 # sample ... sampledso.secret.foo.bar.max.redirect 8 0 0 0 0 0 0 4 0
35 /secret\.foo\.bar\.max\.redirect/ { if ($2 > 3 )
36 print $1,"> 3 values ..."
37 else
38 print
39 next
41 { print }'
44 _do() {
45 echo
46 echo "== $* =="
47 pminfo $* | LC_COLLATE=POSIX sort
48 pmprobe -v $* | _filter_probe | LC_COLLATE=POSIX sort
51 # real QA test starts here
53 echo "PMNS traversal tests ..."
54 pminfo sampledso | grep '\.secret\.' | LC_COLLATE=POSIX sort
55 _do sampledso.secret
56 _do sampledso.secret.bar sampledso.secret.foo
57 _do sampledso.secret.foo.bar.grunt
59 echo
60 echo "pmval ..."
61 pmval -s 3 -t 0.1 sampledso.secret.foo.bar.grunt.five \
62 | sed -e '/^host:.*$/s/.*/HOST/'
64 echo
65 echo "pmie ..."
66 echo 'sampledso.secret.foo.bar.four == 4 -> print "Bingo!"' \
67 | pmie -t 0.1 -T 0.3 2>&1 \
68 | _filter_pmie_log \
69 | sed -e '/.* Info: evaluator exiting/d' \
70 | sort -u
72 echo
73 echo "pmlogger ..."
74 cat <<'End-of-File' >$tmp.config
75 log mandatory on 100 msec {
76 sampledso.secret.bar
77 sampledso.secret.foo.one
78 sampledso.secret.foo.two
79 sampledso.secret.foo.bar.three
80 sampledso.secret.foo.bar.four
81 sampledso.secret.foo.bar.grunt
83 End-of-File
84 echo "+ pmlogger -s 3 -c $tmp.config -l $tmp.log $tmp" >>$seq.full
85 pmlogger -s 3 -c $tmp.config -l $tmp.log $tmp
87 cat $tmp.log >>$seq.full
88 pmdumplog $tmp 2>&1 \
89 | tee -a $seq.full \
90 | _filter_pmdumplog \
91 | sed -e 1,4d
93 exit