qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 336
blob9cd9d482814e636624c80dd81eeeccc46932beeb
1 #! /bin/sh
2 # PCP QA Test No. 336
3 # exercise a libpcp_trace problem
5 # Copyright (c) 2015 Red Hat.
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard filters
13 . ./common.product
14 . ./common.check
15 . ./common.filter
17 [ -f $PCP_PMDAS_DIR/trace/pmdatrace ] || _notrun "trace pmda not installed"
19 signal=$PCP_BINADM_DIR/pmsignal
20 status=1 # failure is the default!
21 LOCALHOST=`hostname`
22 _needclean=true
24 if [ -n "$PCP_TRACE_HOST" ]
25 then
26 savedtracehost=$PCP_TRACE_HOST; unset PCP_TRACE_HOST
29 _interrupt()
31 status=1
34 if [ -d $PCP_LOG_DIR/pmlogger ]
35 then
36 LOGGING_DIR=$PCP_LOG_DIR/pmlogger
37 else
38 LOGGING_DIR=$PCP_LOG_DIR
41 _cleanup()
43 cd $here
44 if $_needclean
45 then
46 pmafm $LOGGING_DIR/$LOCALHOST/Latest remove >$tmp.cmd 2>&1 \
47 && $sudo sh $tmp.cmd
48 _change_config pmlogger on
49 $sudo cp /tmp/$seq.dir/pmcd.conf $PCP_PMCDCONF_PATH
50 $sudo cp /tmp/$seq.dir/root $PCP_VAR_DIR/pmns/root
51 rm -rf /tmp/$seq.dir
52 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
53 _wait_for_pmcd
54 _wait_for_pmlogger
55 _needclean=false
57 if [ -n "$savedtracehost" ]
58 then
59 PCP_TRACE_HOST=$savedtracehost; export PCP_TRACE_HOST
61 rm -f $tmp.*
62 exit $status
65 # save pcp setup
66 mkdir /tmp/$seq.dir
67 cp $PCP_PMCDCONF_PATH /tmp/$seq.dir
68 cp $PCP_VAR_DIR/pmns/root /tmp/$seq.dir
70 _change_config pmlogger off
72 trap "_cleanup" 0
73 trap "_interrupt; _cleanup" 1 2 3 15
75 pminfo trace >/dev/null 2>&1
76 remove=$?
78 # real QA test starts here
80 echo "=== Checking pmtrace without a PMDA listening ==="
81 cd $PCP_PMDAS_DIR/trace
82 $sudo ./Remove >/dev/null 2>&1
83 # use a bigger hammer
84 $sudo $signal -a -s KILL pmdatrace > /dev/null 2>&1
86 # Should produce a PMDA connect error ...
87 pmtrace -h $LOCALHOST -q -v 1.1 foo
89 if [ $remove -ne 1 ]
90 then
91 $sudo $PCP_PMDAS_DIR/trace/Install < /dev/null > /dev/null 2>&1
94 # success, all done
95 status=0
96 exit