3 # Better code coverage for libpcp/src/logutil.c
5 # Copyright (c) 2010 Ken McDonell. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard filters
16 status
=0 # success is the default!
17 $sudo rm -rf $tmp.
* $seq.full
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20 # __pmLogChkLabel: fd=3 vol=0 [magic=50052602 version=2 vol=0 pid=3901 host=bozo]
21 # __pmLogSetTime(0) 17:29:20.472 delta=0 at ti[0]@17:29:20.472 vol=0 posn=132 serial=1
25 -e 's/pid=[0-9][0-9]*/pid=PID/' \
26 -e 's/host=[a-zA-Z][a-zA-Z0-9_]*/host=HOST/' \
27 -e 's/[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9]/TIME/g' \
28 -e 's/TIME (t=[0-9][0-9.]*)/TIME/g' \
29 -e 's/bad trailer len=132/bad trailer len=0/' \
30 -e '/__pmLogChkLabel/s/fd=[0-9]/fd=N/' \
32 $1 == "__pmLogOpen:" { print >"'$tmp'.0"; next }
33 { print >"'$tmp'.1" }'
34 LC_COLLATE
=POSIX
sort $tmp.0
38 # real QA test starts here
39 for i
in archives
/badlen-
*.0
41 [ "$i" = "archives/badlen-0.0" ] && continue
42 i
=`echo $i | sed -e 's/\.0$//'`
43 echo |
tee -a $seq.full
44 echo "--- $i ---" |
tee -a $seq.full
45 pmdumplog
-Dlog $i 2>&1 \