allow mkfs arguments to be passed from the env for testing multiple
authorNathan Scott <nathans@sgi.com>
Sun, 20 Jan 2002 00:47:43 +0000 (00:47 +0000)
committerNathan Scott <nathans@sgi.com>
Sun, 20 Jan 2002 00:47:43 +0000 (00:47 +0000)
block sizes.

30 files changed:
004
009
015
016
017
018
019
021
029
030
031
032
033
034
041
042
044
045
049
050
052
053
054
062
check
common.dump
common.rc
soak
src/acl_get.c
src/lstat64.c

diff --git a/004 b/004
index 54df4f9..c401391 100755 (executable)
--- a/004
+++ b/004
@@ -56,7 +56,7 @@ trap "_cleanup" 0 1 2 3 15
 
 _populate_scratch()
 {
-       mkfs -t xfs -f $SCRATCH_DEV >/dev/null 2>&1
+       mkfs_xfs -f $SCRATCH_DEV >/dev/null 2>&1
        mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
        dd if=/dev/zero of=$SCRATCH_MNT/foo count=200 bs=4096 >/dev/null 2>&1 &
        dd if=/dev/zero of=$SCRATCH_MNT/goo count=400 bs=4096 >/dev/null 2>&1 &
diff --git a/009 b/009
index 6758c99..f4aacbc 100755 (executable)
--- a/009
+++ b/009
@@ -61,7 +61,7 @@ _block_filter()
 _init()
 {
     echo "*** mkfs"
-    if ! mkfs -t xfs -f $SCRATCH_DEV >$tmp.out 2>&1
+    if ! mkfs_xfs -f $SCRATCH_DEV >$tmp.out 2>&1
     then
        cat $tmp.out
         echo "failed to mkfs $SCRATCH_DEV"
diff --git a/015 b/015
index f581de6..7749818 100755 (executable)
--- a/015
+++ b/015
@@ -76,7 +76,7 @@ _filter_dd()
 # real QA test starts here
 _require_scratch
 
-mkfs -t xfs -f -d size=50m $SCRATCH_DEV >/dev/null
+mkfs_xfs -f -d size=50m $SCRATCH_DEV >/dev/null
 mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
 out=$SCRATCH_MNT/fillup.$$
 rm -f $seq.full
diff --git a/016 b/016
index c5c525e..400c4cd 100755 (executable)
--- a/016
+++ b/016
@@ -77,7 +77,7 @@ _init()
     echo "*** reset partition"
     $here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV
     echo "*** mkfs"
-    if ! mkfs -t xfs -f -d size=50m -l size=512b $SCRATCH_DEV >$tmp.out 2>&1
+    if ! mkfs_xfs -f -d size=50m -l size=512b $SCRATCH_DEV >$tmp.out 2>&1
     then
        cat $tmp.out
         echo "failed to mkfs $SCRATCH_DEV"
diff --git a/017 b/017
index a154ea0..97adcd8 100755 (executable)
--- a/017
+++ b/017
@@ -98,7 +98,7 @@ rm -f $seq.full
 umount $SCRATCH_DEV >/dev/null 2>&1
 echo "*** MKFS ***"                         >>$seq.full
 echo ""                                     >>$seq.full
-mkfs -t xfs -f $SCRATCH_DEV                 >>$seq.full 2>&1 \
+mkfs_xfs -f $SCRATCH_DEV                    >>$seq.full 2>&1 \
     || _fail "mkfs failed"
 mount -t xfs $SCRATCH_DEV $SCRATCH_MNT      >>$seq.full 2>&1 \
     || _fail "mount failed"
diff --git a/018 b/018
index ad7763e..6cd8668 100755 (executable)
--- a/018
+++ b/018
@@ -122,7 +122,7 @@ rm -f $seq.out $seq.full
 umount $SCRATCH_DEV >/dev/null 2>&1
 
 _full "mkfs"
-mkfs -t xfs -f -lsize=2000b $SCRATCH_DEV    >>$seq.full 2>&1 \
+mkfs_xfs -f -lsize=2000b $SCRATCH_DEV    >>$seq.full 2>&1 \
     || _fail "mkfs failed"
 _full " mount"
 mount -t xfs $SCRATCH_DEV $SCRATCH_MNT      >>$seq.full 2>&1 \
diff --git a/019 b/019
index bef42b0..ae42910 100755 (executable)
--- a/019
+++ b/019
@@ -127,7 +127,7 @@ _verify_fs()
        umount $SCRATCH_DEV >/dev/null 2>&1
 
        _full "mkfs"
-       mkfs -t xfs -f $VERSION -p $protofile $SCRATCH_DEV >>$seqfull 2>&1 \
+       mkfs_xfs -f $VERSION -p $protofile $SCRATCH_DEV >>$seqfull 2>&1 \
                || _fail "mkfs failed"
            
        echo "*** check FS"
diff --git a/021 b/021
index e2eeb19..f7586f5 100755 (executable)
--- a/021
+++ b/021
@@ -81,7 +81,7 @@ echo "*** mkfs"
 rm -f $seq.full
 umount $SCRATCH_DEV >/dev/null 2>&1
 
-mkfs -t xfs -f $SCRATCH_DEV >/dev/null \
+mkfs_xfs -f $SCRATCH_DEV >/dev/null \
     || _fail "mkfs failed"
   
 echo "*** mount FS"
diff --git a/029 b/029
index c6491ff..bb23d56 100755 (executable)
--- a/029
+++ b/029
@@ -76,7 +76,7 @@ _filter_logprint()
 _require_scratch
 
 echo
-mkfs -t xfs -f $mkfs_args $SCRATCH_DEV | _filter_mkfs 2>/dev/null
+mkfs_xfs -f $mkfs_args $SCRATCH_DEV | _filter_mkfs 2>/dev/null
 
 echo
 xfs_logprint $logp_args $SCRATCH_DEV | _filter_logprint
diff --git a/030 b/030
index b3142b7..73c157d 100755 (executable)
--- a/030
+++ b/030
@@ -78,7 +78,7 @@ _require_scratch
 # superblock (hanging around from earlier tests)...
 # 
 size="-d size=100m"
-mkfs -t xfs -f $size $SCRATCH_DEV >/dev/null 2>&1
+mkfs_xfs -f $size $SCRATCH_DEV >/dev/null 2>&1
 if [ $? -ne 0 ]                # probably don't have a big enough scratch
 then
        _notrun "SCRATCH_DEV too small, results would be non-deterministic"
@@ -100,7 +100,7 @@ src/devzero -v -1 -n "$clear" $SCRATCH_DEV >/dev/null
 
 # now kick off the real repair test...
 # 
-mkfs -t xfs -f $size $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+mkfs_xfs -f $size $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
 source $tmp.mkfs
 _check_ag 0
 _check_ag -1
diff --git a/031 b/031
index 3a62956..c42fa1a 100755 (executable)
--- a/031
+++ b/031
@@ -98,13 +98,13 @@ EOF
 # 
 _require_scratch
 
-MKFSV1="-t xfs -f -p $tmp.proto -n version=1 $SCRATCH_DEV"
-MKFSV2="-t xfs -f -p $tmp.proto -n version=2 $SCRATCH_DEV"
+MKFSV1="-f -p $tmp.proto -n version=1 $SCRATCH_DEV"
+MKFSV2="-f -p $tmp.proto -n version=2 $SCRATCH_DEV"
 
 # sanity test - default + one root directory entry
 _create_proto 0
 echo "=== version 1, one entry"
-mkfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1
+mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1
 _check_repair
 echo "=== version 2, one entry (shortform)"
 mkfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1
diff --git a/032 b/032
index f3f8bb4..7ab621c 100755 (executable)
--- a/032
+++ b/032
@@ -79,7 +79,7 @@ do
 
        # next, ensure we don't overwrite it
        echo "=== Attempting XFS overwrite of $fs..." >>$seq.full
-       mkfs -t xfs $SCRATCH_DEV >>$seq.full 2>&1
+       mkfs_xfs $SCRATCH_DEV >>$seq.full 2>&1
 
        [ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"
 done
diff --git a/033 b/033
index 3f8a0fa..42e1ac1 100755 (executable)
--- a/033
+++ b/033
@@ -75,7 +75,7 @@ _check_root_inos()
 _require_scratch
 
 # devzero blows away 512byte blocks, so make 512byte inodes
-mkfs -t xfs -f -i size=512 $SCRATCH_DEV | _filter_mkfs 2>/dev/null
+mkfs_xfs -f -i size=512 $SCRATCH_DEV | _filter_mkfs 2>/dev/null
 `xfs_db -r -c sb -c p $SCRATCH_DEV | grep 'ino = ' | \
        sed -e 's/ //g' -e 's/^/export /'`
 
diff --git a/034 b/034
index 100304a..fb70a05 100755 (executable)
--- a/034
+++ b/034
@@ -67,7 +67,7 @@ rm -f $seq.full
 umount $SCRATCH_DEV >/dev/null 2>&1
 echo "*** MKFS ***"                         >>$seq.full
 echo ""                                     >>$seq.full
-mkfs -t xfs -f $SCRATCH_DEV                 >>$seq.full 2>&1 \
+mkfs_xfs -f $SCRATCH_DEV                    >>$seq.full 2>&1 \
     || _fail "mkfs failed"
 mount -t xfs $SCRATCH_DEV $SCRATCH_MNT      >>$seq.full 2>&1 \
     || _fail "mount failed"
diff --git a/041 b/041
index 27ee0f5..b48a3d7 100755 (executable)
--- a/041
+++ b/041
@@ -75,7 +75,7 @@ rm -f $seq.full
 #agsize=16
 agsize=32
 echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... "
-_do "mkfs -t xfs -d size=${agsize}m,agcount=1 -l internal -f $SCRATCH_DEV"
+_do "mkfs_xfs -d size=${agsize}m,agcount=1 -l internal -f $SCRATCH_DEV"
 _do "mount -t xfs $SCRATCH_DEV $SCRATCH_MNT"
 echo "done"
 
diff --git a/042 b/042
index 7c35e4f..5741fdc 100755 (executable)
--- a/042
+++ b/042
@@ -105,7 +105,7 @@ mnt_cmd="mount -t xfs $SCRATCH_DEV $SCRATCH_MNT"
 _do_die_on_error=message_only
 
 echo -n "Make a 48 megabyte filesystem on SCRATCH_DEV and mount... "
-_do "mkfs -t xfs -d size=48m,agcount=3 -l internal -f $SCRATCH_DEV"
+_do "mkfs_xfs -d size=48m,agcount=3 -l internal -f $SCRATCH_DEV"
 _do "$mnt_cmd"
 echo "done"
 
diff --git a/044 b/044
index 6505105..b0e2136 100755 (executable)
--- a/044
+++ b/044
@@ -125,7 +125,7 @@ _require_scratch
 echo -e -n "\n\r*** XFS QA 044 - expect mount failure messages\n\r\n\r" >/dev/console
 
 echo "*** mkfs"
-mkfs -t xfs -f -l logdev=$SCRATCH_LOGDEV,size=4096b $SCRATCH_DEV | _filter_mkfs 2>/dev/null
+mkfs_xfs -f -l logdev=$SCRATCH_LOGDEV,size=4096b $SCRATCH_DEV | _filter_mkfs 2>/dev/null
 _check_mount
 _check_require_logdev
 
diff --git a/045 b/045
index 94334bd..0c0737c 100755 (executable)
--- a/045
+++ b/045
@@ -65,7 +65,7 @@ _require_scratch
 echo "*** get uuid"
 uuid=`_get_uuid $TEST_DEV`
 echo "*** mkfs"
-if ! mkfs -t xfs -f $SCRATCH_DEV >$tmp.out 2>&1
+if ! mkfs_xfs -f $SCRATCH_DEV >$tmp.out 2>&1
 then
     cat $tmp.out
     echo "!!! failed to mkfs on $SCRATCH_DEV"
diff --git a/049 b/049
index 40cf8c1..9510384 100755 (executable)
--- a/049
+++ b/049
@@ -92,7 +92,7 @@ mount -t ext2 $SCRATCH_DEV $SCRATCH_MNT >> $seq.full 2>&1 \
     || _fail "!!! failed to mount"
 
 _log "Create xfs fs in file on scratch"
-mkfs -t xfs -d file,name=$SCRATCH_MNT/test.xfs,size=20m >> $seq.full 2>&1 \
+mkfs_xfs -d file,name=$SCRATCH_MNT/test.xfs,size=20m >> $seq.full 2>&1 \
     || _fail "!!! failed to mkfs xfs"
 
 _log "Make mount points"
diff --git a/050 b/050
index 28b3503..ae76e9a 100755 (executable)
--- a/050
+++ b/050
@@ -74,7 +74,7 @@ if [ -z "$MOUNT_OPTIONS" ]; then
 fi
 
 # real QA test starts here
-mkfs -t xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+mkfs_xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
 cat $tmp.mkfs >>$seq.full
 
 # keep the blocksize and data size for dd later
diff --git a/052 b/052
index b1f74b7..701e785 100755 (executable)
--- a/052
+++ b/052
@@ -71,7 +71,7 @@ if [ -z "$MOUNT_OPTIONS" ]; then
 fi
 
 # real QA test starts here
-mkfs -t xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+mkfs_xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
 cat $tmp.mkfs >>$seq.full
 chmod a+w $seq.full     # arbitrary users will write here
 
diff --git a/053 b/053
index 5241ddc..2cefb0d 100755 (executable)
--- a/053
+++ b/053
@@ -60,7 +60,7 @@ test=$SCRATCH_MNT/test
 
 # make filesystem on scratch using the defaults
 _do 'make filesystem on $SCRATCH_DEV' \
-    'mkfs -t xfs -f $SCRATCH_DEV'
+    'mkfs_xfs -f $SCRATCH_DEV'
 _do 'mount filesytem' \
     'mount -t xfs $SCRATCH_DEV $SCRATCH_MNT'
 
diff --git a/054 b/054
index ea7f8f4..53d30aa 100755 (executable)
--- a/054
+++ b/054
@@ -77,7 +77,7 @@ _filter_stat()
 
 _exercise()
 {
-       mkfs -t xfs -f $SCRATCH_DEV >/dev/null 2>&1
+       mkfs_xfs -f $SCRATCH_DEV >/dev/null 2>&1
        _qmount
 
        umask 022
@@ -110,7 +110,7 @@ _exercise()
 }
 
 # real QA test starts here
-mkfs -t xfs -f $SCRATCH_DEV >/dev/null 2>&1
+mkfs_xfs -f $SCRATCH_DEV >/dev/null 2>&1
 MOUNT_OPTIONS="-o usrquota,grpquota"; export MOUNT_OPTIONS
 _qmount
 if src/feature -G $SCRATCH_DEV ; then
diff --git a/062 b/062
index 58cd7d1..74bffba 100755 (executable)
--- a/062
+++ b/062
@@ -91,7 +91,7 @@ _require_scratch
 rm -f $tmp.backup1 $tmp.backup2 $seq.full
 
 # real QA test starts here
-mkfs -t xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+mkfs_xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
 mount -t xfs $SCRATCH_DEV $SCRATCH_MNT || _fail "mount failed"
 _create_test_bed
 
diff --git a/check b/check
index 515c412..22f438d 100755 (executable)
--- a/check
+++ b/check
@@ -157,6 +157,21 @@ timestamp=false
 
 [ -f check.time ] || touch check.time
 
+if [ ! -z "$MKFS_OPTIONS" ]
+then
+    echo "check: \$MKFS_OPTIONS specified - \"$MKFS_OPTIONS\""
+    umount $SCRATCH_DEV 2>/dev/null
+    # call the overridden mkfs.xfs - make sure the FS is built
+    # the same as we'll create it later.
+    if ! mkfs_xfs -f $SCRATCH_DEV >$tmp.err 2>&1
+    then
+       echo "our local mkfs_xfs routine ..."
+       cat $tmp.err
+        echo "check: failed to mkfs.xfs \$SCRATCH_DEV using specified options"
+        exit 1
+    fi
+fi
+
 if [ ! -z "$MOUNT_OPTIONS" ]
 then
     echo "check: \$MOUNT_OPTIONS specified - \"$MOUNT_OPTIONS\""
@@ -165,7 +180,7 @@ then
     # the same as we'll set it later.
     if ! mount -t xfs $TEST_DEV $TEST_DIR >$tmp.err 2>&1
     then
-       echo "our mount ..."
+       echo "our local mount routine ..."
        cat $tmp.err
         # call the normal mount
        echo "normal mount ..."
index 88651c5..7f96411 100644 (file)
@@ -248,7 +248,7 @@ _wipe_fs()
 {
     _require_scratch
 
-    mkfs -t xfs $MKFS_OPTS $SCRATCH_DEV>>$seq.full  ||\
+    mkfs_xfs $MKFS_OPTS $SCRATCH_DEV>>$seq.full  ||\
        _error "mkfs failed"
       
     mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full ||\
index 8f6d9aa..c05a942 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -63,7 +63,7 @@ FSSTRESS_AVOID="-f resvsp=0 -f unresvsp=0"
 
 export AWK_PROG PS_HAVE_BSD PS_ALL_FLAGS PLATFORM
 
-# we override mount so we can specify mount options
+# we override mount and mkfs.xfs so we can specify extra options
 
 mount()
 {
@@ -84,6 +84,11 @@ mount()
     esac
 }
 
+mkfs_xfs()
+{
+    /sbin/mkfs.xfs $* $MKFS_OPTIONS
+}
+
 #
 
 _get_pids_by_name()
@@ -606,7 +611,7 @@ then
 
 fi
 
-# check for some required biunaries on our $PATH
+# check for some required binaries on our $PATH
 #
 for exec in mkfs.xfs xfs_logprint xfs_check xfs_repair xfs_db
 do
diff --git a/soak b/soak
index c6a203a..6c4f27e 100755 (executable)
--- a/soak
+++ b/soak
@@ -105,7 +105,7 @@ umount $SCRATCH_DEV 2>&1 |  _fix_malloc >>$FULL
 
 _log "        *** clean scratch device"
 
-mkfs -t xfs -f $SCRATCH_DEV 2>&1 |  _fix_malloc >>$FULL \
+mkfs_xfs -f $SCRATCH_DEV 2>&1 |  _fix_malloc >>$FULL \
                         || _fail "            !!! failed to mkfs SCRATCH_DEV"
 
 pass=1
index 84134be..852705e 100644 (file)
@@ -35,6 +35,7 @@
  * using IRIX semantics or Linux semantics
  */
  
+#include <stdlib.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
index 5fb028c..acb93ef 100644 (file)
@@ -31,6 +31,8 @@
  */
  
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <time.h>
 #include <sys/stat.h>
 #include <sys/sysmacros.h>