2 # PCP QA Test No. 269 (formerly 269, 406)
3 # To test out wrapping for pmval
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard filters
16 signal
=$PCP_BINADM_DIR/pmsignal
17 status
=1 # failure is the default!
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
24 pmstore sample.control
-1 > /dev
/null
25 $sudo $signal -a -s HUP pmcd
33 $PCP_AWK_PROG -v expected
=$tmp.expected
-v debug
=$debug -v tolerance
=$tolerance -v num_samples
=$num_samples -v mismatch_limit
=$mismatch_limit '
42 sts = getline val < expected;
44 print "Read expected value:", val;
46 print "Error: error in reading expected value";
48 print "Error: eof encountered in reading expected value";
51 # ignore the first one
56 print "Comparing:", val, $1
58 if (debug) print "match";
60 else if ((val-tolerance) <= $1 && $1 <= (val+tolerance)) {
61 if (debug) print "match";
65 if (debug) print "match";
68 print "Missing wrap !";
69 print "Got ", $1, " instead";
75 if (debug || mismatch_limit==0)
76 print "mismatch: ", $1, val;
80 if (i < num_samples) {
81 print "Did not process enough samples";
82 print "Processed:", i, "expected:", num_samples;
84 if (mismatch > mismatch_limit) {
85 print "Too many mismatches";
86 print "Number of mismatches = ", mismatch;
89 print "Enough Matched ok";
100 $PCP_AWK_PROG -v expected
=$tmp.expected
-v debug
=$debug -v tolerance
=$tolerance -v num_samples
=$num_samples -v mismatch_limit
=$mismatch_limit '
107 sts = getline val < expected;
109 print "Read expected value:", val;
111 print "Error: error in reading expected value";
113 print "Error: eof encountered in reading expected value";
118 # ignore the first one
122 print "Comparing:", val, $1
124 if (debug) print "match";
126 else if ((val-tolerance) <= $1 && $1 <= (val+tolerance)) {
127 if (debug) print "match";
129 else if ($1 == "?" ){
130 print "Error: no wrapping allowed";
135 if (debug || mismatch_limit == 0)
136 print "mismatch: ", $1, val;
140 if (i < num_samples) {
141 print "Did not process enough samples";
142 print "Processed:", i, "expected:", num_samples;
144 if (mismatch > mismatch_limit) {
145 print "Too many mismatches";
146 print "Number of mismatches = ", mismatch;
149 print "Enough Matched ok";
158 pmval
-s$num_samples sample.wrap.
$_metric |
164 unset PCP_COUNTER_WRAP
165 echo "--- Wrapping OFF ---"
171 export PCP_COUNTER_WRAP
172 echo "--- Wrapping ON ---"
175 # real QA test starts here
179 tolerance
="0.15e+09" # implies error of about 0.15 second
180 mismatch_limit
=1 # allow 1 mismatch
182 # src/wrap_int -n $num_samples >$tmp.expected
183 cat << 'End-of-File' >$tmp.expected
197 echo "--- Testing pmval ---"
198 echo "--- Testing pmval ---" >> $seq.full
201 _test_pmval
$metric | _check_wrap_off
203 echo "-----------------------" >> $seq.full
204 _test_pmval
$metric | _check_wrap_on