qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 247
blob6e68fe2c1b5749f48b09961764b91e9111d98fe7
1 #!/bin/sh
2 # PCP QA Test No. 247
4 # Derived metrics - exercise pmDesc processing during bind
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 unset PCP_DERIVED_CONFIG
28 status=0 # success is the default!
29 $sudo rm -rf $tmp.* $seq.full
30 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
32 _filter()
34 cat $tmp.out >>$seq.full
35 sed <$tmp.out \
36 -e "s;$tmp;TMP;"
39 # real QA test starts here
41 pminfo -d sample.pdu sample.recv_pdu sample.xmit_pdu sample.byte_ctr sample.kbyte_ctr sample.long.hundred sample.bin
43 echo
44 echo "No semantic errors here ..."
45 cat <<End-of-File >$tmp.config
46 myname.a = sample.kbyte_ctr
47 myname.b = sample.recv_pdu + sample.xmit_pdu
48 myname.c = 123
49 myname.d = 123 + sample.long.hundred
50 myname.e = sample.pdu / sample.long.hundred
51 myname.f = 1024 * sample.byte_ctr
52 myname.g = sample.bin + 100 - sample.bin - 100
53 myname.h = sample.seconds + sample.milliseconds / 1000
54 End-of-File
56 pminfo -Dderive -d -c $tmp.config myname >$tmp.out 2>&1
57 _filter
59 echo
60 echo "Semantic errors ..."
61 cat <<End-of-File >$tmp.config
62 # no-such-metric
63 myname.a = no.such.metric
64 # illegal metric
65 myname.b = sample.bad.unknown
66 # bad semantics - counters and *
67 myname.c = disk.dev.read * disk.dev.write
68 # bad semantics - counter and non-counter
69 myname.d = sample.byte_ctr + sample.long.hundred
70 # bad semantics - non-counter and counter
71 myname.e = sample.long.hundred - 100 / sample.byte_ctr
72 # bad semantics - non-counters ... not possible at the moment
73 # bad semantics - non-arithmetic metrics
74 myname.f = 3 + sample.lights
75 myname.g = sample.sysinfo - 42
76 # pmUnits checks and metric semantic checks
77 myname.h = disk.dev.total + sample.long.hundred
78 myname.i = sample.long.hundred - disk.dev.total
79 myname.j = sample.mirage * sample.step_counter
80 myname.k = sample.step_counter / sample.mirage_longlong
81 # indom checks
82 myname.l = sample.bin + sample.darkness
83 # from here on down, test cases driven by gcov analysis ...
84 myname.gcov.a = 42 + sample.bad.unknown
85 myname.gcov.b = (disk.all.total + disk.dev.total) + 42
86 myname.gcov.c = 42 - (disk.all.total + disk.dev.total)
87 myname.gcov.d = (sample.bin + sample.darkness)+42
88 End-of-File
90 #debug# pminfo -D derive,appl0,appl1 -d -c $tmp.config myname >$tmp.out 2>&1
91 pminfo -D derive -d -c $tmp.config myname >$tmp.out 2>&1
92 _filter
94 # success, all done
95 exit