pmrep: fix archive end time reporting
[pcp.git] / qa / 397
blob70172d541ae71d6c399984c4cab00e41b45c9b7f
1 #!/bin/sh
2 # PCP QA Test No. 397
3 # Use dbpmda to check endian encoding for PM_TYPE_EVENT
5 # Copyright (c) 2010 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 $sudo rm -rf $tmp.* $seq.full
18 trap "$sudo rm -f $tmp.*; exit \$status" 0 1 2 3 15
20 hostname=`_get_fqdn 2>/dev/null`
21 [ -z "$hostname" ] && hostname=`hostname`
23 _filter()
25 sed \
26 -e "s;$tmp;TMP;g" \
27 -e "s;$PCP_VAR_DIR;\$PCP_VAR_DIR;g" \
28 -e "s/$hostname/MYHOST/" \
29 -e "s/`hostname`/MYHOST/" \
30 -e '/value/s/[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9]/TIMESTAMP/g' \
31 -e '/29.0.126: .* -> 0/s/ [0-9] / OLD /' \
32 -e '/pmResult dump from/{
33 s/0x[0-9a-f][0-9a-f]*/ADDR/
34 s/amp: .* num/amp: TIMESTAMPS num/
38 # real QA test starts here
39 cat <<End-of-File | $sudo TERM=ansi dbpmda -ei >$tmp.out 2>&1
40 open pipe $PCP_VAR_DIR/pmdas/sample/pmdasample -d 29 -l $tmp.log
41 store sample.event.reset "0"
42 fetch sample.event.records
43 fetch sample.event.records
44 fetch sample.event.records
45 fetch sample.event.records
46 End-of-File
48 cat $tmp.out >>$seq.full
49 _filter <$tmp.out
50 echo
51 echo "=== pmda log ===" | tee -a $seq.full
52 cat $tmp.log >>$seq.full
53 _filter_pmcd_log <$tmp.log | _filter
55 # success, all done
56 exit