Merge branch 'master' of https://github.com/kmcdonell/pcp into kenj-merge
[pcp.git] / qa / 467
blob3bef2e8790a1bfeb1118a13a97ad47cd01767965
1 #!/bin/sh
2 # PCP QA Test No. 467
3 # Check dynamic metrics work with PMAPI clients - DSO PMDA version
4 # pmdumptext test from 210
6 # Copyright (c) 2009,2011 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 grep -q ' RESERVED_DO_NOT_USE[ ]*511' $PCP_VAR_DIR/pmns/stdpmid || \
18 _notrun "No support for dynamic PMNS entries"
19 which pmdumptext >/dev/null 2>&1 || _notrun "pmdumptext not installed"
21 status=0 # success is the default!
22 $sudo rm -rf $tmp.*
23 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
24 rm -f $seq.full
26 _filter_dumptext()
28 _filter_pmdumptext \
29 | sed -e '/^Time[ ]/s/[ ]local::/ HOST:/g' \
30 | sed -e '/^Time[ ]/s/[ ][^:]*:/ HOST:/g' \
31 | $PCP_AWK_PROG '
32 NR == 1 { for (i = 1; i <= NF; i++) {
33 if ($i ~ /\.max\.redirect/)
34 state[i] = 0
35 else
36 state[i] = 1
39 { for (i = 1; i <= NF; i++) {
40 if (state[i]) printf "%s ",$i
42 print ""
46 _do() {
47 echo
48 echo "== $* =="
49 pmdumptext -H -s 3 $* | _filter_dumptext
52 # real QA test starts here
54 echo "PMNS traversal tests ..."
55 pminfo sampledso | grep '\.secret\.' | LC_COLLATE=POSIX sort
56 _do sampledso.secret
57 _do sampledso.secret.bar sampledso.secret.foo
58 _do sampledso.secret.foo.bar.grunt
60 exit