Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 467
blobd6ba9b77381e8da82cb6884bff2e7f6554490d30
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/[ ][^:]*:/ HOST:/g' \
30 | $PCP_AWK_PROG '
31 NR == 1 { for (i = 1; i <= NF; i++) {
32 if ($i ~ /\.max\.redirect/)
33 state[i] = 0
34 else
35 state[i] = 1
38 { for (i = 1; i <= NF; i++) {
39 if (state[i]) printf "%s ",$i
41 print ""
45 _do() {
46 echo
47 echo "== $* =="
48 pmdumptext -H -s 3 $* | _filter_dumptext
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 exit