Home | History | Annotate | Download | only in fsx-linux
      1 #!/bin/sh
      2 #
      3 # Copyright (c) 2001 Silicon Graphics, Inc.  All Rights Reserved.
      4 # Copyright (c) International Business Machines  Corp., 2001
      5 #
      6 # This program is free software;  you can redistribute it and/or modify
      7 # it under the terms of the GNU General Public License as published by
      8 # the Free Software Foundation; either version 2 of the License, or
      9 # (at your option) any later version.
     10 #
     11 # This program is distributed in the hope that it will be useful,
     12 # but WITHOUT ANY WARRANTY;  without even the implied warranty of
     13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     14 # the GNU General Public License for more details.
     15 #
     16 # You should have received a copy of the GNU General Public License
     17 # along with this program;  if not, write to the Free Software
     18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
     19 #
     20 #
     21 #
     22 # Proper error checking and result reporting still needed
     23 #
     24 # usage:  fsxtest $1 $2 $3
     25 # $1 scratch device to use for testing
     26 # $2 optional file system type
     27 # $3 number of operations to perform
     28 
     29 #Uncomment line below for debugging
     30 #set -x
     31 if [ $2 = "jfs" ]; then
     32   mkfs -t $2 -q $1
     33 else
     34   mkfs -t $2 $1
     35 fi
     36 mkdir /testmount
     37 mount -t $2 $1 /testmount
     38 touch /testmount/testfile
     39 fsx-linux -N $3 /testmount/testfile
     40 RESULT=$?
     41 # report the results
     42 if [ $RESULT -eq "0" ]; then
     43   echo "PASS: fsxtest $1 $2 $3"
     44 else
     45   echo "FAIL: fsxtest $1 $2 $3"
     46 fi
     47 umount /testmount
     48 rm -rf /testmount
     49 fsck -a -t $2 $1  # report the results
     50 exit $RESULT
     51