3 # Throw a broken PMDA at libpcp_pmda and dbpmda
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
17 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
21 # "dbpmda> $" filter for Linux
23 -e '/pmResult/s/0x[^ ]*/ADDR/g' \
24 -e '/pmResult/s/amp: 0.000000 .* numpmid:/amp: EPOCH in LOCALTIME numpmid:/' \
25 -e 's/\/tmp.*/logfile/g' \
26 -e 's/\(broken_pmda_2_[0-9]\)([0-9][0-9]*)/\1(PID)/' \
27 -e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATE/' \
28 -e 's/ [0-9\.]*e-[0-9]* 0x/ REAL 0x/g' \
29 -e 's/ 0 0x/ REAL 0x/g' \
31 -e '/Error PDU:/s/One-line/Oneline/'
33 # last sed substitution thanks to pv:937345 which changed the wording
34 # ... preserving the old form so QA passes
40 -e 's/^\[.*\] broken_pmda_2_.([0-9]*)/broken pmda/g' \
41 -e '/Info: direct map =/d' \
42 -e '/Info: metric map =/d' \
43 -e 's/^Log for.*/Log started/g' \
44 -e 's/^Log finished.*/Log finished/g'
50 -e 's/.* \(hash table entries\)/ NNN \1/' \
51 -e 's/.* \(non-leaf nodes\)/ NNN \1/' \
52 -e 's/.* \(leaf nodes\)/ NNN \1/' \
53 -e 's/.* \(bytes of symbol table\)/ NNN \1/'
56 _filterStartBrokenPMDA25
() {
57 # This filter came about as a result of a different ordering of
58 # output in both stdout and stderr from dbpmda in PCP 2.1. This
59 # filter makes it appear as it would in PCP 2.2 onwards so that
60 # the test can detect changes to the text itself rather than the
61 # position of the line "Start broken_pmda_2_5 PMDA..." in the
62 # output for the dbpmda "open" command.
64 BEGIN { found = false }
65 /Start broken_pmda_2_5 PMDA: / {
66 if (found = false) found = $0
71 if ( found != false ) {
83 # real QA test starts here
88 $sudo .
/broken_Install
-N < /dev
/null | _filter_ins
89 # ensure help text built (-N above skips this)
90 $sudo make broken_v2.dir
> /dev
/null
2>&1
97 $sudo .
/broken_Remove
-N
101 trap "_remove; exit \$status" 0 1 2 3 15
103 dbpmda
-ie 2>&1 <<End-of-File | _filter
104 open pipe pmdas/broken/broken_pmda_2_0 -D47104 -l $tmp.log
106 # Test the valid metrics
107 fetch broken.valid.one broken.valid.two broken.valid.three
108 text broken.valid.one
109 # Test for metric not defined in table but in the PMNS and fetch callback
110 fetch broken.bogus.one
111 # Test for metric not defined in table and PMNS but in the fetch callback
112 fetch broken.bogus.two
113 # Test for metric defined in table and fetch, but not the pmns
115 # Test for multiple fetch with an invalid metric between valid metrics
116 fetch broken.valid.one broken.bogus.one broken.valid.two
117 # Test for illegal data types
118 fetch broken.bad.type
119 # Test for metric with no fetch support
120 fetch broken.no.fetch
121 # Test for metric with no help
122 fetch broken.no.help broken.no.shorthelp broken.no.longhelp
124 text broken.no.shorthelp
125 text broken.no.longhelp
126 # Test for handling of bad semantics
127 fetch broken.bad.semantics
128 # Test for handling of bad scale
129 fetch broken.bad.scale
130 # Test for handling of empty instance lists
131 fetch broken.no.instances
132 # Test for handling of missing instances in fetch
133 fetch broken.no.instfetch
139 [ -f $tmp.log
] && cat $tmp.log | _filter2
142 dbpmda
-ie 2>&1 <<End-of-File | _filter
143 open pipe pmdas/broken/broken_pmda_2_1 -D47104 -l $tmp.log
146 fetch broken.bad.indom
152 [ -f $tmp.log
] && cat $tmp.log | _filter2
155 dbpmda
-ie 2>&1 <<End-of-File | _filter
156 open pipe pmdas/broken/broken_pmda_2_2 -D47104 -l $tmp.log
163 [ -f $tmp.log
] && cat $tmp.log | _filter2
166 dbpmda
-ie 2>&1 <<End-of-File | _filter
167 open pipe pmdas/broken/broken_pmda_2_3 -D47104 -l $tmp.log
174 [ -f $tmp.log
] && cat $tmp.log | _filter2
177 dbpmda
-ie 2>&1 <<End-of-File | _filter
178 open pipe pmdas/broken/broken_pmda_2_4 -D47104 -l $tmp.log
180 text broken.valid.one
186 [ -f $tmp.log
] && cat $tmp.log | _filter2
189 dbpmda
-ie 2>&1 <<End-of-File | _filter | _filterStartBrokenPMDA25
190 open pipe pmdas/broken/broken_pmda_2_5 -D47104 -l $tmp.log
192 text broken.valid.one
198 [ -f $tmp.log
] && cat $tmp.log | _filter2