qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 417
blob3d55425d88551d623ce1e606c4ff39d47fd97552
1 #! /bin/sh
2 # PCP QA Test No. 417
3 # Exercise tools with a corrupted archive
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 filters
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 status=1 # failure is the default!
17 trap "cd $here; rm -rf $tmp; rm -f $tmp.*; exit \$status" 0 1 2 3 15
19 _check_core()
21 if [ "`echo core*`" != "core*" ]
22 then
23 $PCP_ECHO_PROG $PCP_ECHO_N "Dumped core! (saved in $here as""$PCP_ECHO_C"
24 for c in core*
26 $sudo mv $c $here/$seq.$c
27 $PCP_ECHO_PROG $PCP_ECHO_N " $seq.$c""$PCP_ECHO_C"
28 done
29 echo ")"
33 rm -rf $tmp
34 mkdir $tmp
35 cd $tmp
37 # make the corrupted archive
38 arch=archives/bigace_v2
39 cp $here/$arch.meta bad.meta
40 dd ibs=1 count=512 if=$here/$arch.index of=bad.index 2>/dev/null
41 dd ibs=1 count=512 if=$here/$arch.index >>bad.index 2>/dev/null
42 dd if=$here/$arch.0 ibs=1 count=2052 of=bad.0 2>/dev/null
43 dd if=/dev/zero ibs=1 count=1024 >>bad.0 2>/dev/null
45 # deal with an annoying libc error ... using TZ=:Australia/Melbourne
46 # causes the -z option to report the wrong time, at least for some
47 # times of the year
49 export TZ=EST-10
51 # real QA test starts here
53 echo
54 echo "=== pminfo ==="
55 pminfo -O0 -n $here/archives/bigace.pmns -a bad >$tmp.out 2>$tmp.err
56 cat $tmp.err $tmp.out
57 _check_core
59 echo
60 echo "=== pminfo -f irix ==="
61 pminfo -O0 -n $here/archives/bigace.pmns -a bad -f irix
62 _check_core
64 echo
65 echo "=== pmdumplog -t ==="
66 pmdumplog -n $here/archives/bigace.pmns -z -t bad
67 _check_core
69 echo
70 echo "=== pmdumplog -t, no index ==="
71 mv bad.index save.index
72 pmdumplog -n $here/archives/bigace.pmns -z -t bad
73 mv save.index bad.index
74 _check_core
76 echo
77 echo "=== pmdumplog -l ==="
78 pmdumplog -n $here/archives/bigace.pmns -z -l bad
79 _check_core
81 echo
82 echo "=== pmdumplog -L ==="
83 pmdumplog -n $here/archives/bigace.pmns -z -L bad
84 _check_core
86 echo
87 echo "=== pmdumplog -m ==="
88 pmdumplog -n $here/archives/bigace.pmns -z -m bad >$tmp.out 2>$tmp.err
89 cat $tmp.err $tmp.out
90 _check_core
92 echo
93 echo "=== pmlogsummary ==="
94 pmlogsummary -n $here/archives/bigace.pmns bad >$tmp.out 2>$tmp.err
95 cat $tmp.err $tmp.out | sed -e 's/^\*//g'
96 _check_core
98 # success, all done
99 status=0
100 exit