Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 501
blob9256eb7dd233864a2b79137dfe6f4b3e12fd391f
1 #! /bin/sh
2 # PCP QA Test No. 501
3 # COPY of PCP QA Test No. 413 with different 2.0/2.0+ output ...
4 # #552517 pmie dumps core with bad metric and -V or -W
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 rm -f $seq.out
13 case $PCP_PLATFORM
15 linux|darwin|solaris)
16 ln $seq-linux.out $seq.out || exit 1
19 _notrun "Need qualified output for $PCP_PLATFORM"
21 esac
23 # get standard filters
24 . ./common.product
25 . ./common.filter
26 . ./common.check
28 status=0 # success is the default!
29 host=`hostname`
30 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
31 $sudo rm -f core* $seq.core* $seq.full
33 _filter()
35 _filter_pmie_log \
36 | sed \
37 -e 's/: *[0-9][0-9]*\.[0-9]*e[-+][0-9][0-9]*/: NUMBER/' \
38 -e 's/: *[0-9][0-9]*e[-+][0-9][0-9]*/: NUMBER/' \
39 -e 's/: *[0-9][0-9]*\.[0-9]*/: NUMBER/' \
40 -e 's/: *[0-9][0-9]*/: NUMBER/' \
41 -e "s/$host/HOST/" \
42 -e "s/local:/HOST/"
45 # real QA test starts here
47 for arg in -v -V -W
49 echo
50 echo "=== pmie $arg ... ==="
51 cat <<End-of-File | pmie -f -l $tmp.log $arg -t 2sec -T 3sec >$tmp.out
52 // arithmetic expressions
53 valid_a = hinv.ncpu;
54 alone_a = no.such.metric;
55 sum1_a = mem.physmem + no.such.metric;
56 sum2_a = no.such.metric + mem.physmem;
57 product_a = no.such.metric * hinv.physmem;
58 compound1_a = mem.physmem + no.such.metric * hinv.ncpu;
59 compound2_a = (no.such.metric + mem.physmem) * hinv.ncpu;
61 // boolean expressions
62 valid_b = 0 < hinv.ncpu;
63 alone_b = 0 < no.such.metric;
64 sum1_b = 0 < mem.physmem + no.such.metric;
65 sum2_b = 0 < no.such.metric + mem.physmem;
66 product_b = 0 < no.such.metric * hinv.physmem;
67 compound1_b = 0 < mem.physmem + no.such.metric * hinv.ncpu;
68 compound2_b = 0 < (no.such.metric + mem.physmem) * hinv.ncpu;
70 // existential expressions
71 valid_s = some_inst 500 < sample.bin;
72 alone_s = some_inst 0 < no.such.metric;
73 sum1_s = some_inst 0 < sample.bin + no.such.metric;
74 sum2_s = some_inst 0 < no.such.metric + sample;
75 product_s = some_inst 0 < no.such.metric * sample.bin;
76 compound1_s = some_inst 0 < sample.bin + no.such.metric * sample.bin;
77 compound2_s = some_inst 0 < (no.such.metric + mem.physmem) * hinv.ncpu;
79 // no support
80 one = sample.long.one;
81 no1 = sample.bad.nosupport;
82 no2 = sample.long.one + sample.bad.nosupport;
83 mill = -1 * (sample.long.one - (sample.long.one + sample.long.ten + sample.long.million)) / sample.long.one;
84 no3 = (sample.long.one - (sample.long.one + sample.long.ten + sample.bad.nosupport)) / sample.long.one;
85 no4 = (sample.long.one - (sample.long.one + sample.long.ten + sample.long.million)) / sample.bad.nosupport;
87 // not-numeric
88 notnum1 = sample.string.hullo;
89 notnum2 = "g'day" != sample.string.hullo;
90 notnum3 = sample.string.hullo == "hullo world!" && 0 <= (sample.long.one - (sample.long.one + sample.long.ten) / sample.long.one);
91 notnum4 = (sample.long.one - (sample.long.one + sample.long.ten + sample.long.million)) >= 0 && sample.string.hullo == "hullo world!";
94 End-of-File
96 cat $tmp.out $tmp.log | tee -a $seq.full | _filter
98 echo
99 _check_core
100 done
102 exit