File: 754

package info (click to toggle)
pcp 7.0.5-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,916 kB
  • sloc: ansic: 1,478,844; sh: 177,285; xml: 160,462; cpp: 83,809; python: 24,349; perl: 18,303; yacc: 6,877; lex: 2,864; makefile: 2,694; awk: 165; fortran: 60; java: 52
file content (70 lines) | stat: -rwxr-xr-x 1,600 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
# PCP QA Test No. 754
# Exercise the Unbound PMDA.
#
# Copyright (c) 2014-2015 Red Hat.
#

seq=`basename $0`
echo "QA output created by $seq"

. ./common.python

python_path=`which $python`
pmda_path="$PCP_PMDAS_DIR/unbound"
pmda_script="$pmda_path/pmdaunbound.python"
test -f "$pmda_script" || _notrun "pmdaunbound not supported"
$python -c "from pcp import pmda" >/dev/null 2>&1
[ $? -eq 0 ] || _notrun "python pcp pmda module not installed"

_cleanup()
{
    cd $here
    rm -rf $tmp.*
    $sudo rm -f /tmp/unbound-qa.txt	# from test.sh
    $sudo rm -f unbound.log*
}

status=1	# failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15

_filter()
{
    tee -a $seq_full | \
    sed \
	-e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
	-e '/pmResult/s/ .* numpmid/ ... numpmid/' \
	-e '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/s/[^ ]*/TIMESTAMP/' \
	-e "s;$python_path;\$PCP_PYTHON_PROG;" \
	-e "s;$python_basename;python;" \
    #end
}

_filter_result()
{
    _filter | _filter_dumpresult
}

domain=132
test="$here/unbound"
$sudo rm -f unbound.log* /tmp/unbound-qa.txt	 # the latter from test.sh
export UNBOUND_STATS="$here/unbound/test.sh"

# real QA test starts here
PCP_PYTHON_PMNS=root $python "$pmda_script" > $tmp.root

echo "== Testing unbound metric values" | tee -a $seq_full
cat > $tmp.fetch <<End-of-File
open pipe $python_path $pmda_script
getdesc on
End-of-File
cat $here/unbound/metrics.list | \
while read metric
do
    echo fetch $metric >> $tmp.fetch
done
dbpmda -n $tmp.root -ie < $tmp.fetch 2>&1 | _filter
test -f unbound.log && cat unbound.log >> $seq_full

status=0
exit