xfstests: Assume yes when test device is not partitioned
authorPrasad Joshi <prasadjoshi.linux@gmail.com>
Sat, 3 Sep 2011 08:33:19 +0000 (08:33 +0000)
committerRich Johnston <rjohnston@sgi.com>
Fri, 26 Oct 2012 13:48:29 +0000 (08:48 -0500)
If an entire device used for file system creation, the mkfs.ext2/3/4
asks for confirmation before proceeding. Since the device is
configured for testing it is safe to assume positive response
during mkfs.

The patch also replaces hard coded mkfs path with MKFS_PROG variable.

Signed-off-by: Chaitanya Kulkarni <chaitanyakulkarni15@gmail.com>
Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
032
049
073
common.rc

diff --git a/032 b/032
index 4261ca2a9f39582f52b73c0661410af12aa6fb4f..bf884928cdca422f9ceae1eba6849a04014c96db 100755 (executable)
--- a/032
+++ b/032
@@ -45,7 +45,7 @@ _require_nobigloopfs
 _require_scratch
 
 echo "Silence is golden."
-for fs in `echo /sbin/mkfs.* | sed -e 's/.sbin.mkfs.//g'`
+for fs in `echo ${MKFS_PROG}.* | sed -e 's/.sbin.mkfs.//g'`
 do
        preop=""        # for special input needs
        preargs=""      # for any special pre-device options
@@ -78,7 +78,7 @@ do
        if [ $? -eq 0 ] ; then
                # next, ensure we don't overwrite it
                echo "=== Attempting XFS overwrite of $fs..." >>$seq.full
-               /sbin/mkfs.xfs $SCRATCH_DEV >>$seq.full 2>&1
+               ${MKFS_PROG}.xfs $SCRATCH_DEV >>$seq.full 2>&1
 
                [ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"
        else
diff --git a/049 b/049
index c3065ad5839d76f2551b598330fce5eeb4217973..b68821ab2d451b86f315a97af017bdfc695e922c 100755 (executable)
--- a/049
+++ b/049
@@ -83,7 +83,7 @@ mount -t ext2 $SCRATCH_DEV $SCRATCH_MNT >> $seq.full 2>&1 \
     || _fail "!!! failed to mount"
 
 _log "Create xfs fs in file on scratch"
-/sbin/mkfs.xfs -f -dfile,name=$SCRATCH_MNT/test.xfs,size=40m \
+${MKFS_PROG}.xfs -f -dfile,name=$SCRATCH_MNT/test.xfs,size=40m \
     >> $seq.full 2>&1 \
     || _fail "!!! failed to mkfs xfs"
 
diff --git a/073 b/073
index 96056626bf9fe7bd9cb4946fa0830dd0b1bebb79..43b629dbcabad3979e30e1f36ab86658409c2757 100755 (executable)
--- a/073
+++ b/073
@@ -155,7 +155,7 @@ _verify_copy $imgs.image $SCRATCH_DEV $SCRATCH_MNT
 
 echo 
 echo === copying scratch device to single target, large ro device
-/sbin/mkfs.xfs -dfile,name=$imgs.source,size=100g | _filter_mkfs 2>/dev/null
+${MKFS_PROG}.xfs -dfile,name=$imgs.source,size=100g | _filter_mkfs 2>/dev/null
 rmdir $imgs.source_dir 2>/dev/null
 mkdir $imgs.source_dir
 
index 966fc93a7790efbf221f3e5ec3c18f33391eadfa..f7c16887c11f2a1c066053220ed433d131da1c02 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -334,7 +334,7 @@ _scratch_mkfs()
         $MKFS_BTRFS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
        ;;
     *)
-       /sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
+       yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
        ;;
     esac
 }
@@ -353,7 +353,7 @@ _scratch_mkfs_sized()
        _scratch_mkfs_xfs -d size=$fssize -b size=$blocksize
        ;;
     ext2|ext3|ext4|ext4dev)
-       /sbin/mkfs.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
+       yes | ${MKFS_PROG}.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
        ;;
     btrfs)
        $MKFS_BTRFS_PROG $MKFS_OPTIONS -b $fssize $SCRATCH_DEV