/var/lib/pcp/testsuite/297 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 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 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | #! /bin/sh
# PCP QA Test No. 297
# exercise pmproxy and client reconnect
#
# 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 pmdumptext >/dev/null 2>&1 || \
_notrun "No pmdumptext binary installed"
which pmproxy >/dev/null 2>&1 || \
_notrun "No pmproxy binary installed"
PMCDLOG=$PCP_LOG_DIR/pmcd/pmcd.log
status=0 # success is the default!
signal=$PCP_BINADM_DIR/pmsignal
killpid=""
username=`id -u -n`
$sudo rm -rf $tmp.*
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
_cleanup()
{
[ -n "$killpid" ] && $signal $killpid
$sudo $signal -a pmproxy >/dev/null 2>&1
$sudo $PCP_RC_DIR/pmproxy restart >/dev/null 2>&1
}
realname=`hostname`
chopname=`echo $realname | sed -e 's/\..*//'`
_filter()
{
sed \
-e '/^pmWhichContext/d' \
-e '/^pmUseContext/d' \
-e '/^pmNewZone/d' \
-e '/^pmUseZone/d' \
-e '/^__pmFdLookup/d' \
-e '/^__pmDecodeXtendError/d' \
-e '/^__pmAddIPC/d' \
-e '/^__pmSendCreds/d' \
-e '/^IPC table/d' \
-e '/^__pmConnectPMCD.* failed/d' \
-e '/^__pmConnect(fd=[0-9][0-9]*(nsprFd=/d' \
-e '/^__pmConnectPMCD/{
s/'$realname'/MY_HOST/g
s/localhost\.localdomain/MY_HOST/g
s/localhost/MY_HOST/g
s/'$chopname'/MY_HOST/g
s/[0-9][0-9]*/N/g
}' \
-e '/^pmReconnectContext.* failed/d' \
-e '/^pmReconnectContext.* too soon/d' \
-e '/^pmNewContext/{
s/'$realname'/MY_HOST/g
s/'$chopname'/MY_HOST/g
}' \
-e '/^Context\[/{
s/'$realname'/MY_HOST/g
s/'$chopname'/MY_HOST/g
s/[0-9][0-9]*/N/g
}' \
-e '/^[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]/{
# pmdumptext
s//DATE/
s/ [0-9][0-9.]*/ N/g
}' \
| _filter_pmproxy | uniq
}
_filter_pmproxy()
{
sed -e '/^__pmSetSocketIPC: fd=/d' \
-e '/^__pmSetDataIPC: fd=/d' \
-e '/^__pmDataIPC: fd=/d' \
-e '/^IPC table fd/d' \
-e '/^__pmSetVersionIPC: fd=/d'
}
$sudo $PCP_RC_DIR/pmproxy stop >/dev/null 2>&1
$sudo $signal -a pmproxy >/dev/null 2>&1
export PMCD_RECONNECT_TIMEOUT=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
export PMPROXY_HOST=localhost
# real QA test starts here
pmdumptext -Dcontext -t 0.5 sample.bin >$tmp.out 2>&1 &
killpid=$!
# don't need to confuse pmproxy or pmcd ...
#
unset PMPROXY_HOST
sleep 3
echo "killing pmproxy ..."
$signal -a pmproxy >/dev/null 2>&1
sleep 2
echo "1st pmproxy log" >$seq.full
cat $tmp.log >>$seq.full
echo "re-starting pmproxy ..."
$PCP_BINADM_DIR/pmproxy $proxyargs -l $tmp.log 2>&1 | _filter_pmproxy
sleep 4
echo "killing pmcd ..."
$sudo $PCP_RC_DIR/pcp stop >/dev/null 2>&1
sleep 2
echo >>$seq.full
echo "1st pmcd log" >>$seq.full
cat $PMCDLOG >>$seq.full
echo "re-starting pmcd ..."
$sudo $PCP_RC_DIR/pcp restart >/dev/null 2>&1
sleep 4
echo >>$seq.full
echo "2nd pmproxy log" >>$seq.full
cat $tmp.log >>$seq.full
echo >>$seq.full
echo "2nd pmcd log" >>$seq.full
cat $PMCDLOG >>$seq.full
echo >>$seq.full
echo "pmdumptext output" >>$seq.full
cat $tmp.out >>$seq.full
_filter <$tmp.out
# success, all done
exit
|