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