3 # verify pmproxy cleans up correctly when clients are terminated
5 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 which pmproxy
>/dev
/null
2>&1 || _notrun
"No pmproxy binary installed"
20 signal
=$PCP_BINADM_DIR/pmsignal
21 status
=0 # success is the default!
24 trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
28 $sudo $signal -a pmproxy
>/dev
/null
2>&1
29 $sudo $PCP_RC_DIR/pmproxy restart
>/dev
/null
2>&1
35 -e '/^__pmSetSocketIPC: fd=/d' \
36 -e '/^__pmSetDataIPC:/d' \
37 -e '/^__pmDataIPC: /d' \
38 -e '/^IPC table fd/d' \
44 connects
=`grep AcceptNewClient $tmp.log | wc -l | sed -e 's/ *//g'`
45 disconnects
=`grep DeleteClient $tmp.log | wc -l | sed -e 's/ *//g'`
46 difference
=$
(($connects - $disconnects))
48 echo "N-$difference disconnects"
49 echo "--- $tmp.log ---" >>$here/$seq.full
50 cat $tmp.log
>>$here/$seq.full
51 echo "--- end $tmp.log ---" >>$here/$seq.full
54 $sudo $PCP_RC_DIR/pmproxy stop
>/dev
/null
2>&1
55 $sudo $signal -a pmproxy
>/dev
/null
2>&1
58 id pcp
>/dev
/null
2>&1 && proxyargs
="$proxyargs -U $username"
59 $PCP_BINADM_DIR/pmproxy
$proxyargs -l $tmp.log
2>&1 | _filter_pmproxy
61 PMPROXY_HOST
=localhost
64 # real QA test starts here
65 pidlist
=`sh -c "pmval -h $PMPROXY_HOST hinv.ncpu >$tmp.1 2>&1 & echo \\\$!"`
66 echo "pmval pid=$pidlist" >>$here/$seq.full
67 pid
=`sh -c "pmstat -h $PMPROXY_HOST >$tmp.2 2>&1 & echo \\\$!"`
68 echo "pmstat pid=$pid" >>$here/$seq.full
69 pidlist
="$pidlist $pid"
70 echo "kernel.all.load;" >$tmp.
in
71 pid
=`sh -c "pmie -v -h $PMPROXY_HOST -c $tmp.in >$tmp.3 2>&1 & echo \\\$!"`
72 echo "pmie pid=$pid" >>$here/$seq.full
73 pidlist
="$pidlist $pid"
77 echo all clients started
78 echo "expect N connects and N-3 disconnect, thanks to pmie"
84 echo "kill off a client ..."
85 echo "kill off client pid=$pid" >>$here/$seq.full
91 echo "pmval output ..." >>$here/$seq.full
92 cat $tmp.1 >>$here/$seq.full
93 echo >>$here/$seq.full
94 echo "pmstat output ..." >>$here/$seq.full
95 cat $tmp.2 >>$here/$seq.full
96 echo >>$here/$seq.full
97 echo "pmie output ..." >>$here/$seq.full
98 cat $tmp.3 >>$here/$seq.full