2 #-----------------------------------------------------------------------
3 # Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 # Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
20 # Mountain View, CA 94043, USA, or: http://www.sgi.com
21 #-----------------------------------------------------------------------
27 export MOUNT_OPTIONS=$XFS_MOUNT_OPTIONS
30 export MOUNT_OPTIONS=$UDF_MOUNT_OPTIONS
33 export MOUNT_OPTIONS=$NFS_MOUNT_OPTIONS
44 export MKFS_OPTIONS=$XFS_MKFS_OPTIONS
47 [ ! -z "$udf_fsize" ] && \
48 UDF_MKFS_OPTIONS="$UDF_MKFS_OPTIONS -s $udf_fsize"
49 export MKFS_OPTIONS=$UDF_MKFS_OPTIONS
52 export MKFS_OPTIONS=$NFS_MKFS_OPTIONS
59 [ -z "$FSTYP" ] && FSTYP=xfs
60 [ -z "$MOUNT_OPTIONS" ] && _mount_opts
61 [ -z "$MKFS_OPTIONS" ] && _mkfs_opts
64 # we need common.config
65 if ! . ./common.config
67 echo "$iam: failed to source common.config"
71 # make sure we have a standard umask
84 if [ $FSTYP != "xfs" ]; then
90 [ "$HOSTOS" != "IRIX" ] && SCRATCH_OPTIONS="$SCRATCH_OPTIONS -f"
99 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
100 SCRATCH_OPTIONS="$SCRATCH_OPTIONS ${rt_opt}rtdev=$SCRATCH_RTDEV"
101 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
102 SCRATCH_OPTIONS="$SCRATCH_OPTIONS ${log_opt}logdev=$SCRATCH_LOGDEV"
110 if [ $FSTYP != "xfs" ]; then
124 [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ] && \
125 TEST_OPTIONS="$TEST_OPTIONS ${rt_opt}rtdev=$TEST_RTDEV"
126 [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
127 TEST_OPTIONS="$TEST_OPTIONS ${log_opt}logdev=$TEST_LOGDEV"
130 _scratch_mount_options()
132 _scratch_options mount
133 echo $SCRATCH_OPTIONS $MOUNT_OPTIONS $* $SCRATCH_DEV $SCRATCH_MNT
138 _mount -t $FSTYP `_scratch_mount_options $*`
144 _mount -t $FSTYP $TEST_OPTIONS $MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR
147 _scratch_mkfs_options()
149 _scratch_options mkfs
150 echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV
155 _scratch_options mkfs
157 $MKFS_XFS_PROG $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV
160 if [ "$USE_BIG_LOOPFS" = yes ]; then
161 [ -z "$RETAIN_AG_BYTES" ] && RETAIN_AG_BYTES=0
162 ./tools/ag-wipe -q -r $RETAIN_AG_BYTES $SCRATCH_DEV
178 $MKFS_UDF_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
181 /sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
186 _scratch_xfs_db_options()
189 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
190 SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
191 echo $SCRATCH_OPTIONS $* $SCRATCH_DEV
194 _scratch_xfs_logprint()
197 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
198 SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
199 $XFS_LOGPRINT_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
202 _scratch_xfs_repair()
205 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
206 SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
207 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
208 SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -r$SCRATCH_RTDEV"
209 [ "$USE_BIG_LOOPFS" = yes ] && SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -t"
210 $XFS_REPAIR_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
217 echo "Usage: _get_pids_by_name process-name" 1>&2
221 # Algorithm ... all ps(1) variants have a time of the form MM:SS or
222 # HH:MM:SS before the psargs field, use this as the search anchor.
224 # Matches with $1 (process-name) occur if the first psarg is $1
225 # or ends in /$1 ... the matching uses sed's regular expressions,
226 # so passing a regex into $1 will work.
234 -e "/[0-9]:[0-9][0-9] *[^ ]*\/$1 /s/ .*//p" \
235 -e "/[0-9]:[0-9][0-9] *$1 /s/ .*//p"
243 $NSLOOKUP_PROG $host | $AWK_PROG '{ if ($1 == "Name:") print $2 }'
246 # fix malloc libs output
250 # filter out the Electric Fence notice
253 if (defined $o && /^\s+Electric Fence/) {
259 print $o if (defined $o);
263 print $o if (defined $o);
267 # check if run as root
271 id=`id | $SED_PROG -e 's/(.*//' -e 's/.*=//'`
274 echo "Arrgh ... you need to be root (not uid=$id) to run this test"
281 # _df_device : get an IRIX style df line for a given device
283 # - returns "" if not mounted
284 # - returns fs type in field two (ala IRIX)
285 # - joins line together if split by fancy df formatting
286 # - strips header etc
293 echo "Usage: _df_device device" 1>&2
297 $DF_PROG 2>/dev/null | $AWK_PROG -v what=$1 '
298 match($1,what) && NF==1 {
312 # _df_dir : get an IRIX style df line for device where a directory resides
314 # - returns fs type in field two (ala IRIX)
315 # - joins line together if split by fancy df formatting
316 # - strips header etc
323 echo "Usage: _df_dir device" 1>&2
327 $DF_PROG $1 2>/dev/null | $AWK_PROG -v what=$1 '
343 # return percentage used disk space for mounted device
349 echo "Usage: _used device" 1>&2
353 _df_device $1 | $AWK_PROG '{ sub("%", "") ; print $6 }'
356 # return the FS type of a mounted device
362 echo "Usage: _fs_type device" 1>&2
366 _df_device $1 | $AWK_PROG '{ print $2 }'
369 # return the FS mount options of a mounted device
371 # should write a version which just parses the output of mount for IRIX
372 # compatibility, but since this isn't used at all, at the moment I'll leave
379 echo "Usage: _fs_options device" 1>&2
383 $AWK_PROG -v dev=$1 '
384 match($1,dev) { print $4 }
388 # returns device number if a file is a block device
394 echo "Usage: _is_block_dev dev" 1>&2
398 [ -b $1 ] && src/lstat64 $1 | $AWK_PROG '/Device type:/ { print $9 }'
401 # Do a command, log it to $seq.full, optionally test return status
402 # and die if command fails. If called with one argument _do executes the
403 # command, logs it, and returns its exit status. With two arguments _do
404 # first prints the message passed in the first argument, and then "done"
405 # or "fail" depending on the return status of the command passed in the
406 # second argument. If the command fails and the variable _do_die_on_error
407 # is set to "always" or the two argument form is used and _do_die_on_error
408 # is set to "message_only" _do will print an error message to
413 if [ $# -eq 1 ]; then
415 elif [ $# -eq 2 ]; then
420 echo "Usage: _do [note] cmd" 1>&2
424 (eval "echo '---' \"$_cmd\"") >>$here/$seq.full
425 (eval "$_cmd") >$tmp._out 2>&1; ret=$?
426 cat $tmp._out | _fix_malloc >>$here/$seq.full
427 if [ $# -eq 2 ]; then
428 if [ $ret -eq 0 ]; then
435 && [ "$_do_die_on_error" = "always" \
436 -o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ]
439 eval "echo \"$_cmd\" failed \(returned $ret\): see $seq.full"
446 # bail out, setting up .notrun file
450 echo "$*" >$seq.notrun
451 echo "$seq not run: $*"
456 # just plain bail out
460 echo "$*" | tee -a $here/$seq.full
461 echo "(see $seq.full for details)"
466 # tests whether $FSTYP is one of the supported filesystems for a test
472 if [ "$f" = "$FSTYP" ]
478 _notrun "not suitable for this filesystem type: $FSTYP"
481 # tests whether $FSTYP is one of the supported OSes for a test
487 if [ "$h" = "$HOSTOS" ]
493 _notrun "not suitable for this OS: $HOSTOS"
496 # this test needs a scratch partition - check we're ok & unmount it
502 if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]
504 _notrun "this test requires a valid \$SCRATCH_DEV"
506 if [ "`_is_block_dev $SCRATCH_DEV`" = "`_is_block_dev $TEST_DEV`" ]
508 _notrun "this test requires a valid \$SCRATCH_DEV"
511 nfs*|ext2|ext3|reiserfs)
512 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
513 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]
515 _notrun "this test requires a valid \$SCRATCH_DEV"
519 _notrun "\$FSTYP ($FSTYP) unknown or not specified"
524 if _mount | grep -q $SCRATCH_DEV
526 # if it's mounted, make sure its on $SCRATCH_MNT
527 if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
529 echo "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
532 # and then unmount it
533 if ! $UMOUNT_PROG $SCRATCH_DEV
535 echo "failed to unmount $SCRATCH_DEV"
541 # this test needs a logdev
545 [ -z "$SCRATCH_LOGDEV" -o ! -b "$SCRATCH_LOGDEV" ] && \
546 _notrun "This test requires a valid \$SCRATCH_LOGDEV"
547 [ "$USE_EXTERNAL" != yes ] && \
548 _notrun "This test requires USE_EXTERNAL to be enabled"
550 # ensure its not mounted
551 $UMOUNT_PROG $SCRATCH_LOGDEV 2>/dev/null
554 # this test requires loopback device support
558 if [ "$HOSTOS" != "Linux" ]
560 _notrun "This test requires linux for loopback device support"
563 modprobe loop >/dev/null 2>&1
564 if grep loop /proc/devices >/dev/null 2>&1
568 _notrun "This test requires loopback device support"
572 # this test requires that (large) loopback device files are not in use
574 _require_nobigloopfs()
576 [ "$USE_BIG_LOOPFS" = yes ] && \
577 _notrun "Large filesystem testing in progress, skipped this test"
580 # this test requires that a realtime subvolume is in use, and
581 # that the kernel supports realtime as well.
585 [ "$USE_EXTERNAL" = yes ] || \
586 _notrun "External volumes not in use, skipped this test"
587 [ "$SCRATCH_RTDEV" = "" ] && \
588 _notrun "Realtime device required, skipped this test"
591 # this test requires that a specified command (executable) exists
595 [ -x "$1" ] || _notrun "$1 utility required, skipped this test"
598 # this test requires that external log/realtime devices are not in use
600 _require_nonexternal()
602 [ "$USE_EXTERNAL" = yes ] && \
603 _notrun "External device testing in progress, skipped this test"
606 # check that a FS is mounted as XFS. if so, return mount point
612 echo "Usage: _xfs_mounted device" 1>&2
618 if _mount | grep $device | $AWK_PROG '
619 /type xfs/ { print $3 ; exit 0 }
623 echo "_xfs_mounted: $device is not a mounted XFS FS"
629 # remount a FS to a new mode (ro or rw)
635 echo "Usage: _remount device ro/rw" 1>&2
641 if ! mount -o remount,$mode $device
643 echo "_remount: failed to remount filesystem on $device as $mode"
648 # run xfs_check and friends on a FS.
650 # if the filesystem is mounted, it's either remounted ro before being
651 # checked or it's unmounted and then remounted
656 _check_xfs_filesystem()
660 echo "Usage: _check_xfs_filesystem device <logdev>|none <rtdev>|none" 1>&2
665 if [ "$2" != "none" ]; then
666 extra_log_options="-l$2"
667 extra_mount_options="-ologdev=$2"
670 if [ "$3" != "none" ]; then
671 extra_rt_options="-r$3"
672 extra_mount_options=$extra_mount_options" -ortdev=$3"
675 [ "$FSTYP" != xfs ] && return 0
677 [ "$USE_BIG_LOOPFS" = yes ] && testoption=-t
679 type=`_fs_type $device`
682 if [ "$type" = "xfs" ]
686 if [ $USE_REMOUNT -eq 0 ]
688 mountpoint=`_xfs_mounted $device`
695 $XFS_LOGPRINT_PROG -t $extra_log_options $device 2>&1 \
696 | tee $tmp.logprint | grep -q "<CLEAN>"
697 if [ $? -ne 0 -a "$HOSTOS" = "Linux" ]
699 echo "_check_xfs_filesystem: filesystem on $device has dirty log (see $seq.full)"
701 echo "_check_xfs_filesystem: filesystem on $device has dirty log" >>$here/$seq.full
702 echo "*** xfs_logprint -t output ***" >>$here/$seq.full
703 cat $tmp.logprint >>$here/$seq.full
704 echo "*** end xfs_logprint output" >>$here/$seq.full
709 $XFS_CHECK_PROG $testoption $extra_log_options $device 2>&1 |\
710 _fix_malloc >$tmp.fs_check
711 if [ -s $tmp.fs_check ]
713 echo "_check_xfs_filesystem: filesystem on $device is inconsistent (c) (see $seq.full)"
715 echo "_check_xfs_filesystem: filesystem on $device is inconsistent" >>$here/$seq.full
716 echo "*** xfs_check output ***" >>$here/$seq.full
717 cat $tmp.fs_check >>$here/$seq.full
718 echo "*** end xfs_check output" >>$here/$seq.full
722 # repair doesn't scale massively at this stage, optionally skip it for now
723 [ "$USE_BIG_LOOPFS" = yes ] || \
724 $XFS_REPAIR_PROG -n $extra_log_options $extra_rt_options $device >$tmp.repair 2>&1
727 echo "_check_xfs_filesystem: filesystem on $device is inconsistent (r) (see $seq.full)"
729 echo "_check_xfs_filesystem: filesystem on $device is inconsistent" >>$here/$seq.full
730 echo "*** xfs_repair -n output ***" >>$here/$seq.full
731 cat $tmp.repair | _fix_malloc >>$here/$seq.full
732 echo "*** end xfs_repair output" >>$here/$seq.full
736 rm -f $tmp.fs_check $tmp.logprint $tmp.repair
740 echo "*** mount output ***" >>$here/$seq.full
741 _mount >>$here/$seq.full
742 echo "*** end mount output" >>$here/$seq.full
743 elif [ "$type" = "xfs" ]
746 if [ $USE_REMOUNT -eq 0 ]
748 if ! _mount -t xfs $extra_mount_options $device $mountpoint
750 echo "!!! failed to remount $device on $mountpoint"
758 [ $ok -eq 0 ] && exit 1
762 # Filter the knowen errors the UDF Verifier reports.
763 _udf_test_known_error_filter()
765 egrep -v "PVD 60 Error: Interchange Level: 1, Maximum Interchange Level: 0|FSD 28 Error: Interchange Level: 1, Maximum Interchange Level: 1,|PVD 72 Warning: Volume Set Identifier: \"\*IRIX UDF\",|Warning: [0-9]+ unused blocks NOT marked as unallocated."
769 _check_udf_filesystem()
771 [ "$DISABLE_UDF_TEST" == "1" ] && return
773 if [ $# -ne 1 -a $# -ne 2 ]
775 echo "Usage: _check_udf_filesystem device [last_block]" 1>&2
779 if [ ! -x $here/src/udf_test ]
781 echo "udf_test not installed, please download and build the Philips"
782 echo "UDF Verification Software from http://www.extra.research.philips.com/udf/."
783 echo "Then copy the udf_test binary to $here/src/."
784 echo "If you do not wish to run udf_test then set environment variable DISABLE_UDF_TEST"
792 LAST_BLOCK=`expr \( $2 - 1 \)`
793 OPT_ARG="-lastvalidblock $LAST_BLOCK"
797 sleep 1 # Due to a problem with time stamps in udf_test
798 $here/src/udf_test $OPT_ARG $device | tee $here/$seq.checkfs | egrep "Error|Warning" | \
799 _udf_test_known_error_filter | \
800 egrep -iv "Error count:.*[0-9]+.*total occurrences:.*[0-9]+|Warning count:.*[0-9]+.*total occurrences:.*[0-9]+" | \
801 sed "s/^.*$/Warning UDF Verifier reported errors see $seq.checkfs./g"
809 [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
810 TEST_LOG="$TEST_LOGDEV"
812 [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ] && \
813 TEST_RT="$TEST_RTDEV"
815 _check_xfs_filesystem $TEST_DEV $TEST_LOG $TEST_RT
817 # check for ipath consistency
818 if $XFS_GROWFS_PROG -n $TEST_DIR | grep -q 'inode-paths=1'; then
819 # errors go to stderr
820 xfs_check_ipaths $TEST_DIR >/dev/null
821 xfs_repair_ipaths -n $TEST_DIR >/dev/null
831 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
832 SCRATCH_LOG="$SCRATCH_LOGDEV"
834 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
835 SCRATCH_RT="$SCRATCH_RTDEV"
837 _check_xfs_filesystem $SCRATCH_DEV $SCRATCH_LOG $SCRATCH_RT
840 _check_udf_filesystem $SCRATCH_DEV $udf_fsize
843 # Don't know how to check an NFS filesystem, yet.
850 _full_fstyp_details()
852 [ -z "$FSTYP" ] && FSTYP=xfs
853 if [ $FSTYP = xfs ]; then
854 if [ -d /proc/fs/xfs ]; then
855 if grep -q 'debug 0' /proc/fs/xfs/stat; then
856 FSTYP="$FSTYP (non-debug)"
857 elif grep -q 'debug 1' /proc/fs/xfs/stat; then
858 FSTYP="$FSTYP (debug)"
861 if uname -a | grep -qi 'debug'; then
862 FSTYP="$FSTYP (debug)"
864 FSTYP="$FSTYP (non-debug)"
871 _full_platform_details()
877 echo "$os/$platform $host $kernel"
892 # Don't know how to check an NFS filesystem, yet.
902 [ "$FSTYP" != "xfs" ] \
903 && _fail "setup_xfs_testdir: \$FSTYP ($FSTYP) is not xfs"
908 _setup_udf_scratchdir()
910 [ "$FSTYP" != "udf" ] \
911 && _fail "setup_udf_testdir: \$FSTYP is not udf"
912 [ -z "$SCRATCH_DEV" -o ! -b "$SCRATCH_DEV" ] \
913 && _notrun "this test requires a valid \$SCRATCH_DEV"
914 [ -z "$SCRATCH_MNT" ] \
915 && _notrun "this test requires a valid \$SCRATCH_MNT"
918 if _mount | grep -q $SCRATCH_DEV
920 # if it's mounted, make sure its on $TEST_RW_DIR
921 if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
923 _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
925 $UMOUNT_PROG $SCRATCH_DEV
934 _setup_nfs_scratchdir()
936 [ "$FSTYP" != "nfs" ] \
937 && _fail "setup_nfs_testdir: \$FSTYP is not nfs"
938 [ -z "$SCRATCH_DEV" ] \
939 && _notrun "this test requires a valid host fs for \$SCRATCH_DEV"
940 [ -z "$SCRATCH_MNT" ] \
941 && _notrun "this test requires a valid \$SCRATCH_MNT"
944 if _mount | grep -q $SCRATCH_DEV
946 # if it's mounted, make sure its on $SCRATCH_MNT
947 if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
949 _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
951 $UMOUNT_PROG $SCRATCH_DEV
961 # Warning for UDF and NFS this function calls _setup_udf_scratchdir and
962 # _setup_udf_scratchdir. This is done because testdir is a persistent
963 # XFS only partition.
972 _setup_udf_scratchdir
975 _setup_nfs_scratchdir
978 _fail "\$FSTYP is not xfs, udf or nfs"
987 # do nothing, testdir is $TEST_DIR
991 # umount testdir as it is $SCRATCH_MNT which could be used by xfs next
992 [ -n "$testdir" ] && $UMOUNT_PROG $testdir
995 # umount testdir as it is $SCRATCH_MNT which could be used by xfs next
996 [ -n "$testdir" ] && $UMOUNT_PROG $testdir
999 _fail "\$FSTYP is not xfs, udf or nfs"
1006 if [ -z "$1" ]; then
1007 echo Error must pass \$seq.
1011 if [ "`uname`" == "IRIX64" ] || [ "`uname`" == "IRIX" ]; then
1013 elif [ "`uname`" == "Linux" ]; then
1016 echo Error test $seq does not run on the operating system: `uname`
1034 if [ $size -gt 0 ]; then
1035 dd if=/dev/zero of=$file bs=1024 count=$size
1041 # takes dirname, depth
1044 dirname=$1; depth=$2
1045 mkdir $dirname || die "mkdir $dirname failed"
1048 _nfiles $files # files for this dir
1050 [ $depth -eq 0 ] && return
1051 deep=`expr $depth - 1` # go 1 down
1053 [ $verbose = true ] && echo "descending, depth from leaves = $deep"
1056 while [ $d -lt $dirs ]
1058 _descend d$d $deep &
1064 # Populate a filesystem with inodes for performance experiments
1066 # usage: populate [-v] [-n ndirs] [-f nfiles] [-d depth] [-r root] [-s size]
1072 dirs=5 # ndirs in each subdir till leaves
1073 size=0 # sizeof files in K
1074 files=100 # num files in _each_ subdir
1075 depth=2 # depth of tree from root to leaves
1077 root=root # path of initial root of directory tree
1079 while getopts "d:f:n:r:s:v" c
1092 _descend $root $depth
1097 [ $verbose = true ] && echo done
1100 # query whether the given file has the given inode flag set
1107 if which $XFS_IO_PROG >/dev/null; then
1108 if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | grep -q "$flag" ; then
1116 ################################################################################
1118 if [ "$iam" != new -a "$iam" != bench ]
1120 # make some further configuration checks here
1122 if [ "$TEST_DEV" = "" ]
1124 echo "common.rc: Error: \$TEST_DEV is not set"
1128 # if $TEST_DEV is not mounted, mount it now as XFS
1129 if [ -z "`_fs_type $TEST_DEV`" ]
1131 # $TEST_DEV is not mounted
1134 echo "common.rc: retrying test device mount with external set"
1135 [ "$USE_EXTERNAL" != "yes" ] && export USE_EXTERNAL=yes
1138 echo "common.rc: could not mount $TEST_DEV on $TEST_DIR"
1144 if [ "`_fs_type $TEST_DEV`" != "xfs" ]
1146 echo "common.rc: Error: \$TEST_DEV ($TEST_DEV) is not a MOUNTED XFS filesystem"
1152 # make sure this script returns success