qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 376
blob1ed336b7376d0978e9cc03ec5351d0f4a99439a3
1 #! /bin/sh
2 # PCP QA Test No. 376
3 # libpcp_trace
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.filter
15 . ./common.check
17 [ -f $PCP_PMDAS_DIR/trace/pmdatrace ] || _notrun "trace pmda not installed"
19 _cleanup()
21 cd $here
22 rm -f $tmp.*
23 if [ -n "$savedtracehost" ]
24 then
25 PCP_TRACE_HOST=$savedtracehost; export PCP_TRACE_HOST
27 if $_needclean
28 then
29 if $install_on_cleanup
30 then
31 ( cd $PCP_PMDAS_DIR/trace; $sudo ./Install </dev/null >/dev/null 2>&1 )
32 else
33 ( cd $PCP_PMDAS_DIR/trace; $sudo ./Remove </dev/null >/dev/null 2>&1 )
35 _needclean=false
37 exit $status
40 install_on_cleanup=false
41 pminfo trace >/dev/null 2>&1 && install_on_cleanup=true
43 status=1 # failure is the default!
44 _needclean=true
45 trap "_cleanup" 0 1 2 3 15
47 if [ -n "$PCP_TRACE_HOST" ]
48 then
49 savedtracehost=$PCP_TRACE_HOST; unset PCP_TRACE_HOST
52 qahost=`hostname`
54 _filter_trace_install()
56 # some warnings are *expected* - no trace values yet
57 _filter_pmda_install | sed \
58 -e "s/$qahost/HOSTNAME/g" \
59 -e 's/ *[0-9]+ warnings,//g'
62 _tracefilter()
64 sed -e 's/^000:.*/[PDU BUFFER]/g' \
65 -e 's/from=[0-9].*/from=[PID]/g' \
66 -e 's/ free pdubuf.*/[FREE PDUBUF]/g' \
67 -e 's/^\[[0-9]*]/[PID]/g' \
68 -e 's/__pmtracefindPDUbuf.*/[FIND PDUBUF]/g' \
69 -e 's/ fd=[0-9][0-9]*/ fd=<n>/g'
72 # real QA test starts here
73 cd $PCP_PMDAS_DIR/trace
74 $sudo ./Install -R / < /dev/null 2>&1 | _filter_trace_install
75 _wait_for_pmcd
76 cd $here
78 for i in 1 2 3 4
80 src/tstate $i 2>&1 | _tracefilter
81 sts=$?
82 if [ $sts -ne 0 ]
83 then
84 echo "=== Error: state check #$i failed ==="
85 status=1
87 done
89 # success, all done
90 status=0
91 exit