/var/lib/pcp/testsuite/895 is in pcp-testsuite 4.0.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | #!/bin/sh
# PCP QA Test No. 895
# pmlogger SIGINT badness
#
# https://github.com/performancecopilot/pcp/issues/116
#
# Copyright (c) 2016 Ken McDonell. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
status=1 # failure is the default!
$sudo rm -rf $tmp $tmp.* $seq.full
trap "cd $here; $sudo rm -rf $tmp $tmp.*; exit \$status" 0 1 2 3 15
cat <<End-of-File >$tmp.config
log mandatory on 50 msec {
cgroup
containers
disk
event
filesys
hinv
ipc
jbd2
kernel
mem
mmv
network
nfs
nfs3
nfs4
pmcd
pmda
quota
rpc
swap
swapdev
sysfs
tmpfs
vfs
xfs
}
End-of-File
# some of these metrics are not available on some platforms ...
#
case $PCP_PLATFORM
in
darwin)
sed <$tmp.config >$tmp.tmp \
-e '/ cgroup$/d' \
-e '/ ipc$/d' \
-e '/ jbd2$/d' \
-e '/ nfs$/d' \
-e '/ nfs4$/d' \
-e '/ quota$/d' \
-e '/ swap$/d' \
-e '/ swapdev$/d' \
-e '/ sysfs$/d' \
-e '/ tmpfs$/d' \
-e '/ vfs$/d' \
-e '/ xfs$/d' \
# end
mv $tmp.tmp $tmp.config
;;
esac
_filter()
{
cat \
| tee -a $here/$seq.full \
| sed \
-e '/re-established connection/d' \
-e '/pduread: .* Interrupted system call/d' \
-e '/Validating metrics/d' \
-e '/^Log for pmlogger /s/ on .*/ .../' \
-e '/^preprocessor cmd:/s/: .*/: .../' \
-e '/^Starting logger/s/".*/.../' \
-e '/} logged every/s/: .*/: .../' \
-e "s@$tmp@TMP@" \
-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATE/' \
-e 's/DATE [0-9][0-9][0-9][0-9]/DATE/' \
-e 's/pmlogger([0-9][0-9]*)/pmlogger(PID)/' \
| $PCP_AWK_PROG '
BEGIN { state = 0 }
$1 == "Group" { print "Group ... {"; state = 1; next }
state == 1 && $1 == "}" { print " ..."; state = 0 }
state == 0 { print }'
}
# real QA test starts here
export PCP_DERIVED_CONFIG=
pmlogger -h localhost -r -c $tmp.config -m qa_$seq -l $tmp.log $tmp &
pid=$!
pmsleep 6
kill -INT $pid
wait
_filter <$tmp.log
# without timeouts, expect 6sec * 1000 * 5 fetch groups / 50msec = 600 records
#
max_nrec=600
min_nrec=200
nrec=`pmdumplog $tmp | grep '^[0-9]' | grep -v '<mark>' | wc -l | sed -e 's/ //g'`
echo "nrec=$nrec" >>$here/$seq.full
if [ "$nrec" -ge $min_nrec -a "$nrec" -le $max_nrec ]
then
echo "OK, between $min_nrec and $max_nrec archive records"
else
echo "oops, $nrec archive records not between the expected range of $min_nrec and $max_nrec"
fi
# success, all done
status=0
exit
|