qa: revert some change to expected 244 outputs (from pmda-restart)
[pcp.git] / qa / 247
blob1800a09f4e88998f5247a84d19214710ad67ca4c
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 # For this test, don't load any global derived metric configs by default.
27 # So the PCP_DERIVED_CONFIG environment variable is set to an empty string.
28 export PCP_DERIVED_CONFIG=""
30 status=0 # success is the default!
31 $sudo rm -rf $tmp.* $seq.full
32 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
34 _filter()
36 cat $tmp.out >>$seq.full
37 sed <$tmp.out \
38 -e "s;$tmp;TMP;"
41 # real QA test starts here
43 pminfo -d sample.pdu sample.recv_pdu sample.xmit_pdu sample.byte_ctr sample.kbyte_ctr sample.long.hundred sample.bin
45 echo
46 echo "No semantic errors here ..."
47 cat <<End-of-File >$tmp.config
48 myname.a = sample.kbyte_ctr
49 myname.b = sample.recv_pdu + sample.xmit_pdu
50 myname.c = 123
51 myname.d = 123 + sample.long.hundred
52 myname.e = sample.pdu / sample.long.hundred
53 myname.f = 1024 * sample.byte_ctr
54 myname.g = sample.bin + 100 - sample.bin - 100
55 myname.h = sample.seconds + sample.milliseconds / 1000
56 End-of-File
58 pminfo -Dderive -d -c $tmp.config myname >$tmp.out 2>&1
59 _filter
61 echo
62 echo "Semantic errors ..."
63 cat <<End-of-File >$tmp.config
64 # no-such-metric
65 myname.a = no.such.metric
66 # illegal metric
67 myname.b = sample.bad.unknown
68 # bad semantics - counters and *
69 myname.c = disk.dev.read * disk.dev.write
70 # bad semantics - counter and non-counter
71 myname.d = sample.byte_ctr + sample.long.hundred
72 # bad semantics - non-counter and counter
73 myname.e = sample.long.hundred - 100 / sample.byte_ctr
74 # bad semantics - non-counters ... not possible at the moment
75 # bad semantics - non-arithmetic metrics
76 myname.f = 3 + sample.lights
77 myname.g = sample.sysinfo - 42
78 # pmUnits checks and metric semantic checks
79 myname.h = disk.dev.total + sample.long.hundred
80 myname.i = sample.long.hundred - disk.dev.total
81 myname.j = sample.mirage * sample.step_counter
82 myname.k = sample.step_counter / sample.mirage_longlong
83 # indom checks
84 myname.l = sample.bin + sample.darkness
85 # from here on down, test cases driven by gcov analysis ...
86 myname.gcov.a = 42 + sample.bad.unknown
87 myname.gcov.b = (disk.all.total + disk.dev.total) + 42
88 myname.gcov.c = 42 - (disk.all.total + disk.dev.total)
89 myname.gcov.d = (sample.bin + sample.darkness)+42
90 End-of-File
92 #debug# pminfo -D derive,appl0,appl1 -d -c $tmp.config myname >$tmp.out 2>&1
93 pminfo -D derive -d -c $tmp.config myname >$tmp.out 2>&1
94 _filter
96 # success, all done
97 exit