/var/lib/pcp/testsuite/295 is in pcp-testsuite 3.8.12ubuntu1.
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 | #! /bin/sh
# PCP QA Test No. 295
# verify pmproxy cleans up correctly when clients are terminated
#
# Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
which pmproxy >/dev/null 2>&1 || _notrun "No pmproxy binary installed"
rm -f $seq.out
if [ $PCP_VER -ge 3806 ]
then
ln $seq.out.2 $seq.out
else
ln $seq.out.1 $seq.out
fi
signal=$PCP_BINADM_DIR/pmsignal
status=0 # success is the default!
username=`id -u -n`
$sudo rm -rf $tmp.*
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
_cleanup()
{
$sudo $signal -a pmproxy >/dev/null 2>&1
$sudo $PCP_RC_DIR/pmproxy restart >/dev/null 2>&1
}
_filter_pmproxy()
{
sed \
-e '/^__pmSetSocketIPC: fd=/d' \
-e '/^__pmSetDataIPC:/d' \
-e '/^__pmDataIPC: /d' \
-e '/^IPC table fd/d' \
}
_check()
{
echo "`grep AcceptNewClient $tmp.log | wc -l | sed -e 's/ *//g'` connects"
echo "`grep DeleteClient $tmp.log | wc -l | sed -e 's/ *//g'` disconnects"
}
$sudo $PCP_RC_DIR/pmproxy stop >/dev/null 2>&1
$sudo $signal -a pmproxy >/dev/null 2>&1
proxyargs="-Dcontext"
id pcp >/dev/null 2>&1 && proxyargs="$proxyargs -U $username"
$PCP_BINADM_DIR/pmproxy $proxyargs -l $tmp.log 2>&1 | _filter_pmproxy
PMPROXY_HOST=localhost
export PMPROXY_HOST
# real QA test starts here
pidlist=`sh -c "pmval -h $PMPROXY_HOST hinv.ncpu >$tmp.1 2>&1 & echo \\\$!"`
pid=`sh -c "pmstat -h $PMPROXY_HOST >$tmp.2 2>&1 & echo \\\$!"`
pidlist="$pidlist $pid"
echo "kernel.all.load;" >$tmp.in
pid=`sh -c "pmie -v -h $PMPROXY_HOST -c $tmp.in >$tmp.3 2>&1 & echo \\\$!"`
pidlist="$pidlist $pid"
sleep 3
echo all clients started
echo "expect 4 connects and 1 disconnect, thanks to pmie"
_check
for pid in $pidlist
do
echo
echo "kill off a client ..."
$signal -s KILL $pid
sleep 1
_check
done
echo "pmval output ..." >$seq.full
cat $tmp.1 >>$seq.full
echo >>$seq.full
echo "pmstat output ..." >>$seq.full
cat $tmp.2 >>$seq.full
echo >>$seq.full
echo "pmie output ..." >>$seq.full
cat $tmp.3 >>$seq.full
# success, all done
exit
|