qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 243
blob3c8de37bcd5a2464aa1a6b15f6b92cb40e02eacd
1 #! /bin/sh
2 # PCP QA Test No. 243
3 # Multiple PMCDs test
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.filter
14 . ./common.check
16 rm -f $seq.out
17 _get_libpcp_config
18 if $ipv6 ; then
19 ln $seq.out.ipv6 $seq.out || exit 1
20 else
21 ln $seq.out.nonipv6 $seq.out || exit 1
24 _filter_err()
26 _filter_pmcd_log \
27 | sed \
28 -e 's/ __pmBind: / bind: /g' \
29 -e 's/may already be running/is already running/g' \
30 -e '/Log for pmcd/,/INADDR_ANY/c\
31 ... boring stuff deleted' \
32 -e '/ok FD 44321 ipv6 INADDR_ANY/d' \
33 -e '/OpenRequestSocket.*unix.*bind: Address already in use/,+1 d' \
34 -e 's/ INADDR_ANY/ 0x0/g'
37 signal=$PCP_BINADM_DIR/pmsignal
38 _needclean=true
40 rm -rf $tmp
41 mkdir $tmp
42 chmod ugo+rwx $tmp
43 cd $tmp
45 cleanup()
47 cd $here
48 if $_needclean
49 then
50 _needclean=false
51 $signal -s TERM $my_pmcd_pid
52 pmsleep 1.5
53 unset PMCD_SOCKET
54 echo "Restart and ping pmcd ..."
55 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
56 _wait_for_pmcd
57 _wait_for_pmlogger
58 pmprobe pmcd.control.debug
60 rm -rf $tmp
63 status=1
64 trap "cleanup; exit \$status" 0 1 2 3 15
66 # real QA test starts here
67 $sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
69 # Note: start pmcd with -f so that its PID stays the same (no daemon)
71 export PMCD_SOCKET=$tmp/pmcd.socket
72 $PCP_PMCD_PROG -f -x err1 &
73 my_pmcd_pid=$!
75 _wait_for_pmcd
77 echo "Checking for startup errors ..."
78 [ -f err1 ] && _filter_err <err1
80 # Try to start another pmcd. This should fail because the socket is already in
81 # use. Make sure that there are no changes to the log file
83 if [ -f pmcd.log ]
84 then
85 cp pmcd.log pmcd.log.$$
86 else
87 echo "No pmcd.log, pmcd failed to start!"
88 exit
91 echo
92 echo "Trying to start another PMCD over the top of the first one."
93 echo "Expect \"bind: Address already in use\"...:"
94 $PCP_PMCD_PROG -f -x err2 2>&1 | _filter_err &
95 pmsleep 2.5
97 echo "Checking for startup errors ..."
98 [ -f err2 ] && _filter_err <err2
100 echo "Checking that log hasn't changed ..."
101 diff pmcd.log pmcd.log.$$
103 status=$?