python api: fix syntax error in recent context changes
[pcp.git] / qa / 468
blob57fa85cba122a699a4994d0edbc64a0034602fe4
1 #!/bin/sh
2 # PCP QA Test No. 468
3 # Check dynamic metrics work with PMAPI clients - DAEMON PMDA version
4 # pmdumptext test from 211
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 sample | grep '\.secret\.' | LC_COLLATE=POSIX sort
55 _do sample.secret
56 _do sample.secret.bar sample.secret.foo
57 _do sample.secret.foo.bar.grunt
59 exit