pmrep: update TODO, man page
[pcp.git] / qa / 315
blob14789b0917598e4e89d331a8af8d7ebe081a9384
1 #! /bin/sh
2 # PCP QA Test No. 315
3 # exercise pmie log compression thru pmie_daily
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
6 # Portions Copyright (c) 2007 Aconex. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
13 . ./common.product
14 . ./common.filter
16 _cleanup()
18 [ -d $tmp.distdir ] && rm -fr $tmp.distdir
19 [ -d $tmp.relaydir ] && rm -fr $tmp.relaydir
20 rm -f $tmp.*
23 status=1 # failure is the default!
24 trap "_cleanup; exit \$status" 0 1 2 3 15
26 # create test control file, directories and populate with dummy logfiles
27 cat >$tmp.ctl<<EOF
28 \$version=1.1
29 #Host S? logfile args
30 dist.engr n $tmp.distdir/pmie.log -c config.default
31 relay.engr n $tmp.relaydir/pmie.log -c config.default
32 EOF
34 mkdir -p $tmp.distdir $tmp.relaydir
36 # some logfiles for today...
37 TODAY=`pmdate %Y%m%d`
38 cp $tmp.ctl $tmp.distdir/pmie.log.$TODAY
39 cp $tmp.ctl $tmp.relaydir/pmie.log.$TODAY
41 # some logfiles for five days ago...
42 FIVEDAYS=`pmdate -5d %Y%m%d`
43 cp $tmp.ctl $tmp.distdir/pmie.log.$FIVEDAYS
44 cp $tmp.ctl $tmp.relaydir/pmie.log.$FIVEDAYS
46 # some logfiles for five months ago...
47 FIVEMONTHS=`pmdate -5m %Y%m%d`
48 cp $tmp.ctl $tmp.distdir/pmie.log.$FIVEMONTHS
49 cp $tmp.ctl $tmp.relaydir/pmie.log.$FIVEMONTHS
51 # real QA test starts here
53 # "Error: ..." and "... unchanged" lines will only appear if pmie_daily
54 # thinks pmie is "chkconfig on" ... and this is not guaranteed for the
55 # QA platform, so cull 'em
56 # Similarly the + rm -f TMP/pmie/<pid> lines come from defunct pmie
57 # processes that don't have anything to do with this QA test
59 pmie_daily -V -N -x 3 -X compress -c $tmp.ctl -l $tmp.log
60 cat $tmp.log | \
61 sed \
62 -e '/Error: no pmie instance running/d' \
63 -e '/inference engine for host .* unchanged/d' \
64 -e "s/$TODAY/TODAY/g" \
65 -e "s/$FIVEDAYS/FIVEDAYS/g" \
66 -e "s/$FIVEMONTHS/FIVEMONTHS/g" \
67 -e "s,$PCP_TMP_DIR,TMP,g" \
68 -e "s/$seq-$$/SEQ-PID/g" \
69 -e "s;/private/;/;g" \
70 -e "s,/tmp,TMP,g" \
71 -e '/^+ rm -f TMP\/pmie\/[0-9][0-9]*$/d' \
73 # success, all done
74 status=0
75 exit