3 # For pv #581025, pv #589006
9 #1 - try on already running pmcd
11 #2 - pmcd not running at all
12 #3 - pmcd running but taking too long to get around to
13 # accepting connections
15 #4 - delta = X, have pmcd dead for X-1 seconds
16 #5 - delta = X, have pmcd dead for X+1 seconds
18 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
22 echo "QA output created by $seq"
24 # get standard filters
29 status
=1 # failure is the default!
30 trap "_cleanup; exit \$status" 0 1 2 3 15
35 # _change_config pmlogger on
36 _start
>/dev
/null
2>&1
46 |
sed -e '/^$PCP_RC_DIR\/pmlogger: pmlogger not running/d'
51 sed -e "s/$host/LOCALHOST/g" -e "s/local:/LOCALHOST/g"
56 echo "restart @ `date` ..." >>$seq.full
57 $sudo $PCP_RC_DIR/pcp restart
>$tmp.start.out
58 echo "restart log @ `date` ..." >>$seq.full
59 cat $tmp.start.out
>>$seq.full
64 echo "stop @ `date`..." >>$seq.full
65 $sudo $PCP_RC_DIR/pcp stop
>$tmp.stop.out
66 echo "stop log @ `date` ..." >>$seq.full
67 cat $tmp.stop.out
>>$seq.full
70 # real QA test starts here
72 # _change_config pmlogger off
80 echo "*** test 1 ***" |
tee -a $seq.full
83 if pmcd_wait
-v 2>$tmp.err
86 echo "pmcd_wait succeeded as expected for running pmcd"
89 _wait_filter
< $tmp.err
91 _filter
<$tmp.start.out
93 echo "*** test 2 ***" |
tee -a $seq.full
96 if pmcd_wait
-v -t $delta 2>$tmp.err
99 echo "ERROR: pmcd_wait should not have succeeded !" |
tee -a $seq.full
102 _wait_filter
< $tmp.err
104 echo "pmcd_wait failed as expected for dead pmcd"
107 _filter
<$tmp.stop.out
109 echo "*** test 4 ***" |
tee -a $seq.full
113 ( sleep $pre_delta; _start
; touch $tmp.
done ) &
114 if pmcd_wait
-v -t $delta 2>$tmp.err
117 echo "pmcd_wait succeeded as expected for sleeping pmcd - under timeout"
121 echo "ERROR: pmcd_wait should have succeeded !" |
tee -a $seq.full
123 _wait_filter
< $tmp.err
126 # Need to wait until _start is _really_ done and pmcd.log has been
130 [ -f $tmp.
done ] && break
133 if [ ! -f $tmp.
done ]
135 echo "Arrgh @ `date` ... _start is really dragging the chain ... check $seq.full" |
tee -a $seq.full
140 _filter
<$tmp.stop.out \
141 |
sed -e '/pmlogger not running/d'
142 _filter
<$tmp.start.out
144 echo "*** test 5 ***" |
tee -a $seq.full
147 (sleep $post_delta; _start
) &
149 if pmcd_wait
-v -t $delta 2>$tmp.err
152 echo "ERROR: pmcd_wait should not have succeeded !" |
tee -a $seq.full
155 _wait_filter
< $tmp.err
157 echo "pmcd_wait failed as expected for sleeping pmcd - over timeout"
160 _filter
<$tmp.stop.out \
161 |
sed -e '/pmlogger not running/d'
162 _filter
<$tmp.start.out
164 wait $pid # for background processs, "pcp start" to finish