pmrep: fix archive end time reporting
[pcp.git] / qa / 334
blobd35cf6ab8b3e68bceb0626a16ead1cdb33eb5710
1 #!/bin/sh
2 # PCP QA Test No. 334
4 # check instance matching for derived metrics
6 # Copyright (c) 2009 Ken McDonell. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
13 . ./common.product
14 . ./common.filter
15 . ./common.check
17 if grep -q 'pmRegisterDerived' $PCP_INC_DIR/pmapi.h
18 then
20 else
21 echo "No derived metric support" >$seq.notrun
22 echo "$seq: [not run] `cat $seq.notrun`"
23 exit 0
26 status=0 # success is the default!
27 $sudo rm -rf $tmp.* $seq.full
28 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
30 export PCP_DERIVED_CONFIG=$tmp.config
32 # Derived metric expr dump from 0x8513a48...
33 # expr node 0x867eb68 type=PLUS left=0x867eb98 right=0x867ed28
34 _filter()
36 cat $tmp.out >>$seq.full
37 awk <$tmp.out >$tmp.sed '
38 BEGIN { n = 0 }
39 $1 == "expr" && $2 == "node" && $3 ~ /^0x/ { print "s/" $3 "/<addr-" n ">/"; n++ }
40 { next }'
41 echo "=== sed ===" >>$seq.full
42 cat $tmp.sed >>$seq.full
43 sed -f $tmp.sed <$tmp.out \
44 | sed \
45 -e '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/s/[^ ]*.*numpmid/TIMESTAMP ... numpmid/' \
46 -e 's/=0x0 /=(nil) /g' \
47 -e "s;$tmp;TMP;"
48 # -e 's/ val=[0-9][0-9]*/ val=<number>/g'
51 # real QA test starts here
53 cat <<End-of-File >$tmp.config
54 my.x1 = sample.bin + sample.part_bin
55 my.x2 = sample.part_bin + sample.bin
56 my.x3 = 2 * sample.part_bin
57 my.x4 = sample.part_bin * 2
58 my.x5 = (sample.bin + sample.part_bin) - (sample.part_bin + sample.bin)
59 End-of-File
60 echo
61 cat $tmp.config
63 echo
64 pminfo -Dderive,appl2 -df my >$tmp.out 2>&1
65 _filter
67 # success, all done
68 exit