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.
13 echo "QA output created by $seq"
15 # get standard environment, filters and checks
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
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
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
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
64 sar2pcp
$safile $pcplog > $tmp.out
2>&1
67 if grep 'Invalid system activity file' $tmp.out
>/dev
/null
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
74 elif grep 'mismatched tag at line .*/TokeParser.pm' $tmp.out
>/dev
/null
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
86 echo "sar2pcp thinks $safile is going well so far"
87 logcheck
$safile $pcplog
89 echo "sar2pcp failed ..."