3 # pmlogrewrite - error cases
5 # Copyright (c) 2011 Ken McDonell. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 which pmlogrewrite
>/dev
/null
2>&1 || _notrun
"pmlogrewrite not installed"
18 status
=0 # success is the default!
19 $sudo rm -rf $tmp.
* $seq.full
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
26 -e "s/^\([+-][+-][+-] TMP\...t*\).*/\1/" \
27 -e '/pmResult dump/s/from .* numpmid/... numpmid/'
32 pmdumplog
-z -a $1 |
tee -a $seq.full
>$tmp.
in
33 pmdumplog
-z -a $2 |
tee -a $seq.full
>$tmp.out
34 echo "pmdumplog diffs ..."
35 diff -u $tmp.
in $tmp.out | _filter
42 echo "Arrgh ... cannot find $1.0"
47 echo "Arrgh ... cannot find $2.0"
50 pmval
-z -U $1 $3 2>$tmp.err |
tee -a $seq.full |
sed -e 's/ */ /g' >$tmp.
in
51 cat $tmp.err
>>$seq.full
52 cat $tmp.err
>>$tmp.
in
53 pmval
-z -U $2 $3 2>$tmp.err |
tee -a $seq.full |
sed -e 's/ */ /g' >$tmp.out
54 cat $tmp.err
>>$seq.full
55 cat $tmp.err
>>$tmp.out
56 echo "pmval diffs ..."
57 diff -u $tmp.
in $tmp.out | _filter
60 # real QA test starts here
61 sed -e '/^#/d' <<End-of-File | while read arch_args spec
62 # archive[|arg1[|arg2[|...]]] spec
64 archives/sample_expr metric sample.scale_step.time_up_secs { type -> string }
65 archives/sample_expr metric pmcd.pmlogger.host { type -> U32 }
66 archives/kenj-pc-2 metric sample.wrap.longlong { type -> U32 }
67 archives/kenj-pc-2 metric sample.wrap.ulonglong { type -> 64 }
70 echo |
tee -a $seq.full
71 echo "$spec" >$tmp.config
72 echo "=== `cat $tmp.config` ===" |
tee -a $seq.full
74 pmlogrewrite
-w -c $tmp.config
`echo $arch_args | sed -e 's/|/ /g'` $tmp.new
2>&1 | _filter
77 _cmp
`echo $arch_args | sed -e 's/|.*//'` $tmp.new
82 echo "=== overflow in type conversion - step 1 (no errors) ==="
83 echo "metric sample.drift { units->1,0,-1,MBYTE,0,0 type->U64 }" >$tmp.config
85 pmlogrewrite
-w -c $tmp.config archives
/mirage
$tmp.tmp
2>&1 | _filter
86 _cmp2 archives
/mirage
$tmp.tmp sample.drift
87 echo "=== overflow in type conversion - step 2 (expect error) ==="
88 echo "metric sample.drift { units->1,0,-1,BYTE,0,1 type->32 }" >$tmp.config
90 pmlogrewrite
-Dvalue -dsw -c $tmp.config
$tmp.tmp
$tmp.new
2>&1 | _filter
91 _cmp2
$tmp.tmp
$tmp.new sample.drift