3 # Exercise the Nginx PMDA Install/Remove, as well as the
4 # mechanism by which a PMDA can be installed with no pmcd
7 # Copyright (c) 2015 Red Hat.
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
18 [ -f $PCP_PMDAS_DIR/nginx
/pmdanginx.pl
] || _notrun
"nginx pmda not installed"
20 perl
-e "use PCP::PMDA" >/dev
/null
2>&1
21 [ $?
-eq 0 ] || _notrun
"perl PCP::PMDA module not installed"
23 status
=1 # failure is the default!
24 $sudo rm -rf $tmp.
* $seq.full
25 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
27 # real QA test starts here
30 # cull message resulting from no running nginx daemon
31 grep -v 'Information not currently available'
37 echo "=== remove nginx agent ==="
38 $sudo .
/Remove
>$tmp.out
2>&1
39 _filter_pmda_remove
<$tmp.out
44 # start from known starting points
45 cd $PCP_PMDAS_DIR/nginx
46 $sudo .
/Remove
>/dev
/null
2>&1
47 $sudo $PCP_RC_DIR/pmcd stop
2>&1 | _filter_pcp_stop
50 echo "=== nginx agent installation ==="
51 $sudo .
/Install
</dev
/null
>$tmp.out
2>&1
52 cat $tmp.out
>>$here/$seq.full
53 # Check nginx metrics have appeared ... X metrics and Y values
54 _filter_pmda_install
<$tmp.out \
56 -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/' \
57 -e 's/[0-9][0-9]* warnings, //' \
59 /Check nginx metrics have appeared/ { if ($7 >= 7) $7 = "X"
60 if ($10 >= 7 || $10 == 0) $10 = "Y"
66 trap "_cleanup_pmda nginx; exit \$status" 0 1 2 3 15
68 # real QA test starts here
71 # there may be a race if the pmda has a bit of a slow start ... pause
75 # pmcd should have been started by the Install process - check
76 if pminfo
-v nginx
> $tmp.info
2> $tmp.err
80 echo "... failed! ... here is the Install log ..."
83 cat $tmp.info
$tmp.err | _filter_nginx