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 31if [ $2 = "jfs" ]; then 32 mkfs -t $2 -q $1 33else 34 mkfs -t $2 $1 35fi 36mkdir /testmount 37mount -t $2 $1 /testmount 38touch /testmount/testfile 39fsx-linux -N $3 /testmount/testfile 40RESULT=$? 41# report the results 42if [ $RESULT -eq "0" ]; then 43 echo "PASS: fsxtest $1 $2 $3" 44else 45 echo "FAIL: fsxtest $1 $2 $3" 46fi 47umount /testmount 48rm -rf /testmount 49fsck -a -t $2 $1 # report the results 50exit $RESULT 51