qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 754
blobf3a5a783e29dcd6be0b63ba495e91f5a6e8e2fc4
1 #!/bin/sh
2 # PCP QA Test No. 754
3 # Exercise the Unbound PMDA.
5 # Copyright (c) 2014-2015 Red Hat.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 . ./common.python
13 python_path=`which $python`
14 pmda_path="$PCP_PMDAS_DIR/unbound"
15 pmda_script="$pmda_path/pmdaunbound.python"
16 test -f "$pmda_script" || _notrun "pmdaunbound not supported"
17 $python -c "from pcp import pmda" >/dev/null 2>&1
18 [ $? -eq 0 ] || _notrun "python pcp pmda module not installed"
20 _cleanup()
22 cd $here
23 rm -rf $tmp.*
24 $sudo rm -f /tmp/unbound-qa.txt # from test.sh
27 status=1 # failure is the default!
28 $sudo rm -rf $tmp.* $seq.full
29 trap "_cleanup; exit \$status" 0 1 2 3 15
31 _filter()
33 tee -a $seq.full | \
34 sed \
35 -e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
36 -e '/pmResult/s/ .* numpmid/ ... numpmid/' \
37 -e '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/s/[^ ]*/TIMESTAMP/' \
38 -e "s;$python_path;\$PCP_PYTHON_PROG;" \
39 -e "s;$python;python;" \
40 #end
43 _filter_result()
45 _filter | _filter_dumpresult
48 domain=132
49 test="$here/unbound"
50 $sudo rm -f unbound.log /tmp/unbound-qa.txt # the latter from test.sh
51 export UNBOUND_STATS="$here/unbound/test.sh"
53 # real QA test starts here
54 PCP_PYTHON_PMNS=root $python "$pmda_script" > $tmp.root
56 echo "== Testing unbound metric values" | tee -a $seq.full
57 cat > $tmp.fetch <<End-of-File
58 open pipe $python_path $pmda_script
59 getdesc on
60 End-of-File
61 cat $here/unbound/metrics.list | \
62 while read metric
64 echo fetch $metric >> $tmp.fetch
65 done
66 dbpmda -n $tmp.root -ie < $tmp.fetch 2>&1 | _filter
67 test -f unbound.log && cat unbound.log >> $seq.full
69 status=0
70 exit