qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 444
blobea69839f81b8af16ac58cdccfa033a25f883adfd
1 #!/bin/sh
2 # PCP QA Test No. 444
3 # pmid and desc caching in pmevent
5 # Copyright (c) 2011 Ken McDonell. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 status=0 # success is the default!
17 host=`hostname`
18 $sudo rm -rf $tmp.* $seq.full
19 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
21 # real QA test starts here
22 pmstore sample.event.reset 0 >/dev/null 2>&1
23 pmevent -Dpdu,derive -t 10msec -s 20 sample.event.records >$tmp.out 2>&1
24 cat $tmp.out >>$seq.full
26 # Need to make this not host specific ...
27 # 2.6.0 (pmcd.client.whoami): numval: 1 valfmt: 2 vlist[]:
28 # value "bozo-laptop (127.0.0.1) pmevent -Dpdu -t 10msec -s 20 sample.event.records"
29 # pmXmitPDU: RESULT fd=<fd> len=124
31 sed <$tmp.out \
32 -e '/^[0-9][0-9]*:/d' \
33 -e 's/^\[[0-9]*]//' \
34 -e '/pmResult/s/ .* numpmid/ ... numpmid/' \
35 -e "s/ value \"$host\"/ value \"HOST\"/g" \
36 -e "s/host: $host/host: localhost/g" \
37 -e 's/[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9]/TIMESTAMP/g' \
38 -e 's/fd=[0-9][0-9]*/fd=<fd>/g' \
39 | $PCP_AWK_PROG ' BEGIN { hostskip=0 }
40 /^pmXmitPDU: FETCH fd=<fd> len=/ { hostskip++; }
41 /^pmGetPDU: RESULT fd=<fd> len=/ { if (hostskip < 2) { next } }
42 /pmcd.client.whoami/ { print; skip=2; next }
43 skip > 0 { print "blah blah ..."; skip--; next }
44 { print }'
46 # success, all done
47 exit