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