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
16 signal
=$PCP_BINADM_DIR/pmsignal
17 status
=1 # failure is the default!
18 control
=$PCP_PMDAS_DIR/sample
/dynamic.indom
23 cat <<End-of-File >$tmp.pmie
25 some_inst disk.dev.total >= 0 -> print "\nDISK %i";
28 some_inst kernel.percpu.cpu.user >= 0 -> print "\nCPU %i";
31 if [ $PCP_PLATFORM != solaris
]
33 cat <<End-of-File >>$tmp.pmie
35 // network interface indom
36 some_inst network.interface.total.packets >= 0 -> print "\nNETWORK %i";
39 some_inst filesys.capacity >= 0 -> print "\nFILESYS %i";
43 cat <<End-of-File >>$tmp.pmie
46 some_inst sample.mirage >= 0 -> print "\nMIRAGE %i";
48 // the dynamic ones ...
49 some_inst sample.dynamic.discrete >= 0 -> print "DYN_DISCRETE" " %i";
50 some_inst sample.dynamic.instant >= 0 -> print "DYN_INSTANT" " %i";
58 [ -f $control.
$seq ] && $sudo mv $control.
$seq $control
60 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
71 -e '/value/s/ [0-9]*$/ N/'
74 $sudo rm -f $control.
$seq
75 trap "_cleanup; exit \$status" 0 1 2 3 15
76 [ -f $control ] && $sudo mv $control $control.
$seq
78 PMCD_RECONNECT_TIMEOUT
=1
79 export PMCD_RECONNECT_TIMEOUT
83 cat >$tmp.indom
<<End-of-File
90 $sudo cp $tmp.indom
$control
92 $sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
94 pminfo
-f sample.dynamic.instant | _filter
97 # real QA test starts here
99 pmie
-t 250msec
-c $tmp.pmie
>$tmp.out
2>&1 &
102 # sleep_stop time to sleep before stopping pmcd
103 # sleep_start time to sleep before starting pmcd
107 # and again with the same instances
110 $sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
112 $sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
114 pminfo
-f sample.dynamic.instant |_filter
120 $sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
121 cat >$tmp.indom
<<End-of-File
129 106 one-hundred-and-six
131 $sudo cp $tmp.indom
$control
133 $sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
135 pminfo
-f sample.dynamic.instant |_filter
141 $sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
142 cat >$tmp.indom
<<End-of-File
150 $sudo cp $tmp.indom
$control
152 $sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
154 pminfo
-f sample.dynamic.instant |_filter
160 $sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
161 cat >$tmp.indom
<<End-of-File
163 $sudo cp $tmp.indom
$control
165 $sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
167 pminfo
-f sample.dynamic.instant |_filter
171 $signal -s TERM
$pid_pmie
174 cp $tmp.out
$seq.full
177 echo "Expect only connection lost/re-established and DYN_* lines ..."
180 # in addition to the regular filtering, some versions of Linux return
181 # ECONNRESET on the write() when pmcd is signald, rather than waiting
182 # to return the error on the following read() ... as far as this test
183 # is concerned, these are synonyms
185 _filter_pmie_log
<$tmp.out \
187 -e "/ Error: /s/$HOST/HOST/g" \
188 -e "/ Error: /s/local:/HOST/g" \
189 -e "/ Error: /s/localhost/HOST/g" \
190 -e "/ Info: /s/$HOST/HOST/g" \
191 -e "/ Info: /s/localhost/HOST/g" \
192 -e "/ Info: /s/local:/HOST/g" \
193 -e '/ Error: __pmCloseChannelbyContext: /d' \
194 -e 's/failed: Connection reset by peer/failed: IPC protocol failure/' \
196 -e '/^FILESYS \/dev\//d' \
197 -e '/^FILESYS \/dev$/d' \
198 -e '/^FILESYS none$/d' \
199 -e '/^FILESYS devfs$/d' \
200 -e '/^FILESYS map -hosts$/d' \
201 -e '/^FILESYS map auto_home$/d' \
202 -e '/^MIRAGE m-[0-9][0-9]*$/d' \
203 -e '/^DISK dks[0-9][0-9]*d[0-9][0-9]*/d' \
204 -e '/^DISK [a-f0-9][a-f0-9]*\/lun[0-9][0-9]*\/c[0-9][0-9]*p[0-9][0-9]*/d' \
205 -e '/^DISK hd[a-z]/d' \
206 -e '/^DISK sd[a-z0-9]/d' \
207 -e '/^DISK dasd[a-z]/d' \
208 -e '/^DISK mmcblk[0-9]/d' \
209 -e '/^DISK cmdk[0-9]/d' \
211 -e '/^DISK scsi\/host/d' \
212 -e '/^DISK vd[a-z]/d' \
213 -e '/^DISK xscsi\/pci/d' \
214 -e '/^DISK xvm\//d' \
215 -e '/^DISK disk[0-9][0-9]*$/d' \
216 -e '/^CPU cpu[0-9][0-9]*$/d' \
217 -e '/^CPU cpu:[0-9][0-9]*\.[0-9][0-9]*\.[ab]$/d' \
218 -e '/^CPU cpu:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[a-d]$/d' \
219 -e '/^NETWORK dummy[0-9]/d' \
220 -e '/^NETWORK br[0-9][0-9]*$/d' \
221 -e '/^NETWORK enccw[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$/d' \
222 -e '/^NETWORK docker[0-9][0-9]*$/d' \
223 -e '/^NETWORK e[cfmnt][0-9][0-9]*$/d' \
224 -e '/^NETWORK eno[0-9]*d[0-9]*$/d' \
225 -e '/^NETWORK eno[0-9]*$/d' \
226 -e '/^NETWORK ens[0-9]*$/d' \
227 -e '/^NETWORK enp[0-9][0-9]*s[0-9][0-9]*$/d' \
228 -e '/^NETWORK enp[0-9][0-9]*s[0-9][0-9]*f[0-9][0-9]*$/d' \
229 -e '/^NETWORK enp[0-9][0-9]*s[0-9][0-9]*f[0-9][0-9]*u[0-9][0-9]*$/d' \
230 -e '/^NETWORK enP[0-9][0-9]*p[0-9][0-9]*s[0-9][0-9]*f[0-9][0-9]*$/d' \
231 -e '/^NETWORK eth[0-9]/d' \
232 -e '/^NETWORK fw[0-9][0-9]*$/d' \
233 -e '/^NETWORK gif[0-9][0-9]*$/d' \
234 -e '/^NETWORK lo[0-9][0-9]*$/d' \
235 -e '/^NETWORK lo$/d' \
236 -e '/^NETWORK p[0-9][0-9]*p[0-9][0-9]*$/d' \
237 -e '/^NETWORK pan[0-9][0-9]*$/d' \
238 -e '/^NETWORK ppp[0-9][0-9]*$/d' \
239 -e '/^NETWORK sit[0-9]/d' \
240 -e '/^NETWORK sl[0-9][0-9]*$/d' \
241 -e '/^NETWORK stf[0-9][0-9]*$/d' \
242 -e '/^NETWORK tun[0-9][0-9]*$/d' \
243 -e '/^NETWORK usb[0-9][0-9]*$/d' \
244 -e '/^NETWORK vde[0-9][0-9]*$/d' \
245 -e '/^NETWORK veth[a-f0-9][a-f0-9]*$/d' \
246 -e '/^NETWORK vnet[0-9][0-9]*$/d' \
247 -e '/^NETWORK virbr[0-9][0-9]*$/d' \
248 -e '/^NETWORK virbr[0-9][0-9]*-nic$/d' \
249 -e '/^NETWORK wlan[0-9][0-9]*$/d' \
250 -e '/^NETWORK wlp[0-9][0-9]*s[0-9][0-9]*$/d' \
251 -e '/^NETWORK wwan[0-9][0-9]*$/d' \
252 -e '/^NETWORK wmaster[0-9][0-9]*$/d' \
253 -e '/^NETWORK xp[0-9][0-9]*$/d' \
255 BEGIN { last["DYN_DISCRETE"] = last["DYN_INSTANT"] = "" }
256 $2 ~ /DYN_/ { if (last[$2] != $0) {
263 /Lost connection/ { last["DYN_DISCRETE"] = last["DYN_INSTANT"] = "" }'