qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 033
blob0a7c81104611196096e6c37f102b127961169bf4
1 #! /bin/sh
2 # PCP QA Test No. 033
3 # check filesys metrics for root fs
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 [ $PCP_PLATFORM = solaris ] && _notrun "No filesys metrics for Solaris"
18 rm -f $seq.out
19 if [ $PCP_PLATFORM = irix ]
20 then
21 ln $seq.out.2 $seq.out
22 elif [ $PCP_PLATFORM = darwin ]
23 then
24 ln $seq.out.4 $seq.out
25 else
26 # assume linux-like
28 if [ $PCP_EOE_VER -ge 20300 ]
29 then
30 if pmprobe filesys.readonly >/dev/null
31 then
32 ln $seq.out.3 $seq.out
33 else
34 ln $seq.out.1 $seq.out
36 else
37 ln $seq.out.0 $seq.out
41 status=1 # failure is the default
42 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
43 rm -f $seq.full
45 # real QA test starts here
46 root=`df / | $PCP_AWK_PROG 'NR == 2 { print $1 }'`
47 echo "root=$root" >>$seq.full
48 if [ -z "$root" ]
49 then
50 echo "Arrgh, cannot get device for root fs from df(1) ..."
51 df /
52 exit
54 if [ -L "$root" ]
55 then
56 if which realpath >/dev/null 2>&1
57 then
58 symroot=`realpath $root`
59 else
60 symroot=`ls -l $root | sed -e 's/.*-> //'`
61 if [ -z "$symroot" ]
62 then
63 echo "Arrgh, cannot get symlink for device for root fs ..."
64 ls -l $root
65 exit
67 case "$symroot"
69 ../*)
70 # handle case like ...
71 # /dev/disk/by-uuid/467793a8-5191-4940-90fb-38a6f28b035d -> ../../sda1
72 dir=`dirname $root`
73 while true
75 case "$symroot"
77 ../*)
78 dir=`echo $dir | sed -e 's@/[^/]*$@@'`
79 symroot=`echo $symroot | sed -e 's@\.\./\([^.]\)@\1@'`
82 symroot=${dir}/${symroot}
83 break
85 esac
86 done
88 esac
90 else
91 symroot="$root"
93 echo "symroot=$symroot" >>$seq.full
94 pminfo -f filesys \
95 | egrep "(^filesys)|\"$root\"|/dev/root|$symroot\"" \
96 | _filter_dumpresult 2>&1 > $tmp.out
98 cat $tmp.out
100 status=0
101 exit