summaryrefslogtreecommitdiff
path: root/qa/319
blob: 5be73fec7d586307472ffcdbcfaf13032a5771fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
#! /bin/sh
# PCP QA Test No. 319
# reworked AND and OR logic in the presence of unavailable results
#
# Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

status=0	# success is the default!
$sudo rm -rf $tmp.*
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15

# real QA test starts here
DEBUG='-Dappl1,appl2'
DEBUG=

# unknown metrics
# 1U - sample.noinst (PM_INDOM_NULL)
# nU - sample.darkness (InDom 29.1)

pmie $DEBUG -v -t 0.5sec -T 3sec <<'End-of-File' 2>$tmp.err \
| tee $seq.full \
| sed -e 's/.* [0-9][0-9][0-9][0-9]: \([a-z]\)/\1/' \
| sort \
| uniq
prime = sample.darkness;
e1 = some_inst (sample.noinst > 0)
    -> print "e1: Error! should be unknown always\n";
e2 = some_inst (sample.noinst > 0) && hinv.ncpu > 0
    -> print "e2: Error! should be false always\n"; 

true_1T_and_1T = hinv.ncpu > 0 && sample.load == 42
    -> print "true_1T_and_1T: OK should always be true\n";
false_1T_and_1F = hinv.ncpu > 0 && sample.load != 42
    -> print "false_1T_and_1F: Error! should always be false\n";
unknown_1T_and_1U = hinv.ncpu > 0 && sample.noinst == 42
    -> print "unknown_1T_and_1U: Error! should always be unknown\n";
true_1T_and_nT = some_inst (hinv.ncpu > 0 && sample.colour > 0)
    -> print "true_1T_and_nT: OK should always be true\n";
false_1T_and_nF = some_inst (hinv.ncpu > 0 && sample.colour < 0)
    -> print "false_1T_and_nF: Error! should always be false\n";
unknown_1T_and_nU = some_inst (hinv.ncpu > 0 && sample.darkness > 0)
    -> print "unknown_1T_and_nU:  Error! should always be unknown\n";

false_1F_and_1T = hinv.ncpu < 0 && sample.load == 42
    -> print "false_1F_and_1T: Error! should always be false\n";
false_1F_and_1F = hinv.ncpu < 0 && sample.load != 42
    -> print "false_1F_and_1F: Error! should always be false\n";
false_1F_and_1U = hinv.ncpu < 0 && sample.noinst == 42
    -> print "false_1F_and_1U: Error! should always be false\n";
false_1F_and_nT = some_inst (hinv.ncpu < 0 && sample.colour > 0)
    -> print "false_1F_and_nT: Error! should always be false\n";
false_1F_and_nF = some_inst (hinv.ncpu < 0 && sample.colour < 0)
    -> print "false_1F_and_nF: Error! should always be false\n";
false_1F_and_nU = some_inst (hinv.ncpu < 0 && sample.darkness > 0)
    -> print "false_1F_and_nU: Error! should always be false\n";

unknown_1U_and_1T = sample.noinst == 42 && hinv.ncpu > 0 
    -> print "unknown_1U_and_1T: Error! should always be unknown\n";
false_1U_and_1F = sample.noinst == 42 && hinv.ncpu < 0 
    -> print "false_1U_and_1F: Error! should always be false\n";
unknown_1U_and_1U = sample.noinst == 42 && sample.noinst == 43
    -> print "unknown_1U_and_1U: Error! should always be unknown\n";
unknown_1U_and_nT = some_inst (sample.noinst == 42 && sample.colour > 0)
    -> print "unknown_1U_and_nT: Error! should always be unknown\n";
false_1U_and_nF = some_inst (sample.noinst == 42 && sample.colour < 0)
    -> print "false_1U_and_nF: Error! should always be false\n";
unknown_1U_and_nU = some_inst (sample.noinst == 42 && sample.darkness > 0)
    -> print "unknown_1U_and_nU: Error! should always be unknown\n";

true_nT_and_1T = some_inst (sample.colour > 0 && hinv.ncpu > 0)
    -> print "true_nT_and_1T: OK should always be true\n";
false_nT_and_1F = some_inst (sample.colour > 0 && hinv.ncpu < 0)
    -> print "false_nT_and_1F: Error! should always be false\n";
unknown_nT_and_1U = some_inst (sample.colour > 0 && sample.noinst == 42)
    -> print "true_nT_and_nU: Error! should always be unknown\n";
true_nT_and_nT = some_inst (sample.colour > 0 && sample.colour >= 1)
    -> print "true_nT_and_nT: OK should always be true\n";
false_nT_and_nF = some_inst (sample.colour > 0 && sample.colour < 0)
    -> print "false_nT_and_nF: Error! should always be false\n";
unknown_nT_and_nU = some_inst (sample.colour > 0 && sample.darkness > 0)
    -> print "true_nT_and_nU: Error! should always be unknown\n";

false_nF_and_1T= some_inst (sample.colour < 0 && hinv.ncpu > 0)
    -> print "false_nF_and_1T: Error! should always be false\n";
false_nF_and_1F= some_inst (sample.colour < 0 && hinv.ncpu < 0)
    -> print "false_nF_and_1F: Error! should always be false\n";
false_nF_and_1U= some_inst (sample.colour < 0 && sample.noinst == 42)
    -> print "false_nF_and_1U: Error! should always be false\n";
false_nF_and_nT = some_inst (sample.colour < 0 && sample.colour > 0)
    -> print "false_nF_and_nT: Error! should always be false\n";
false_nF_and_nF = some_inst (sample.colour < 0 && sample.colour < -1)
    -> print "false_nF_and_nF: Error! should always be false\n";
false_nF_and_nU = some_inst (sample.colour < 0 && sample.darkness > 0)
    -> print "false_nF_and_nU: Error! should always be false\n";

unknown_nU_and_1T = some_inst (sample.darkness > 0 && hinv.ncpu > 0)
    -> print "unknown_nU_and_1T: Error! should always be unknown\n";
unknown_nU_and_1F = some_inst (sample.darkness > 0 && hinv.ncpu < 0)
    -> print "unknown_nU_and_1F: Error! should always be unknown\n";
unknown_nU_and_1U = some_inst (sample.darkness > 0 && sample.noinst == 42)
    -> print "unknown_nU_and_1U: Error! should always be unknown\n";
unknown_nU_and_nT = some_inst (sample.darkness > 0 && sample.colour > 0)
    -> print "unknown_nU_and_nT: Error! should always be unknown\n";
// only odd one here, the nF provides the instance domain enumeration
// and since all instances are false there, the conjunct is universally
// false
false_nU_and_nF = some_inst (sample.darkness > 0 && sample.colour < 0)
    -> print "false_nU_and_nF: Error! should always be false\n";
unknown_nU_and_nU = some_inst (sample.darkness > 0 && sample.darkness > 100)
    -> print "unknown_nU_and_nU: Error! should always be unknown\n";

true_1T_or_1T = hinv.ncpu > 0 || hinv.ncpu > -1
    -> print "true_1T_or_1T: OK should always be true\n";
true_1T_or_1F = hinv.ncpu > 0 || hinv.ncpu < 0
    -> print "true_1T_or_1F: OK should always be true\n";
true_1T_or_1U = hinv.ncpu > 0 || sample.noinst == 42
    -> print "true_1T_or_1U: OK should always be true\n";
true_1T_or_nT = some_inst (hinv.ncpu > 0 || sample.colour > 0)
    -> print "true_1T_or_nT: OK should always be true\n";
true_1T_or_nF = some_inst (hinv.ncpu > 0 || sample.colour < 0)
    -> print "true_1T_or_nF: OK should always be true\n";
true_1T_or_nU = some_inst (hinv.ncpu > 0 || sample.darkness > 0)
    -> print "true_1T_or_nU: OK should always be true\n";

true_1F_or_1T = hinv.ncpu < 0 || hinv.ncpu > 0
    -> print "true_1F_or_1T: OK should always be true\n";
false_1F_or_1F = hinv.ncpu < 0 || hinv.ncpu < -1
    -> print "false_1F_or_1F: Error! should always be false\n";
unknown_1F_or_1U = hinv.ncpu < 0 || sample.noinst == 42
    -> print "unknown_1F_or_1U: Error! should always be unknown\n";
true_1F_or_nT = some_inst (hinv.ncpu < 0 || sample.colour > 0)
    -> print "true_1F_or_nT: OK should always be true\n";
false_1F_or_nF = some_inst (hinv.ncpu < 0 || sample.colour < 0)
    -> print "false_1F_or_nF: Error! should always be false\n";
unknown_1F_or_nU = some_inst (hinv.ncpu < 0 || sample.darkness > 0)
    -> print "unknown_1F_or_nU: Error! should always be unknown\n";

true_1U_or_1T = sample.noinst == 42 || hinv.ncpu > 0 
    -> print "true_1U_or_1T: OK should always be true\n";
unknown_1U_or_1F = sample.noinst == 42 || hinv.ncpu < 0 
    -> print "unknown_1U_or_1F: Error! should always be unknown\n";
unknown_1U_or_1U = sample.noinst == 42 || sample.noinst == 43
    -> print "unknown_1U_or_1U: Error! should always be unknown\n";
true_1U_or_nT = some_inst (sample.noinst == 42 || sample.colour > 0)
    -> print "true_1U_or_nT: OK should always be true\n";
unknown_1U_or_nF = some_inst (sample.noinst == 42 || sample.colour < 0)
    -> print "unknown_1U_or_nF: Error! should always be unknown\n";
unknown_1U_or_nU = some_inst (sample.noinst == 42 || sample.darkness > 0)
    -> print "unknown_1U_or_nU: Error! should always be unknown\n";

true_nT_or_1T = some_inst (sample.colour > 0 || hinv.ncpu > 0)
    -> print "true_nT_or_1T: OK should always be true\n";
true_nT_or_1F = some_inst (sample.colour > 0 || hinv.ncpu < 0)
    -> print "true_nT_or_1F: OK should always be true\n";
true_nT_or_1U = some_inst (sample.colour > 0 || sample.noinst == 42)
    -> print "true_nT_or_1U: OK should always be true\n";
true_nT_or_nT = some_inst (sample.colour > 0 || sample.colour >= 1)
    -> print "true_nT_or_nT: OK should always be true\n";
true_nT_or_nF = some_inst (sample.colour > 0 || sample.colour < 0)
    -> print "true_nT_or_nF: OK should always be true\n";
true_nT_or_nU = some_inst (sample.colour > 0 || sample.darkness > 0)
    -> print "true_nT_or_nU: OK should always be true\n";

true_nF_or_1T= some_inst (sample.colour < 0 || hinv.ncpu > 0)
    -> print "true_nF_or_1T: OK should always be true\n";
false_nF_or_1F= some_inst (sample.colour < 0 || hinv.ncpu < 0)
    -> print "false_nF_or_1F: Error! should always be false\n";
unknown_nF_or_1U= some_inst (sample.colour < 0 || sample.noinst == 42)
    -> print "unknown_nF_or_1U: Error! should always be unknown\n";
true_nF_or_nT = some_inst (sample.colour < 0 || sample.colour > 0)
    -> print "true_nF_or_nT: OK should always be true\n";
false_nF_or_nF = some_inst (sample.colour < 0 || sample.colour < -1)
    -> print "false_nF_or_nF: Error! should always be false\n";
unknown_nF_or_nU = some_inst (sample.colour < 0 || sample.darkness > 0)
    -> print "unknown_nF_or_nU: Error! should always be unknown\n";

// this one is going to be unknown, because there are an unknown number
// of instances in the first predicate, so some_inst is universally unknown
unknown_nU_or_1T = some_inst (sample.darkness > 0 || hinv.ncpu > 0)
    -> print "unknown_nU_or_1T: Error! should always be unknown\n";
unknown_nU_or_1F = some_inst (sample.darkness > 0 || hinv.ncpu < 0)
    -> print "unknown_nU_or_1F: Error! should always be unknown\n";
unknown_nU_or_1U = some_inst (sample.darkness > 0 || sample.noinst == 42)
    -> print "unknown_nU_or_1U: Error! should always be unknown\n";
true_nU_or_nT = some_inst (sample.darkness > 0 || sample.colour > 0)
    -> print "true_nU_or_nT: OK should always be true\n";
unknown_nU_or_nF = some_inst (sample.darkness > 0 || sample.colour < 0)
    -> print "unknown_nU_or_nF: Error! should always be unknown\n";
unknown_nU_or_nU = some_inst (sample.darkness > 0 || sample.darkness > 100)
    -> print "unknown_nU_or_nU: Error! should always be unknown\n";

End-of-File

echo >>$seq.full
echo "=== stderr ==" >>$seq.full
cat $tmp.err >>$seq.full

exit