qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 292
blob8c83d9b54f5eb5b2cd0e9106c5df57266534e9ff
1 #! /bin/sh
2 # PCP QA Test No. 292
3 # duplicate/alias base name resolution by pmlogger_check
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 _filter()
18 sed \
19 -e '/host:/s/ [^ ].*/ HOST/' \
20 -e '/start:/s/ [^ ].*/ DATE/' \
21 -e '/end:/s/ [^ ].*/ DATE/' \
22 -e 's/^..:..:..\..../TIMESTAMP /' \
23 -e "s/^TIMESTAMP *$debug$/TIMESTAMP DEBUG/g"
26 _cleanup()
28 if [ ! -f $tmp.cleanup ]
29 then
30 $signal -a -s TERM pmlogger >/dev/null 2>&1
31 $sudo $PCP_BINADM_DIR/pmlogger_check
32 _wait_for_pmlogger
33 touch $tmp.cleanup
37 signal="$sudo $PCP_BINADM_DIR/pmsignal"
38 status=0 # success is the default!
39 trap "_cleanup; cd $here; $sudo rm -rf $tmp $tmp.*; exit \$status" 0 1 2 3 15
41 debug=`pmprobe -v pmcd.control.debug | $PCP_AWK_PROG '{ print $3 }'`
43 rm -rf $tmp
44 mkdir $tmp
45 chmod ugo+w $tmp
46 cd $tmp
48 echo >control '# PCP archive logging configuration/control - for qa/'$seq'
50 $version=1.1
51 LOCALHOSTNAME n n '`pwd`' -c ./config'
53 echo "log mandatory on once pmcd.control.debug" >config
55 touch pmcheck.log
56 chmod ugo+w pmcheck.log
58 # real QA test starts here
59 echo "start pmlogger ..."
60 $sudo $PCP_BINADM_DIR/pmlogger_check -V -c control >>pmcheck.log 2>&1
62 for i in 1 2 3 4
64 echo "kill and restart pmlogger ..."
65 $signal -a -s TERM pmlogger
66 $sudo $PCP_BINADM_DIR/pmlogger_check -V -c control >>pmcheck.log 2>&1
67 done
68 $signal -a -s TERM pmlogger
70 echo
71 echo "Checking ..."
72 for seq in 00 01
74 if [ "`echo *-$seq.index`" != "*-$seq.index" ]
75 then
76 echo "Found at least one \"-$seq\" suffix"
77 else
78 echo "No \"-$seq\" suffix found!"
79 status=1
81 done
83 if [ $status = 1 ]
84 then
85 echo
86 echo "Hmm ... this is what we got"
87 ls -l
88 echo "=== pmlogger.log==="
89 cat pmlogger.log
90 echo "=== pmcheck.log==="
91 cat pmcheck.log
94 echo
95 echo "merge 'em together ..."
96 $sudo $PCP_BINADM_DIR/pmlogextract *.0 out
97 pmval -U out pmcd.control.debug | _filter
99 exit