Drop unused condition check
[pcp.git] / qa / 398
bloba0f6a0d47fa1506767c4976d1283c737e8883194
1 #! /bin/sh
2 # PCP QA Test No. 398
3 # checks pmcd handling empty $PCP_PMCDCONF_PATH
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard filters
12 . ./common.product
13 . ./common.check
14 . ./common.filter
16 signal=$PCP_BINADM_DIR/pmsignal
17 status=1 # failure is the default!
19 _cleanup()
21 _restore_config $PCP_PMCDCONF_PATH
22 $sudo rm -f $tmp.*
23 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
24 _wait_for_pmcd
25 _wait_for_pmlogger
28 _check()
30 # try to provoke a core
31 pminfo -v irix >/dev/null 2>&1
32 sleep 5
34 $sudo touch $PCP_PMCDLOG_PATH
35 grep -i "dumping to core" $PCP_PMCDLOG_PATH
36 sts=$?
37 if [ "`echo $PCP_LOG_DIR/core*`" != "$PCP_LOG_DIR/core*" -o "`echo $PCP_LOG_DIR/pmcd/core*`" != "$PCP_LOG_DIR/pmcd/core*" -o $sts -eq 0 ]
38 then
39 echo "=== core found or logfile claims dumping to core! ==="
40 echo '=== Here is $PCP_PMCDLOG_PATH ==='
41 cat $PCP_PMCDLOG_PATH
42 exit
43 else
44 echo '--- No core file at $PCP_LOG_DIR/core or $PCP_LOG_DIR/pmcd/core ---'
48 trap "_cleanup; exit \$status" 0 1 2 3 15
51 # real QA test starts here
53 # terminate any pmcds and get rid of core file to get to a sane starting place
54 $sudo $PCP_RC_DIR/pcp stop >/dev/null 2>&1
55 $sudo rm -f $PCP_LOG_DIR/core* $PCP_LOG_DIR/pmcd/core* $PCP_PMCDLOG_PATH
57 _check
59 # empty pmcd.conf
60 _save_config $PCP_PMCDCONF_PATH
61 $sudo cp /dev/null $PCP_PMCDCONF_PATH
63 # should be empty
64 echo "--- pmcd.conf contents follow ---"
65 cat $PCP_PMCDCONF_PATH
66 $sudo $PCP_RC_DIR/pcp restart 2>&1 \
67 | _filter_pcp_start \
68 | fgrep -v "Waiting for PMCD to terminate" \
69 | fgrep -v "pmcd_wait failed:"
71 echo "Waiting for PMCD ..."
72 pmcd_wait -t 5sec
73 if [ $? -ne 2 ]
74 then
75 echo "Expected timeout - got status $? from pmcd_wait!"
76 else
77 echo "Connection timed out as expected"
80 echo "Checking for core file ..."
81 _check
83 # success, all done
84 status=0
85 exit