Drop unused condition check
[pcp.git] / qa / 378
blob3bd25a09eacf1533b1414d4bea65c78722cb3644
1 #!/bin/sh
2 # PCP QA Test No. 378
4 # pmie with multiple -a arguments
5 # - problem reported by Jason Rappleye @ NASA
7 # Copyright (c) 2010 Ken McDonell. All Rights Reserved.
10 seq=`basename $0`
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
14 . ./common.product
15 . ./common.filter
16 . ./common.check
18 _filter()
20 sed -e '/ Info: evaluator exiting/d'
23 status=0 # success is the default!
24 $sudo rm -rf $tmp.* $seq.full
25 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
27 echo "just one archive (kenj-pc-1) ..."
28 cat <<End-of-File \
29 | pmie -z -A 1min -t 60 -a archives/kenj-pc-1 2>&1 \
30 | _filter
31 kernel.all.load #'1 minute' > 1.5 -> print "%h: %v";
32 End-of-File
34 echo
35 echo "expect error as same host ..."
36 cat <<End-of-File \
37 | pmie -z -A 1min -t 60 -a archives/kenj-pc-1 -a archives/kenj-pc-2 2>&1 \
38 | _filter
39 kernel.all.load #'1 minute' > 1.5 -> print "%h: %v";
40 End-of-File
42 echo
43 echo "other archive (naslog) ..."
44 cat <<End-of-File \
45 | pmie -z -A 1min -t 60 -a archives/naslog 2>&1 \
46 | _filter
47 kernel.all.load #'1 minute' > 1.5 -> print "%h: %v";
48 End-of-File
50 echo
51 echo "and now together kenj-pc-1 first ..."
52 cat <<End-of-File \
53 | pmie -z -A 1min -t 60 -a archives/kenj-pc-1 -a archives/naslog 2>&1 \
54 | _filter
55 kernel.all.load #'1 minute' > 1.5 -> print "%h: %v";
56 End-of-File
58 echo
59 echo "and now together naslog first ..."
60 cat <<End-of-File \
61 | pmie -z -A 1min -t 60 -a archives/naslog -a archives/kenj-pc-1 2>&1 \
62 | _filter
63 kernel.all.load #'1 minute' > 1.5 -> print "%h: %v";
64 End-of-File
66 echo
67 echo "two rules, host-specific (naslog first) ..."
68 cat <<End-of-File \
69 | pmie -z -A 1min -t 60 -a archives/naslog -a archives/kenj-pc-1 2>&1 \
70 | _filter
71 kernel.all.load :'kenj-pc' #'1 minute' > 1.5 -> print "%h: %v";
72 kernel.all.load :snort #'1 minute' > 1.5 -> print "%h: %v";
73 End-of-File
75 echo
76 echo "and now with some_host ... only one value ever available, so >"
77 echo "condition is always false and some_host never gets a chance"
78 echo "... expect no output"
79 cat <<End-of-File \
80 | pmie -z -A 1min -t 60 -a archives/naslog -a archives/kenj-pc-1 2>&1 \
81 | _filter
82 some_host ( kernel.all.load :'kenj-pc' :snort #'1 minute' ) > 1.5 -> print "%h: %v";
83 End-of-File
85 echo
86 echo "... and it does not matter which order the archives are given"
87 cat <<End-of-File \
88 | pmie -z -A 1min -t 60 -a archives/kenj-pc-1 -a archives/naslog 2>&1 \
89 | _filter
90 some_host ( kernel.all.load :'kenj-pc' :snort #'1 minute' ) > 1.5 -> print "%h: %v";
91 End-of-File
93 # success, all done
94 exit