pmrep: update TODO, man page
[pcp.git] / qa / 759
blob9a2e8b8ca04eb1da903e0e971b6c3fc3ab853ac5
1 #!/bin/sh
2 # PCP QA Test No. 759
3 # Exercise the Unbound PMDA installation and removal.
5 # Copyright (c) 2014 Red Hat.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 test -e $PCP_PMDAS_DIR/unbound || _notrun "unbound PMDA not installed"
17 if which unbound-control >/dev/null 2>&1
18 then
20 else
21 _notrun "unbound-control not installed"
24 status=1 # failure is the default!
25 $sudo rm -rf $tmp.* $seq.full
27 unbound_remove()
29 echo
30 echo "=== remove unbound agent ==="
31 sudo ./Remove >$tmp.out 2>&1
32 _filter_pmda_remove <$tmp.out
35 unbound_install()
37 # start from known starting points
38 cd $PCP_PMDAS_DIR/unbound
39 $sudo ./Remove >/dev/null 2>&1
41 echo
42 echo "=== $iam agent installation ==="
43 $sudo ./Install </dev/null >$tmp.out 2>&1
44 # Check unbound metrics have appeared ... X metrics and Y values
45 _filter_pmda_install <$tmp.out \
46 | sed \
47 -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/' \
48 | $PCP_AWK_PROG '
49 /Check unbound metrics have appeared/ { if ($7 >= 100) $7 = "X"
50 if ($10 >= 100) $10 = "Y"
52 { print }'
55 unbound_cleanup()
57 _cleanup_pmda unbound
60 _prepare_pmda unbound
61 trap "unbound_cleanup; exit \$status" 0 1 2 3 15
63 _filter_unbound()
65 # filter metric values for deterministic output
66 tee -a $here/$seq.full | sed \
67 -e 's/value [0-9][0-9]*/value NUMBER/'
70 # real QA test starts here
71 unbound_install
73 # pmdaunbound should have been started by the Install process - check
74 if pminfo -v unbound > $tmp.info 2> $tmp.err
75 then
77 else
78 echo "... failed! ... here is the Install log ..."
79 cat $tmp.out
81 cat $tmp.info $tmp.err | _filter_unbound
83 # Check that the correct metrics are present
84 pminfo unbound
86 unbound_remove
87 # success, all done
88 status=0
89 exit