4 # 1. one input file, one output file, no parameters - work
5 # 2. one input file, one output file, -S, -T and -z parameters - work
6 # (-S and -T are within the archive)
7 # 3. one input file, one output file, -S and -z parameters - work
9 # 4. one input file, one output file, -T and -z parameters - work
10 # (-T is out of range)
11 # 5. one input file, one output file, -t parameter - work
12 # 6. one input file, one output file, -c parameter - work
13 # 7. one input file, one output file, -c, -S, -T & -z parameter - work
14 # 8. one input file, one output file, -S, -T, -w & -z parameter - work
16 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
20 echo "QA output created by $seq"
22 # get standard filters
26 status
=1 # failure is the default!
27 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
38 echo "Warning: $prog reported the following errors:"
39 cat $tmp.err |
sed -e 's/tmp\/[0-9]*/tmp\/PID/'
43 echo "Warning: cannot find error file \"$tmp.err\"."
48 # real QA test starts here
49 echo "Test pmlogextract"
55 echo " --- step 1: no flags ---"
56 echo "(output depends on archives/mirage{0,index,meta})"
57 pmlogextract archives
/mirage
$tmp.arch
>$tmp.out
2>$tmp.err
58 _check_output pmlogextract
59 pmdumplog
-L -z $tmp.arch |
sed -e '/^PID/s/: [0-9]*/: PID/'
65 echo " --- step 2: test -S, -T and -z flags ---"
66 echo "(output depends on archives/mirage{0,index,meta})"
67 pmlogextract
-S "@10:50:00" -T "@11:00:00" -z archives
/mirage
$tmp.arch
>$tmp.out
2>$tmp.err
68 _check_output pmlogextract
69 pmdumplog
-L -z $tmp.arch |
sed -e '/^PID/s/: [0-9]*/: PID/'
75 echo " --- step 3: test -S out of range ---"
76 echo "(output depends on archives/mirage{0,index,meta})"
77 pmlogextract
-S "@10:00:00" -z archives
/mirage
$tmp.arch
>$tmp.out
2>$tmp.err
78 _check_output pmlogextract
79 pmdumplog
-L -z $tmp.arch |
sed -e '/^PID/s/: [0-9]*/: PID/'
85 echo " --- step 4: test -T out of range ---"
86 echo "(output depends on archives/mirage{0,index,meta})"
87 pmlogextract
-T "@12:00:00" -z archives
/mirage
$tmp.arch
>$tmp.out
2>$tmp.err
88 _check_output pmlogextract
89 pmdumplog
-L -z $tmp.arch |
sed -e '/^PID/s/: [0-9]*/: PID/'
92 # this was never implemented correctly .. skip it
96 #echo " --- step 5: test -t flag ---"
97 #echo "(output depends on archives/mirage{0,index,meta})"
98 ## update interval for "sample.drift" in archives/mirage is 1 minute
99 #pmlogextract -n src/root_irix -t "2min" archives/mirage $tmp.arch >$tmp.out 2>$tmp.err1
101 # | sed -e '/^Description unavailable/d' \
102 # | sed -e '/^Reason:/d' \
103 # | sed -e '/^Warning \[/d' > $tmp.err
104 #_check_output pmlogextract
105 #pmdumplog -m -z $tmp.arch sample.drift | sed -e '/^$/d'
111 echo " --- step 6: test config file ---"
112 echo "(output depends on archives/mirage{0,index,meta})"
113 # archives/mirage contains "sample.bin", "sample.drift", & "sample.mirage"
114 cat >$tmp.config
<<'End-of-file'
116 # pmlogextract config file
118 sample.bin ["bin-300" "bin-700" "bin-100"] # out of order
120 sample.mirage ["m-00" "m-13" "m-17" "m-24"] # in order
123 pmlogextract
-c $tmp.config archives
/mirage
$tmp.arch
>$tmp.out
2>$tmp.err
124 _check_output pmlogextract
127 echo "--- dump descriptors ---"
128 pmdumplog
-d -z $tmp.arch |
sed -e '/^$/d'
130 # dump instance domain
132 echo "--- dump instance domain ---"
133 pmdumplog
-i -z $tmp.arch |
sed -e '/^$/d'
135 # dump values for sample.bin
137 echo "--- dump values for sample.bin ---"
138 pmdumplog
-m -z $tmp.arch sample.bin |
sed -e '/^$/d'
140 # dump values for sample.drift
142 echo "--- dump values for sample.drift ---"
143 pmdumplog
-m -z $tmp.arch sample.drift |
sed -e '/^$/d'
145 # dump values for sample.mirage
147 echo "--- dump values for sample.mirage ---"
148 pmdumplog
-m -z $tmp.arch sample.mirage |
sed -e '/^$/d'
155 echo " --- step 7: test config file, plus -S, -T and -z flags ---"
156 echo "(output depends on archives/mirage{0,index,meta})"
157 # archives/mirage contains "sample.drift"
158 cat >$tmp.config
<<'End-of-file'
160 # pmlogextract config file
165 pmlogextract
-c $tmp.config
-S "@10:50:00" -T "@11:00:00" -z archives
/mirage
$tmp.arch
>$tmp.out
2>$tmp.err
166 _check_output pmlogextract
168 # dump values for sample.drift
169 echo "--- dump values for sample.drift ---"
170 pmdumplog
-m -z archives
/mirage sample.drift \
172 |
$PCP_AWK_PROG -F":" '{ if ($1 == 10 && $2 >= 50) print $0; }' > $tmp.m
173 pmdumplog
-m -z $tmp.arch sample.drift \
175 |
grep -v "timezone set to local" > $tmp.a
180 echo "sample.drift the same ... good"
182 echo "sample.drift different ... BAD"
190 echo " --- step 8: test -w flag (with -S, -T and -z) ---"
191 echo "(output depends on archives/rattle{0,index,meta})"
192 # archives/rattle contains "irix.kernel.all.load"
194 pmlogextract
-S "@00:00:00" -T "@12:00:00" -w -z archives
/rattle
$tmp.arch
>$tmp.out
2>$tmp.err
195 _check_output pmlogextract
197 # dump values for irix.kernel.all.load
198 echo "--- dump values for irix.kernel.all.load ---"
199 pmdumplog
-m -z archives
/rattle irix.kernel.all.load \
201 |
$PCP_AWK_PROG -F":" '{ if ($1 >= 0 && $1 < 12) print $0; }' > $tmp.m
202 pmdumplog
-m -z $tmp.arch irix.kernel.all.load \
204 |
grep -v "timezone set to local" > $tmp.a
209 echo "irix.kernel.all.load the same ... good"
211 echo "irix.kernel.all.load different ... BAD"