3 # Exercise pmlogger behaviour when it loses pmcd connection
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard filters
16 signal
=$PCP_BINADM_DIR/pmsignal
18 status
=1 # failure is the default!
22 sed -e '/myFetch: End of File: PMCD exited/d' \
23 -e '/pmlogger: Error: IPC protocol failure/d'
26 trap "$sudo rm -f $tmp.*; exit \$status" 0 1 2 3 15
27 $sudo rm -f $tmp.
* $seq.full
29 # real QA test starts here
30 echo "=== empty config and _no_ -L, should exit immediately ===" |
tee -a $here/$seq.full
32 pmlogger
-c /dev
/null
-l $tmp.log
$tmp &
34 echo "expect no pmlogger process ..."
35 ps
$PCP_PS_ALL_FLAGS |
$PCP_AWK_PROG '$2 == "'$
!'" { print }'
36 _filter_pmlogger_log
<$tmp.log |
sed -e "s/$host/HOST/"
38 echo |
tee -a $here/$seq.full
39 echo "=== empty config and -L, no reconnect and no exit ===" |
tee -a $here/$seq.full
41 _start_up_pmlogger
-L -c /dev
/null
-l $tmp.log
$tmp
42 _wait_for_pmlogger
$pid $tmp.log
5
43 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
45 echo "expect pmlogger process ..."
46 ps
$PCP_PS_ALL_FLAGS |
$PCP_AWK_PROG '$2 == "'$pid'" { print "OK"}'
47 _filter_pmlogger_log
<$tmp.log |
sed -e "s/$host/HOST/"
48 $sudo $signal -s TERM
$pid
50 echo |
tee -a $here/$seq.full
51 echo "=== non-empty config, reconnect when pmcd restarted ===" |
tee -a $here/$seq.full
53 echo "log mandatory on 1 sec pmcd.version" >$tmp.config
54 _start_up_pmlogger
-c $tmp.config
-l $tmp.log
$tmp
55 _wait_for_pmlogger
$pid $tmp.log
5
56 echo "pid=$pid" >>$here/$seq.full
57 ps
$PCP_PS_ALL_FLAGS |
grep pmlogger
>>$here/$seq.full
58 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
60 echo "expect pmlogger process ..." |
tee -a $here/$seq.full
61 ps
$PCP_PS_ALL_FLAGS \
63 |
tee -a $here/$seq.full \
64 |
$PCP_AWK_PROG '$2 == "'$pid'" { print "OK"}'
65 _filter_pmlogger_log
<$tmp.log | _filter |
sed -e "s/$host/HOST/"
66 $sudo $signal -s TERM
$pid
68 echo "pmlogger log file ..." >>$here/$seq.full
69 cat $tmp.log
>>$here/$seq.full
70 echo "expect one mark record ..."
71 pmdumplog
-M $tmp |
grep '<mark>' |
wc -l