/var/lib/pcp/testsuite/834 is in pcp-testsuite 4.0.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | #!/bin/sh
# PCP QA Test No. 834
# pmie ruleset tests
#
# Copyright (c) 2014 Ken McDonell. 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=1 # failure is the default!
$sudo rm -rf $tmp.* $seq.full
trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
cat <<'End-of-File' >>$tmp.config
// one predicte true
// | all predicates false
// | | all predicates unknown
// | | | all predicates are true
// | | | | some unknown and some false
// | | | | | otherwise
// | | | | | | unknown
// V V V V V V V case
// Y [1]
// Y Y [4]
// Y Y [7]
// Y Y Y [10]
// Y [2]
// Y Y [3]
// Y Y [8]
// Y Y Y [11]
// Y [5]
// Y Y [9]
// Y Y [6]
// Y Y Y [12]
// Y Y Y [12]
// Y Y [13]
// Y Y [14]
// Y Y Y [15]
//
// [1] one predicate is true, only rules in the ruleset
// 1 rule ruleset - predicate is true
ruleset
sample.longlong.hundred >= 100 -> print "1-rule [1] as expected %v"
;
// 2 rule ruleset - first predicate is true
ruleset
sample.ulong.ten == 10 -> print "2-rule [1a] as expected %v"
else
sample.ulong.ten != 10 -> print "2-rule [1a] BOTCH unexpected value of %v not 10"
;
// 2 rule ruleset - second predicate is true
ruleset
sample.ulonglong.hundred != 100 -> print "2-rule [1b] BOTCH unexpected value of %v not 100"
else
sample.ulonglong.hundred == 100 -> print "2-rule [1b] as expected %v"
;
// 3 rule ruleset - first predicate is true
ruleset
sample.long.million == 1000000 -> print "3-rule [1a] as expected %v"
else
sample.long.million < 1000000 -> print "3-rule [1a] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 1000000 -> print "3-rule [1a] BOTCH larger than expected value of %v not 1000000"
;
// 3 rule ruleset - second predicate is true
ruleset
sample.long.million < 1000000 -> print "3-rule [1b] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 999999 && sample.long.million < 1000001 -> print "3-rule [1b] as expected %v"
else
sample.long.million > 1000000 -> print "3-rule [1b] BOTCH larger than expected value of %v not 1000000"
;
// 3 rule ruleset - third predicate is true
ruleset
sample.long.million < 1000000 -> print "3-rule [1c] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 1000000 -> print "3-rule [1c] BOTCH larger than expected value of %v not 1000000"
else
sample.long.million < 999999 || sample.long.million >= 1000000 -> print "3-rule [1c] as expected %v"
;
// [2] all predicates are false, only rules in the ruleset
// 1 rule ruleset - predicate is false
ruleset
sample.long.ten < 10 -> print "1-rule [2] BOTCH smaller than expected value of %v not 10"
;
// 2 rule ruleset - all predicates are false
ruleset
sample.ulong.ten > 10 -> print "2-rule [2] BOTCH %v > 10?"
else
sample.ulong.ten != 10 -> print "2-rule [2] BOTCH %v != 10?"
;
// 3 rule ruleset - all predicates are false
ruleset
sample.long.million > 1000000 -> print "3-rule [2] BOTCH %v > 1000000?"
else
sample.long.million < 1000000 -> print "3-rule [2] BOTCH %v < 1000000?"
else
sample.long.million != 1000000 -> print "3-rule [2] BOTCH %v != 1000000?"
;
// [3] no predicate is true, otherwise clause in the ruleset
// 1 rule ruleset - predicate is false, otherwise clause
ruleset
sample.long.ten < 10 -> print "1-rule [3] BOTCH smaller than expected value of %v not 10"
otherwise -> print "1-rule [3] otherwise as expected"
;
// 2 rule ruleset - all predicates are false, otherwise clause
ruleset
sample.ulong.ten > 10 -> print "2-rule [3] BOTCH %v > 10?"
else
sample.ulong.ten != 10 -> print "2-rule [3] BOTCH %v != 10?"
otherwise -> print "2-rule [3] otherwise as expected"
;
// 3 rule ruleset - all predicates are false, otherwise clause
ruleset
sample.long.million > 1000000 -> print "3-rule [3] BOTCH %v > 1000000?"
else
sample.long.million < 1000000 -> print "3-rule [3] BOTCH %v < 1000000?"
else
sample.long.million != 1000000 -> print "3-rule [3] BOTCH %v != 1000000?"
otherwise -> print "3-rule [3] otherwise as expected"
;
// [4] one predicate is true, rules and otherwise in the ruleset
// 1 rule ruleset - predicate is true
ruleset
sample.longlong.hundred >= 100 -> print "1-rule [4] as expected %v"
otherwise -> print "1-rule [4] BOTCH otherwise not expected"
;
// 2 rule ruleset - first predicate is true
ruleset
sample.ulong.ten == 10 -> print "2-rule [4a] as expected %v"
else
sample.ulong.ten != 10 -> print "2-rule [4a] BOTCH unexpected value of %v not 10"
otherwise -> print "2-rule [4a] BOTCH otherwise not expected"
;
// 2 rule ruleset - second predicate is true
ruleset
sample.ulonglong.hundred != 100 -> print "2-rule [4b] BOTCH unexpected value of %v not 100"
else
sample.ulonglong.hundred == 100 -> print "2-rule [4b] as expected %v"
otherwise -> print "2-rule [4b] BOTCH otherwise not expected"
;
// 3 rule ruleset - first predicate is true
ruleset
sample.long.million == 1000000 -> print "3-rule [4a] as expected %v"
else
sample.long.million < 1000000 -> print "3-rule [4a] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 1000000 -> print "3-rule [4a] BOTCH larger than expected value of %v not 1000000"
otherwise -> print "3-rule [4a] BOTCH otherwise not expected"
;
// 3 rule ruleset - second predicate is true
ruleset
sample.long.million < 1000000 -> print "3-rule [4b] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 999999 && sample.long.million < 1000001 -> print "3-rule [4b] as expected %v"
else
sample.long.million > 1000000 -> print "3-rule [4b] BOTCH larger than expected value of %v not 1000000"
otherwise -> print "3-rule [4b] BOTCH otherwise not expected"
;
// 3 rule ruleset - third predicate is true
ruleset
sample.long.million < 1000000 -> print "3-rule [4c] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 1000000 -> print "3-rule [4c] BOTCH larger than expected value of %v not 1000000"
else
sample.long.million < 999999 || sample.long.million >= 1000000 -> print "3-rule [4c] as expected %v"
otherwise -> print "3-rule [4c] BOTCH otherwise not expected"
;
// [5] all predicates are unknown, only rules in the ruleset
// 1 rule ruleset - predicate is unknown
ruleset
sample.bad.novalues < 10 -> print "1-rule [5] BOTCH smaller than expected value of %v not 10"
;
// 2 rule ruleset - all predicates are unknown
ruleset
sample.bad.novalues > 10 -> print "2-rule [5] BOTCH %v > 10?"
else
some_inst (sample.noinst != 10) -> print "2-rule [5] BOTCH %v != 10?"
;
// 3 rule ruleset - all predicates are unknown
ruleset
sample.bad.novalues > 10 -> print "2-rule [5] BOTCH %v > 10?"
else
some_inst (sample.noinst != 10) -> print "2-rule [5] BOTCH %v != 10?"
else
count_inst (sample.noinst != 10) > 0 -> print "2-rule [5] BOTCH %v != 10?"
;
// [6] all predicates are unknown, unknown clause in the ruleset
// 1 rule ruleset - predicate is unknown, unknown clause
ruleset
sample.bad.novalues < 10 -> print "1-rule [6] BOTCH smaller than expected value of %v not 10"
unknown -> print "1-rule [6] unknown as expected"
;
// 2 rule ruleset - all predicates are unknown, unknown clause
ruleset
sample.bad.novalues > 10 -> print "2-rule [6] BOTCH %v > 10?"
else
some_inst (sample.noinst != 10) -> print "2-rule [6] BOTCH %v != 10?"
unknown -> print "2-rule [6] unknown as expected"
;
// 3 rule ruleset - all predicates are unknown, unknown clause
ruleset
sample.bad.novalues > 10 -> print "2-rule [6] BOTCH %v > 10?"
else
some_inst (sample.noinst != 10) -> print "2-rule [6] BOTCH %v != 10?"
else
count_inst (sample.noinst != 10) > 0 -> print "2-rule [6] BOTCH %v != 10?"
unknown -> print "3-rule [6] unknown as expected"
;
// [7] one predicate is true, rules and unknown in the ruleset
// 1 rule ruleset - predicate is true
ruleset
sample.longlong.hundred >= 100 -> print "1-rule [7] as expected %v"
unknown -> print "1-rule [7] BOTCH unknown not expected"
;
// 2 rule ruleset - first predicate is true
ruleset
sample.ulong.ten == 10 -> print "2-rule [7a] as expected %v"
else
sample.ulong.ten != 10 -> print "2-rule [7a] BOTCH unexpected value of %v not 10"
unknown -> print "2-rule [7a] BOTCH unknown not expected"
;
// 2 rule ruleset - second predicate is true
ruleset
sample.ulonglong.hundred != 100 -> print "2-rule [7b] BOTCH unexpected value of %v not 100"
else
sample.ulonglong.hundred == 100 -> print "2-rule [7b] as expected %v"
unknown -> print "2-rule [7a] BOTCH unknown not expected"
;
// 3 rule ruleset - first predicate is true
ruleset
sample.long.million == 1000000 -> print "3-rule [7a] as expected %v"
else
sample.long.million < 1000000 -> print "3-rule [7a] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 1000000 -> print "3-rule [7a] BOTCH larger than expected value of %v not 1000000"
unknown -> print "3-rule [7a] BOTCH unknown not expected"
;
// 3 rule ruleset - second predicate is true
ruleset
sample.long.million < 1000000 -> print "3-rule [7b] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 999999 && sample.long.million < 1000001 -> print "3-rule [7b] as expected %v"
else
sample.long.million > 1000000 -> print "3-rule [7b] BOTCH larger than expected value of %v not 1000000"
unknown -> print "3-rule [7b] BOTCH unknown not expected"
;
// 3 rule ruleset - third predicate is true
ruleset
sample.long.million < 1000000 -> print "3-rule [7c] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 1000000 -> print "3-rule [7c] BOTCH larger than expected value of %v not 1000000"
else
sample.long.million < 999999 || sample.long.million >= 1000000 -> print "3-rule [7c] as expected %v"
unknown -> print "3-rule [7c] BOTCH unknown not expected"
;
// [8] no predicate is true, unknown clause in the ruleset
// 1 rule ruleset - predicate is false, unknown clause
ruleset
sample.long.ten < 10 -> print "1-rule [8] BOTCH smaller than expected value of %v not 10"
unknown -> print "1-rule [8] BOTCH unknown not expected"
;
// 2 rule ruleset - all predicates are false, unknown clause
ruleset
sample.ulong.ten > 10 -> print "2-rule [8] BOTCH %v > 10?"
else
sample.ulong.ten != 10 -> print "2-rule [8] BOTCH %v != 10?"
unknown -> print "2-rule [8] BOTCH unknown not expected"
;
// 3 rule ruleset - all predicates are false, unknown clause
ruleset
sample.long.million > 1000000 -> print "3-rule [8] BOTCH %v > 1000000?"
else
sample.long.million < 1000000 -> print "3-rule [8] BOTCH %v < 1000000?"
else
sample.long.million != 1000000 -> print "3-rule [8] BOTCH %v != 1000000?"
unknown -> print "3-rule [8] BOTCH unknown not expected"
;
// [9] all predicates are unknown, otherwise clause in the ruleset
// 1 rule ruleset - predicate is unknown, otherwise clause
ruleset
sample.bad.novalues < 10 -> print "1-rule [9] BOTCH smaller than expected value of %v not 10"
otherwise -> print "1-rule [9] otherwise as expected"
;
// 2 rule ruleset - all predicates are unknown, otherwise clause
ruleset
sample.bad.novalues > 10 -> print "2-rule [9] BOTCH %v > 10?"
else
some_inst (sample.noinst != 10) -> print "2-rule [9] BOTCH %v != 10?"
otherwise -> print "2-rule [9] otherwise as expected"
;
// 3 rule ruleset - all predicates are unknown, otherwise clause
ruleset
sample.bad.novalues > 10 -> print "2-rule [9] BOTCH %v > 10?"
else
some_inst (sample.noinst != 10) -> print "2-rule [9] BOTCH %v != 10?"
else
count_inst (sample.noinst != 10) > 0 -> print "2-rule [9] BOTCH %v != 10?"
otherwise -> print "3-rule [9] otherwise as expected"
;
// [10] one predicate is true, rules and otherwise and unknown in the ruleset
// 1 rule ruleset - predicate is true
ruleset
sample.longlong.hundred >= 100 -> print "1-rule [10] as expected %v"
unknown -> print "1-rule [10] BOTCH unknown not expected"
otherwise -> print "1-rule [10] BOTCH otherwise not expected"
;
// 2 rule ruleset - first predicate is true
ruleset
sample.ulong.ten == 10 -> print "2-rule [10a] as expected %v"
else
sample.ulong.ten != 10 -> print "2-rule [10a] BOTCH unexpected value of %v not 10"
unknown -> print "2-rule [10a] BOTCH unknown not expected"
otherwise -> print "2-rule [10a] BOTCH otherwise not expected"
;
// 2 rule ruleset - second predicate is true
ruleset
sample.ulonglong.hundred != 100 -> print "2-rule [10b] BOTCH unexpected value of %v not 100"
else
sample.ulonglong.hundred == 100 -> print "2-rule [10b] as expected %v"
unknown -> print "2-rule [10a] BOTCH unknown not expected"
otherwise -> print "2-rule [10b] BOTCH otherwise not expected"
;
// 3 rule ruleset - first predicate is true
ruleset
sample.long.million == 1000000 -> print "3-rule [10a] as expected %v"
else
sample.long.million < 1000000 -> print "3-rule [10a] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 1000000 -> print "3-rule [10a] BOTCH larger than expected value of %v not 1000000"
unknown -> print "3-rule [10a] BOTCH unknown not expected"
otherwise -> print "3-rule [10a] BOTCH otherwise not expected"
;
// 3 rule ruleset - second predicate is true
ruleset
sample.long.million < 1000000 -> print "3-rule [10b] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 999999 && sample.long.million < 1000001 -> print "3-rule [10b] as expected %v"
else
sample.long.million > 1000000 -> print "3-rule [10b] BOTCH larger than expected value of %v not 1000000"
unknown -> print "3-rule [10b] BOTCH unknown not expected"
otherwise -> print "3-rule [10b] BOTCH otherwise not expected"
;
// 3 rule ruleset - third predicate is true
ruleset
sample.long.million < 1000000 -> print "3-rule [10c] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.million > 1000000 -> print "3-rule [10c] BOTCH larger than expected value of %v not 1000000"
else
sample.long.million < 999999 || sample.long.million >= 1000000 -> print "3-rule [10c] as expected %v"
unknown -> print "3-rule [10c] BOTCH unknown not expected"
otherwise -> print "3-rule [10c] BOTCH otherwise not expected"
;
// [11] no predicate is true, unknown and otherwise clause in the ruleset
// 1 rule ruleset - predicate is false, unknown and otherwise clause
ruleset
sample.long.ten < 10 -> print "1-rule [11] BOTCH smaller than expected value of %v not 10"
unknown -> print "1-rule [11] BOTCH unknown not expected"
otherwise -> print "1-rule [11] otherwise as expected"
;
// 2 rule ruleset - all predicates are false, unknown and otherwise clause
ruleset
sample.ulong.ten > 10 -> print "2-rule [11] BOTCH %v > 10?"
else
sample.ulong.ten != 10 -> print "2-rule [11] BOTCH %v != 10?"
unknown -> print "2-rule [11] BOTCH unknown not expected"
otherwise -> print "2-rule [11] otherwise as expected"
;
// 3 rule ruleset - all predicates are false, unknown and otherwise clause
ruleset
sample.long.million > 1000000 -> print "3-rule [11] BOTCH %v > 1000000?"
else
sample.long.million < 1000000 -> print "3-rule [11] BOTCH %v < 1000000?"
else
sample.long.million != 1000000 -> print "3-rule [11] BOTCH %v != 1000000?"
unknown -> print "3-rule [11] BOTCH unknown not expected"
otherwise -> print "3-rule [11] otherwise as expected"
;
// [12] all predicates are unknown, unknown and otherwise clause in the ruleset
// 1 rule ruleset - predicate is unknown, unknown and otherwise clause
ruleset
sample.bad.novalues < 10 -> print "1-rule [12] BOTCH smaller than expected value of %v not 10"
unknown -> print "1-rule [12] unknown as expected"
otherwise -> print "1-rule [12] BOTCH otherwise not expected"
;
// 2 rule ruleset - all predicates are unknown, unknown and otherwise clause
ruleset
sample.bad.novalues > 10 -> print "2-rule [12] BOTCH %v > 10?"
else
some_inst (sample.noinst != 10) -> print "2-rule [12] BOTCH %v != 10?"
unknown -> print "2-rule [12] unknown as expected"
otherwise -> print "2-rule [12] BOTCH otherwise not expected"
;
// 3 rule ruleset - all predicates are unknown, unknown and otherwise clause
ruleset
sample.bad.novalues > 10 -> print "2-rule [12] BOTCH %v > 10?"
else
some_inst (sample.noinst != 10) -> print "2-rule [12] BOTCH %v != 10?"
else
count_inst (sample.noinst != 10) > 0 -> print "2-rule [12] BOTCH %v != 10?"
unknown -> print "3-rule [12] unknown as expected"
otherwise -> print "3-rule [12] BOTCH otherwise not expected"
;
// [13] all predicates true, rules and otherwise and unknown in the ruleset
// 1 rule ruleset - predicate is true
ruleset
sample.longlong.hundred >= 100 -> print "1-rule [13] as expected %v"
unknown -> print "1-rule [13] BOTCH unknown not expected"
otherwise -> print "1-rule [13] BOTCH otherwise not expected"
;
// 2 rule ruleset - both predicates are true
ruleset
sample.ulong.ten == 10 -> print "2-rule [13] as expected %v"
else
sample.ulong.hundred == 100 -> print "2-rule [13] BOTCH unexpected value of %v not 10"
unknown -> print "2-rule [13] BOTCH unknown not expected"
otherwise -> print "2-rule [13] BOTCH otherwise not expected"
;
// 3 rule ruleset - all predicates are true
ruleset
sample.long.million == 1000000 -> print "3-rule [13] as expected %v"
else
sample.long.ten == 10 -> print "3-rule [13] BOTCH smaller than expected value of %v not 1000000"
else
sample.long.one == 1 -> print "3-rule [13] BOTCH larger than expected value of %v not 1000000"
unknown -> print "3-rule [13] BOTCH unknown not expected"
otherwise -> print "3-rule [13] BOTCH otherwise not expected"
;
End-of-File
# real QA test starts here
pmie -t 1sec -T 3.5sec -c $tmp.config 2>&1 | _filter_pmie_log
# success, all done
status=0
exit
|