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
18 $sudo rm -f $here/$seq.full
22 # "dbpmda> $" filter for Linux
24 -e '/pmResult/s/0x[^ ]*/ADDR/g' \
25 -e '/pmResult/s/amp: 0.000000 .* numpmid:/amp: EPOCH in LOCALTIME numpmid:/' \
26 -e '/Error: .*() failed/s/Broken pipe/[PMDA died]/' \
27 -e '/Error: .*() failed/s/PDU empty, PMDA may have died/[PMDA died]/' \
28 -e 's/\/tmp.*/logfile/g' \
29 -e 's/\(broken_pmda_2_[0-9]\)([0-9][0-9]*)/\1(PID)/' \
30 -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/' \
31 -e 's/ [0-9\.]*e-[0-9]* 0x/ REAL 0x/g' \
32 -e 's/ 0 0x/ REAL 0x/g' \
34 -e '/Error PDU:/s/One-line/Oneline/'
36 # last sed substitution thanks to pv:937345 which changed the wording
37 # ... preserving the old form so QA passes
43 -e 's/^\[.*\] broken_pmda_2_.([0-9]*)/broken pmda/g' \
44 -e '/Info: direct map =/d' \
45 -e '/Info: metric map =/d' \
46 -e 's/^Log for.*/Log started/g' \
47 -e 's/^Log finished.*/Log finished/g'
53 -e 's/.* \(hash table entries\)/ NNN \1/' \
54 -e 's/.* \(non-leaf nodes\)/ NNN \1/' \
55 -e 's/.* \(leaf nodes\)/ NNN \1/' \
56 -e 's/.* \(bytes of symbol table\)/ NNN \1/'
59 _filterStartBrokenPMDA25
() {
60 # This filter came about as a result of a different ordering of
61 # output in both stdout and stderr from dbpmda in PCP 2.1. This
62 # filter makes it appear as it would in PCP 2.2 onwards so that
63 # the test can detect changes to the text itself rather than the
64 # position of the line "Start broken_pmda_2_5 PMDA..." in the
65 # output for the dbpmda "open" command.
67 BEGIN { found = false }
68 /Start broken_pmda_2_5 PMDA: / {
69 if (found = false) found = $0
74 if ( found != false ) {
86 # real QA test starts here
91 $sudo .
/broken_Install
-N < /dev
/null | _filter_ins
92 # ensure help text built (-N above skips this)
93 $sudo $PCP_MAKE_PROG broken_v2.dir
> /dev
/null
2>&1
100 $sudo .
/broken_Remove
-N
104 trap "_remove; exit \$status" 0 1 2 3 15
106 dbpmda
-ie 2>&1 <<End-of-File | _filter
107 open pipe pmdas/broken/broken_pmda_2_0 -D47104 -l $tmp.log
109 # Test the valid metrics
110 fetch broken.valid.one broken.valid.two broken.valid.three
111 text broken.valid.one
112 # Test for metric not defined in table but in the PMNS and fetch callback
113 fetch broken.bogus.one
114 # Test for metric not defined in table and PMNS but in the fetch callback
115 fetch broken.bogus.two
116 # Test for metric defined in table and fetch, but not the pmns
118 # Test for multiple fetch with an invalid metric between valid metrics
119 fetch broken.valid.one broken.bogus.one broken.valid.two
120 # Test for illegal data types
121 fetch broken.bad.type
122 # Test for metric with no fetch support
123 fetch broken.no.fetch
124 # Test for metric with no help
125 fetch broken.no.help broken.no.shorthelp broken.no.longhelp
127 text broken.no.shorthelp
128 text broken.no.longhelp
129 # Test for handling of bad semantics
130 fetch broken.bad.semantics
131 # Test for handling of bad scale
132 fetch broken.bad.scale
133 # Test for handling of empty instance lists
134 fetch broken.no.instances
135 # Test for handling of missing instances in fetch
136 fetch broken.no.instfetch
144 cat $tmp.log | _filter2
145 echo "=== PMDA should survive tests ===" >>$here/$seq.full
146 cat $tmp.log
>>$here/$seq.full
150 dbpmda
-ie 2>&1 <<End-of-File | _filter
151 open pipe pmdas/broken/broken_pmda_2_1 -D47104 -l $tmp.log
154 fetch broken.bad.indom
162 cat $tmp.log | _filter2
163 echo >>$here/$seq.full
164 echo "=== broken_pmda_2_1 ===" >>$here/$seq.full
165 cat $tmp.log
>>$here/$seq.full
169 dbpmda
-ie 2>&1 <<End-of-File | _filter
170 open pipe pmdas/broken/broken_pmda_2_2 -D47104 -l $tmp.log
179 cat $tmp.log | _filter2
180 echo >>$here/$seq.full
181 echo "=== broken_pmda_2_2 ===" >>$here/$seq.full
182 cat $tmp.log
>>$here/$seq.full
186 dbpmda
-ie 2>&1 <<End-of-File | _filter
187 open pipe pmdas/broken/broken_pmda_2_3 -D47104 -l $tmp.log
196 cat $tmp.log | _filter2
197 echo >>$here/$seq.full
198 echo "=== broken_pmda_2_3 ===" >>$here/$seq.full
199 cat $tmp.log
>>$here/$seq.full
203 dbpmda
-ie 2>&1 <<End-of-File | _filter
204 open pipe pmdas/broken/broken_pmda_2_4 -D47104 -l $tmp.log
206 text broken.valid.one
214 cat $tmp.log | _filter2
215 echo >>$here/$seq.full
216 echo "=== broken_pmda_2_4 ===" >>$here/$seq.full
217 cat $tmp.log
>>$here/$seq.full
221 dbpmda
-ie 2>&1 <<End-of-File | _filter | _filterStartBrokenPMDA25
222 open pipe pmdas/broken/broken_pmda_2_5 -D47104 -l $tmp.log
224 text broken.valid.one
232 cat $tmp.log | _filter2
233 echo >>$here/$seq.full
234 echo "=== broken_pmda_2_5 ===" >>$here/$seq.full
235 cat $tmp.log
>>$here/$seq.full