1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/bin/sh
# PCP QA Test No. 438
# Better code coverage for libpcp/src/logutil.c
#
# Copyright (c) 2010 Ken McDonell. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard filters
. ./common.product
. ./common.filter
. ./common.check
status=0 # success is the default!
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
# older version ...
# __pmLogChkLabel: fd=3 vol=0 [magic=50052602 version=2 vol=0 pid=3901 host=bozo]
# PCP 6.0 or later ...
# __pmLogChkLabel: fd=3 vol=0 [magic=0x50052603 version=3 vol=0 pid=2422889 start=15:23:53.120655741 features=0x80000001 "QA bit_00" host=bozo-vm.localdomain tz=AEDT-11 zoneinfo=:Australia/Melbourne]
#
# __pmLogSetTime(0) 17:29:20.472 delta=0 at ti[0]@17:29:20.472 vol=0 posn=132 serial=1
_filter()
{
sed \
-e 's/]/ ]/g' \
-e 's/pid=[0-9][0-9]*/pid=PID/' \
-e 's/host=[a-zA-Z][a-zA-Z0-9_]*/host=HOST/' \
-e 's/tz=[^ ]*/tz=TZ/' \
-e 's/[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9]*[0-9]/TIME/g' \
-e 's/TIME (t=[0-9][0-9.]*)/TIME/g' \
-e 's/bad trailer len=132/bad trailer len=0/' \
-e '/__pmLogChkLabel/s/fd=[0-9]/fd=N/' \
-e '/^__pmFopen/s/\.[^"]*",/.SUFFIX",/' \
-e 's/ ]/]/g' \
| $PCP_AWK_PROG '
$1 == "__pmLogFindOpen:" { print >"'$tmp'.0"; next }
{ print >"'$tmp'.1" }'
LC_COLLATE=POSIX sort $tmp.0
cat $tmp.1
}
# real QA test starts here
for i in badarchives/badlen-*.0
do
[ "$i" = "badarchives/badlen-0.0" ] && continue
i=`echo $i | sed -e 's/\.0$//'`
echo | tee -a $seq_full
echo "--- $i ---" | tee -a $seq_full
pmdumplog -Dlog $i 2>&1 \
| tee -a $seq_full \
| _filter
done
# success, all done
exit
|