3 # Exercise the postfix PMDA.
5 # Copyright (c) 2015 Red Hat. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 [ -f "$PCP_PMDAS_DIR/postfix/pmdapostfix.pl" ] || _notrun
"No postfix PMDA"
18 if which qshape
>/dev
/null
2>&1
22 # not on the $PATH, but qshape is hiding on SuSE platforms
24 [ -f /usr
/share
/doc
/packages
/postfix-doc
/auxiliary
/qshape
/qshape.pl
] \
25 || _notrun
"No qshape binary installed"
28 status
=1 # failure is the default!
29 $sudo rm -rf $tmp.
* $seq.full
31 # prepare the PMDAs test environment
32 cp $here/postfix
/qshape.sh
$tmp.qshape
36 freebsd|netbsd|openbsd
)
40 $sudo chown root
:$grp $tmp.qshape
41 $sudo chmod 755 $tmp.qshape
44 export PMDA_POSTFIX_LOG
=$tmp.logfile
45 export PMDA_POSTFIX_REFRESH
=1
46 export PMDA_POSTFIX_QSHAPE
=$tmp.qshape
50 echo |
tee -a $here/$seq.full
51 echo "=== remove postfix agent ===" |
tee -a $here/$seq.full
52 $sudo .
/Remove
>$tmp.out
2>&1
53 cat $tmp.out
>>$here/$seq.full
54 _filter_pmda_remove
<$tmp.out
59 # start from known starting points
60 cd $PCP_PMDAS_DIR/postfix
61 $sudo .
/Remove
>/dev
/null
2>&1
62 $sudo $PCP_RC_DIR/pmcd stop
2>&1 | _filter_pcp_stop
64 echo |
tee -a $here/$seq.full
65 echo "=== postfix agent installation ===" |
tee -a $here/$seq.full
66 $sudo .
/Install
</dev
/null
>$tmp.out
2>&1
67 cat $tmp.out
>>$here/$seq.full
68 # Check postfix metrics have appeared ... X metrics and Y values
69 _filter_pmda_install
<$tmp.out \
71 -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/' \
72 -e 's/[0-9][0-9]* warnings, //' \
74 /Check postfix metrics have appeared/ { if ($7 >= 7) $7 = "X"
75 if ($10 >= 50) $10 = "Y"
81 trap "_cleanup_pmda postfix; exit \$status" 0 1 2 3 15
83 # real QA test starts here
86 metrics
=`pminfo postfix | LC_COLLATE=POSIX sort`
88 for file in $here/postfix
/*-log-*gz
91 logfile
=`basename $file`
92 gunzip
< $file > $tmp.logfile
94 echo "=== verify postfix values - $logfile ===" |
tee -a $here/$seq.full
96 echo "=== done ===" |
tee -a $here/$seq.full
97 echo |
tee -a $here/$seq.full
99 $sudo rm -f $tmp.logfile
$tmp.qshape
101 echo "PMDA log file ..." >>$here/$seq.full
102 $sudo cat $PCP_LOG_DIR/pmcd
/postfix.log
>>$here/$seq.full