3 # Exercise the Unbound PMDA.
5 # Copyright (c) 2014-2015 Red Hat.
9 echo "QA output created by $seq"
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"
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
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;" \
45 _filter | _filter_dumpresult
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
61 cat $here/unbound
/metrics.list | \
64 echo fetch
$metric >> $tmp.fetch
66 dbpmda
-n $tmp.root
-ie < $tmp.fetch
2>&1 | _filter
67 test -f unbound.log
&& cat unbound.log
>> $seq.full