qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 564
blobea25c976311e9fa09df96b5a1a9b0d101d99b25e
1 #! /bin/sh
2 # PCP QA Test No. 564
3 # exercise archive compression thru pmlogger_daily
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
15 _cleanup()
17 [ -d $tmp.distdir ] && rm -fr $tmp.distdir
18 [ -d $tmp.relaydir ] && rm -fr $tmp.relaydir
19 $sudo rm -f $tmp.*
22 status=1 # failure is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
25 # create test control file, directories and populate with dummy archives
26 cat >$tmp.ctl<<EOF
27 \$version=1.1
28 #Host P? S? directory args
29 dist.engr n n $tmp.distdir -c config.default
30 relay.engr n n $tmp.relaydir -c config.default
31 EOF
33 mkdir -p $tmp.distdir $tmp.relaydir
35 # some archives for today...
36 TODAY=`pmdate %Y%m%d.0`
37 cp $tmp.ctl $tmp.distdir/$TODAY.0
38 cp $tmp.ctl $tmp.distdir/$TODAY.meta
39 cp $tmp.ctl $tmp.distdir/$TODAY.index
40 cp $tmp.ctl $tmp.relaydir/$TODAY.0
41 cp $tmp.ctl $tmp.relaydir/$TODAY.meta
42 cp $tmp.ctl $tmp.relaydir/$TODAY.index
44 # some archives for a five days ago...
45 FIVEDAYS=`pmdate -5d %Y%m%d.0`
46 cp $tmp.ctl $tmp.distdir/$FIVEDAYS.0
47 cp $tmp.ctl $tmp.distdir/$FIVEDAYS.meta
48 cp $tmp.ctl $tmp.distdir/$FIVEDAYS.index
49 cp $tmp.ctl $tmp.relaydir/$FIVEDAYS.0
50 cp $tmp.ctl $tmp.relaydir/$FIVEDAYS.1
51 cp $tmp.ctl $tmp.relaydir/$FIVEDAYS.meta
52 cp $tmp.ctl $tmp.relaydir/$FIVEDAYS.index
53 cp $tmp.ctl $tmp.relaydir/mumble
54 cp $tmp.ctl $tmp.relaydir/mumble.0
55 STAMP=`pmdate -5d %Y%m%d`0010
56 touch -t "$STAMP" $tmp.*/$FIVEDAYS.* $tmp.relaydir/mumble*
58 # some archives for five months ago...
59 FIVEMONTHS=`pmdate -5m %Y%m%d.0`
60 cp $tmp.ctl $tmp.distdir/$FIVEMONTHS.0
61 cp $tmp.ctl $tmp.distdir/$FIVEMONTHS.meta
62 cp $tmp.ctl $tmp.distdir/$FIVEMONTHS.index
63 cp $tmp.ctl $tmp.relaydir/$FIVEMONTHS.0
64 cp $tmp.ctl $tmp.relaydir/$FIVEMONTHS.meta
65 cp $tmp.ctl $tmp.relaydir/$FIVEMONTHS.index
66 STAMP=`pmdate -5m %Y%m%d`0010
67 touch -t "$STAMP" $tmp.*/$FIVEMONTHS.*
69 # real QA test starts here
70 $sudo $PCP_BINADM_DIR/pmlogger_daily -V -N -x 3 -X bzip2 -c $tmp.ctl -l $tmp.log
71 $sudo cat $tmp.log | \
72 sed \
73 -e '/NOTICES/d' \
74 -e "s/$TODAY/TODAY/g" \
75 -e "s/$FIVEDAYS/FIVEDAYS/g" \
76 -e "s/$FIVEMONTHS/FIVEMONTHS/g" \
77 -e "s/$seq-$$/SEQ-PID/g" \
78 -e '/Warning: no archives found to merge/d' \
79 -e "s;/private/;/;g" \
80 -e "s,$PCP_TMP_DIR,TMP,g" \
81 -e "s,/var/tmp,TMP,g" \
82 -e "s,/tmp,TMP,g" \
84 # success, all done
85 status=0
86 exit