qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 259
blob38d3cb47ea3f219f8ca1d652d41eb0a046bb2d3a
1 #!/bin/sh
2 # PCP QA Test No. 259
4 # Derived metrics and delta() function
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 status=0 # success is the default!
18 host=`hostname`
19 $sudo rm -rf $tmp.* $seq.full
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
22 export PCP_DERIVED_CONFIG=$tmp.config
24 # expr node 0x867eb68 type=PLUS left=0x867eb98 right=0x867ed28
25 _filter()
27 sed \
28 -e '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/s/[^ ]*.*numpmid/TIMESTAMP ... numpmid/' \
29 -e 's/=0x0 /=(nil) /g' \
30 -e 's/node 0x[0-9a-f]*/node <addr>/' \
31 -e 's/left=0x[0-9a-f]*/left=<addr>/' \
32 -e 's/right=0x[0-9a-f]*/right=<addr>/' \
33 -e "s;$tmp;TMP;g" \
34 -e "s/host: $host/host: HOST/g" \
35 -e "s/ value \"$host\"/ value \"HOST\"/g" \
36 -e 's/ val=[0-9][0-9]*/ val=<number>/g'
39 # real QA test starts here
41 echo "No errors here ..."
42 cat <<End-of-File >$tmp.config
43 # instantaneous
44 derived.inst = delta(sample.longlong.million)
45 # counter
46 derived.ctr = delta(sampledso.recv_pdu)
47 End-of-File
48 echo
49 cat $tmp.config
51 for args in derived.inst derived.ctr
53 echo
54 pmval -t 0.25 -s 4 -ZUTC -Dfetch,derive,appl2 $args 2>&1 \
55 | tee -a $seq.full \
56 | _filter
57 done
59 echo
60 echo "Errors and empty results here ..."
61 cat <<End-of-File >$tmp.config
62 myname.a = delta(
63 myname.b = delta + 3
64 myname.c = delta(sample.long.one + sample.long.hundred)
65 myname.d = delta(12345)
66 End-of-File
67 echo
68 cat $tmp.config
70 for args in myname
72 echo
73 pmval -t 0.25 -s 3 -ZUTC -Dfetch,derive,appl2 $args 2>&1 | _filter
74 done
76 # success, all done
77 exit