qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 055
blob975a0f0b1c466e3450320e26b31c38e55f18229e
1 #! /bin/sh
2 # PCP QA Test No. 055
3 # pmie basic expression evaluation and scheduling
4 # for remote version using other hosts, see 360
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. 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 trap "rm -f $tmp.* /tmp/pmie.err; exit" 0 1 2 3 15
18 rm -f $seq.full
20 # here are the exercises
21 cat >>$tmp.config << \EOF
22 delta = 1 sec;
24 // the meaning of life, the universe and everything
25 sample.long.hundred - (16 * sample.float.ten + 11 * sample.double.one) / 3;
27 // instance domain exercises
28 inst_fetch1 = sample.bin;
29 inst_fetch2 = sample.bin #'bin-200' #'bin-400' #'bin-600' #'bin-800';
30 inst_neg = -sample.bin;
31 inst_rate = rate sample.bin;
32 inst_sum = sum_inst sample.bin;
33 inst_avg = avg_inst sample.bin;
34 inst_max = max_inst sample.bin;
35 inst_min = min_inst sample.bin;
36 inst_count = count_inst sample.bin > 400;
37 inst_add1 = sample.bin + sample.bin;
38 inst_add2 = sample.bin + sample.longlong.million;
39 inst_add3 = sample.longlong.million + sample.bin;
40 inst_sub = sample.bin - sample.bin;
41 inst_mul = sample.bin * sample.bin;
42 inst_div = sample.bin / sample.bin;
43 inst_eq1 = sample.bin == sample.bin;
44 inst_eq2 = sample.bin == sample.bin + 1;
45 inst_eq3 = sample.bin == 500;
46 inst_neq1 = sample.bin != sample.bin + 1;
47 inst_neq2 = sample.bin != sample.bin;
48 inst_neq3 = sample.bin != 500;
49 inst_gt1 = sample.bin + 1 > sample.bin;
50 inst_gt2 = sample.bin > sample.bin + 1;
51 inst_gt3 = sample.bin > 500;
52 inst_lt1 = sample.bin < sample.bin + 1;
53 inst_lt2 = sample.bin + 1 < sample.bin;
54 inst_lt3 = sample.bin < 500;
55 inst_geq1 = sample.bin >= sample.bin;
56 inst_geq2 = sample.bin >= sample.bin + 1;
57 inst_leq1 = sample.bin <= sample.bin;
58 inst_leq2 = sample.bin + 1 <= sample.bin;
60 // sample time domain exercises
61 time_fetch0 = sample.float.ten @0;
62 time_fetch1 = sample.float.ten @1;
63 time_fetch2 = sample.float.ten @2;
64 time_fetch01 = sample.float.ten @0..1;
65 time_fetch12 = sample.float.ten @1..2;
66 time_fetch02 = sample.float.ten @0..2;
67 time_sum = sum_sample sample.float.ten @0..2;
68 time_avg = avg_sample sample.float.ten @0..2;
69 time_max = max_sample sample.float.ten @0..2;
70 time_min = min_sample sample.float.ten @0..2;
71 time_count = count_sample sample.float.ten @0..2 >= 10;
72 time_add1 = sample.float.ten @0 + sample.float.ten @1 + sample.float.ten @2;
73 time_add2 = sample.float.ten @0..1 + sample.float.ten @1..2;
74 time_add3 = sample.float.ten @0..2 + 1;
75 time_add4 = 1 + sample.float.ten @0..2;
76 time_gt1 = sample.float.ten @0..1 + 1 > sample.float.ten @0..1;
77 time_gt2 = sample.float.ten @0..1 > sample.float.ten @0..1 + 1;
78 time_gt3 = sample.float.ten @0..2 + 1 > sample.float.ten @0..2;
79 time_gt4 = sample.float.ten @0..2 > sample.float.ten @0..2 + 1;
81 delta = 2 sec;
83 // multiple domains
84 multi1 = sum_sample avg_inst sample.bin @0..2;
85 multi2 = avg_inst sum_sample sample.bin @0..2;
87 delta = 3 sec;
89 // boolean operators
90 arg1 = "sample.bin >= 500";
91 arg2 = "sample.bin <= 500";
92 arg3 = "sample.bin < 1000";
93 arg4 = "sample.bin > 1000";
94 bool1 = $arg1;
95 bool2 = $arg2;
96 bool_not = ! $arg1;
97 bool_and = $arg1 && $arg2;
98 bool_or = $arg1 || $arg2;
99 bool_some1 = some_inst $arg1;
100 bool_some2 = some_inst $arg4;
101 bool_all1 = all_inst $arg3;
102 bool_all2 = all_inst $arg1;
103 bool_pcnt1 = 50 %_inst $arg1;
104 bool_pcnt2 = 70 %_inst $arg1;
105 bool_pcnt3 = 0 %_inst $arg4;
106 bool_pcnt4 = 100 %_inst $arg3;
108 delta = 4 sec;
110 // actions
111 act1 = true -> shell "echo >>/tmp/pmie.err act1 fired";
112 act2 = false -> shell "echo >>/tmp/pmie.err act2 fired OHH NOOOOO";
113 act3 = true -> shell "echo >>/tmp/pmie.err act3..." & shell "echo >>/tmp/pmie.err fired";
114 act4 = true -> shell "echo >>/tmp/pmie.err act 4 fired" | shell "echo >>/tmp/pmie.err OHH NOOOO";
117 cat $tmp.config >>$seq.full
119 $sudo rm -f /tmp/pmie.err
120 pmie -T 10 -v $tmp.config >$tmp.out 2>$tmp.err
121 ( echo; echo "=== err ==="; cat $tmp.err ) >>$seq.full
122 cat $tmp.err | _show_pmie_exit
123 ( echo; echo "=== out ==="; cat $tmp.out ) >>$seq.full
124 cat $tmp.out | LC_COLLATE=POSIX sort
125 ( echo; echo "=== /tmp/pmie.err ==="; cat /tmp/pmie.err ) >>$seq.full
126 cat /tmp/pmie.err | LC_COLLATE=POSIX sort