/var/lib/pcp/testsuite/182 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 | #! /bin/sh
# PCP QA Test No. 182
# pmlogger gets SIGPIPE if pmlc goes away unexpectedly
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard filters
. ./common.product
. ./common.filter
. ./common.check
signal=$PCP_BINADM_DIR/pmsignal
trap "$sudo rm -f $tmp.*; $sudo $signal -s TERM \$pid; exit" 0 1 2 3 15
# just like the kill builtin, just do it quietly
_silent_kill()
{
if [ $# -eq 1 ]
then
(( $sudo $signal $1 )&) >/dev/null 2>&1
else
echo "_silent_kill: needs 1 arg, not $#"
fi
}
_filter_date()
{
sed <$1 \
-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] .. /MONTH-DAY /' \
-e 's/[0-9][0-9]:[0-9][0-9]:[0-9][0-9] /TIME /' \
-e 's/ [12][0-9][0-9][0-9]/ YEAR/'
}
_filter_errs()
{
_filter_pmlogger_log \
| sed \
-e '/^MONTH-/d' \
-e '/Error: do_control:/d'
}
# real QA test starts here
_start_up_pmlogger -L -c /dev/null -l $tmp.log $tmp
_wait_for_pmlogger $pid $tmp.log 10
cat <<End-of-File >$tmp.cmd
pmlc <<E-O-F >>$tmp.out
connect $pid
query kernel
query kernel
E-O-F
End-of-File
for i in 1 2 3
do
echo "=== start and abort pmlc ==="
echo >>$tmp.out
echo "=== iteration $i ===" >>$tmp.out
( sh $tmp.cmd & eval echo '$!' >$tmp.pid ) &
pmsleep 2.5
pmlc_pid=`cat $tmp.pid`
[ ! -z "$pmlc_pid" ] && _silent_kill $pmlc_pid
pmsleep 1.1
have=`ps $PCP_PS_ALL_FLAGS | $PCP_AWK_PROG '$2 == '"$pmlc_pid"' { print }' \
| wc -l | sed -e 's/ *//g'`
echo "$have pmlc processes are running"
[ $have -gt 0 ] && ps $PCP_PS_ALL_FLAGS | grep pmlc | grep -v grep
# ready to accept again on the socket?
#
pmsleep 2.5
done
echo
echo "=== pmlogger log ==="
_filter_date $tmp.log | _filter_errs
# for debugging
#
cp $tmp.out $seq.full
exit 0
|