pmrep: further zbxsend python3 fixes
[pcp.git] / qa / 755
blobc4b9c2b8032ba5a31293e3d4f17dd3f70fb3641b
1 #!/bin/sh
2 # PCP QA Test No. 755
3 # Exercise the Apache PMDA Install/Remove, as well as the
4 # mechanism by which a PMDA can be installed with no pmcd
5 # process running.
7 # Copyright (c) 2014-2015 Red Hat.
10 seq=`basename $0`
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
14 . ./common.product
15 . ./common.filter
16 . ./common.check
18 [ -f $PCP_PMDAS_DIR/apache/pmdaapache ] || _notrun "apache pmda not installed"
20 status=1 # failure is the default!
21 $sudo rm -rf $tmp.* $seq.full
23 _filter_apache()
25 # cull message resulting from no running httpd
26 grep -v 'Information not currently available'
29 pmdaapache_remove()
31 echo
32 echo "=== remove apache agent ==="
33 $sudo ./Remove >$tmp.out 2>&1
34 _filter_pmda_remove <$tmp.out
37 pmdaapache_install()
39 # start from known starting points
40 cd $PCP_PMDAS_DIR/apache
41 $sudo ./Remove >/dev/null 2>&1
42 $sudo $PCP_RC_DIR/pmcd stop 2>&1 | _filter_pcp_stop
44 echo
45 echo "=== apache agent installation ==="
46 $sudo ./Install </dev/null >$tmp.out 2>&1
47 cat $tmp.out >>$here/$seq.full
48 # Check apache metrics have appeared ... X metrics and Y values
49 _filter_pmda_install <$tmp.out \
50 | sed \
51 -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/' \
52 -e 's/[0-9][0-9]* warnings, //' \
53 | $PCP_AWK_PROG '
54 /Check apache metrics have appeared/ { if ($7 >= 20 && $7 <= 80) $7 = "X"
55 if ($10 >= 0 && $10 <= 80) $10 = "Y"
57 { print }'
60 _prepare_pmda apache
61 trap "_cleanup_pmda apache; exit \$status" 0 1 2 3 15
63 # real QA test starts here
64 pmdaapache_install
66 # there may be a race if the pmda has a bit of a slow start ... pause
68 sleep 3
70 # pmcd should have been started by the Install process - check
71 if pminfo -v apache > $tmp.info 2> $tmp.err
72 then
74 else
75 echo "... failed! ... here is the Install log ..."
76 cat $tmp.out
78 cat $tmp.info $tmp.err | _filter_apache
80 pmdaapache_remove
81 status=0
82 exit