qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 511
blob49497f9c3498e9b1a7916c6b4b7b177ff023f933
1 #!/bin/sh
2 # PCP QA Test No. 511
4 # Exercise sar2pcp for RH BZ 859117
5 # This may prove too optimistic (asking sadf to replay different sar
6 # files, that sar generated ... backwards compatibility much?) - if
7 # thats the case, we'll have to special case things.
9 # Copyright (c) 2012 Red Hat.
12 seq=`basename $0`
13 echo "QA output created by $seq"
15 # get standard environment, filters and checks
16 . ./common.product
17 . ./common.filter
18 . ./common.check
20 which sadf >/dev/null 2>&1 || _notrun "sadf not installed (sysstat package)"
21 which sar2pcp >/dev/null 2>&1 || _notrun "sar2pcp not installed"
22 [ $PCP_VER -ge 30610 ] || _notrun "Installed sar2pcp is too old"
24 status=1 # failure is the default!
25 $sudo rm -rf $tmp.* $seq.full
26 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
28 logcheck()
30 safile="$1"
31 pcplog="$2"
33 # should be no errors/warnings and pcp tools should also not fail
34 pmdumplog -z -l $pcplog >>$seq.full
35 [ $? -eq 0 ] && echo "pmdumplog approved of the $safile conversion"
37 # this'll visit and examine in detail every single stored result,
38 # as well as all metadata associates with the generated archive.
39 pmlogsummary $pcplog >>$seq.full
40 [ $? -eq 0 ] && echo "pmlogsummary approved of the $safile conversion"
43 # backwards compatibility route - silence is golden
44 silence()
46 safile="$1"
47 echo "sar2pcp thinks $safile is going well so far"
48 echo "pmdumplog approved of the $safile conversion"
49 echo "pmlogsummary approved of the $safile conversion"
52 # real QA test starts here
53 cd $here
54 rm -f $seq.full
56 for sadist in \
57 859117-rhel5.bin 859117-rhel5.xml f16-sa20.bin \
58 fche-csb6-rhel6.bin fche-csb6-rhel6.xml \
59 rhel5-sa20.bin smash-rhel5.xml smash-rhel6.xml
61 safile="sadist/$sadist"
62 echo "==> Checking $safile" | tee -a $seq.full
63 pcplog=$tmp.pcplog
64 sar2pcp $safile $pcplog > $tmp.out 2>&1
65 sts=$?
67 if grep 'Invalid system activity file' $tmp.out >/dev/null
68 then
69 # this seems to be a common sadf fail message;
70 # happens when the installed sysutils is old:
72 echo "$safile is not parsable by the installed sysutils" >>$seq.full
73 silence $safile
74 elif grep 'mismatched tag at line .*/TokeParser.pm' $tmp.out >/dev/null
75 then
76 # for sadf 10.0.2 on Gentoo 2.0.3 (vm05) the generate xml
77 # is bad as it containts <timestamp .../> ... </timestamp>
78 # instead of <timestamp ...> ... </timestamp>
80 echo "sadf generates bad XML for $safile" >>$seq.full
81 sadf -x $safile -- -A | nl -ba | grep timestamp >>$seq.full
82 silence $safile
83 else
84 if [ $sts -eq 0 ]
85 then
86 echo "sar2pcp thinks $safile is going well so far"
87 logcheck $safile $pcplog
88 else
89 echo "sar2pcp failed ..."
90 cat $tmp.out
93 rm -f $tmp.pcplog.*
94 done
96 # success, all done
97 status=0
98 exit