Skip to contentSkip to conversation

xfstests: use mount point instead of device name

PATCH Superseded Junho Ryu 2 participants 16 messages Dec 17, 2013 – Dec 18, 2013

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Junho Ryu

author
#0 lore raw

PATCH v2 1/12 xfstests: use mount point instead of device name

From: Hugh Dickins <[email protected]>

A tmpfs mount does not involve any block device, its $SCRATCH_DEV is nothing but a place-holder, so apply 'df' or 'stat' to its mount point $SCRATCH_MNT instead of to $SCRATCH_DEV.

It also fixes a bug in generic/256: "stat -f $SCRATCH_DEV" returning the block size of the root file system, but not the test file system.

$ df | grep sda
/dev/sda1    233191    62959    157791    29%    /boot
$ sudo dumpe2fs -h /dev/sda1 | grep "Block size"
Block size:               1024
$ stat -f /dev/sda1 | grep "Block size"
Block size: 4096       Fundamental block size: 4096
$ stat -f /boot | grep "Block size"
Block size: 1024       Fundamental block size: 1024

---

v2: same as v1

 tests/generic/256 | 2 +-
 tests/generic/273 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tests/generic/256 +1 -1
index cfe7237..c6c8f2f 100755
@@ -170,7 +170,7 @@ _scratch_mount
 # Test must be able to write files with non-root permissions
 chmod 777 $SCRATCH_MNT
 
-block_size=`stat -f $SCRATCH_DEV | grep "Block size" | cut -d " " -f3`
+block_size=`stat -f $SCRATCH_MNT | grep "Block size" | cut -d " " -f3`
 _test_full_fs_punch $(( $block_size * 2 )) $block_size 500 $SCRATCH_MNT/252.$$ $block_size
 
 status=0 ; exit
tests/generic/273 +1 -1
index 8e121a2..dc87a92 100755
@@ -68,7 +68,7 @@ _file_create()
 
 	cd $SCRATCH_MNT/origin
 
-	_disksize=`$DF_PROG --block-size=1 $SCRATCH_DEV | tail -1 | awk '{ print $5 }'`
+	_disksize=`$DF_PROG --block-size=1 $SCRATCH_MNT | tail -1 | awk '{ print $5 }'`
 	_disksize=$(($_disksize / 3))
 	_num=$(($_disksize / $count / $threads / 4096))
 	_count=$count
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#1 lore raw

PATCH v2 2/12 xfstests: _scratch_mkfs_sized() for tmpfs

From: Hugh Dickins <[email protected]>

_scratch_mkfs_sized() avoid blockdev and update MOUNT_OPTIONS with required size on tmpfs, so those tests using it can now run.

---

v2: same as v1

 common/rc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
common/rc +4 -1
index a2005c9..c78356e 100644
@@ -590,7 +590,7 @@ _scratch_mkfs_sized()
 
     blocks=`expr $fssize / $blocksize`
 
-    if [ "$HOSTOS" == "Linux" ]; then
+    if [ "$HOSTOS" == "Linux" -a -d "$SCRATCH_DEV" ]; then
 	devsize=`blockdev --getsize64 $SCRATCH_DEV`
 	[ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small"
     fi
@@ -611,6 +611,9 @@ _scratch_mkfs_sized()
     btrfs)
 	$MKFS_BTRFS_PROG $MKFS_OPTIONS -b $fssize $SCRATCH_DEV
 	;;
+    tmpfs)
+	export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS"
+	;;
     *)
 	_notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
 	;;
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw

Re: [PATCH v2 02/12] xfstests: _scratch_mkfs_sized() for tmpfs

Same here, the patch uses -d instead of -b option.

----- Original Message -----

Quoted 38 lines

From: Hugh Dickins <[email protected]>

_scratch_mkfs_sized() avoid blockdev and update MOUNT_OPTIONS with required size on tmpfs, so those tests using it can now run.

---

v2: same as v1

 common/rc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
common/rc +4 -2
index a2005c9..c78356e 100644
@@ -590,7 +590,7 @@ _scratch_mkfs_sized()
 
     blocks=`expr $fssize / $blocksize`
 
-    if [ "$HOSTOS" == "Linux" ]; then
+    if [ "$HOSTOS" == "Linux" -a -d "$SCRATCH_DEV" ]; then
 	devsize=`blockdev --getsize64 $SCRATCH_DEV`
 	[ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small"
     fi
@@ -611,6 +611,9 @@ _scratch_mkfs_sized()
     btrfs)
 	$MKFS_BTRFS_PROG $MKFS_OPTIONS -b $fssize $SCRATCH_DEV
 	;;
+    tmpfs)
+	export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS"
+	;;
     *)
 	_notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
 	;;
--
Quoted 3 lines

1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

author
#3 lore raw

PATCH v2 3/12 xfstests: increase tmpfs memory size

In reply to Junho Ryu

512M is not enough for generic/129, generic/213 and generic/247. Raise default tmpfs size to 1G.

---

v2: same as v1

 common/rc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
common/rc +4 -2
index c78356e..45a45b0 100644
@@ -113,8 +113,8 @@ _mount_opts()
 	export MOUNT_OPTIONS="-o acl $GFS2_MOUNT_OPTIONS"
 	;;
     tmpfs)
-	# We need to specify the size at mount, use 512 MB by default
-	export MOUNT_OPTIONS="-o size=512M $TMPFS_MOUNT_OPTIONS"
+	# We need to specify the size at mount
+	export MOUNT_OPTIONS="-o size=${DEFAULT_TMPFS_SIZE_MB}M $TMPFS_MOUNT_OPTIONS"
 	;;
     *)
 	;;
@@ -168,6 +168,8 @@ _fsck_opts()
 }
 
 [ -z "$FSTYP" ] && FSTYP=xfs
+# Default tmpfs size in megabytes.
+[ -z "$DEFAULT_TMPFS_SIZE_MB" ] && DEFAULT_TMPFS_SIZE_MB=1024
 [ -z "$MOUNT_OPTIONS" ] && _mount_opts
 [ -z "$MKFS_OPTIONS" ] && _mkfs_opts
 [ -z "$FSCK_OPTIONS" ] && _fsck_opts
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#5 lore raw

PATCH v2 4/12 xfstests: rename _require_xfs_io_fiemap to _require_fiemap

In reply to Junho Ryu

Rename the function because we need both xfs_io and kernel support for the check, and we need xfs_io support to check for kernel support.

---

v2: new patch

 common/defrag     | 2 +-
 common/rc         | 2 +-
 tests/generic/255 | 2 +-
 tests/generic/316 | 2 +-
 tests/shared/298  | 2 +-
 tests/xfs/252     | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
common/defrag +1 -1
index a4bc976..81b58e7 100644
@@ -38,7 +38,7 @@ _require_defrag()
     esac
 
     _require_command $DEFRAG_PROG
-    _require_xfs_io_fiemap
+    _require_fiemap
 }
 
 _extent_count()
common/rc +1 -1
index 45a45b0..1db313b 100644
@@ -1281,7 +1281,7 @@ _require_xfs_io_falloc_punch()
 }
 
 # check that xfs_io, kernel and filesystem support fiemap
-_require_xfs_io_fiemap()
+_require_fiemap()
 {
 	testfile=$TEST_DIR/$$.fiemap
 	testio=`$XFS_IO_PROG -F -f -c "pwrite 0 20k" -c "fsync" \
tests/generic/255 +1 -1
index dd329b4..739629c 100755
@@ -48,7 +48,7 @@ _supported_os Linux
 
 _require_xfs_io_falloc_punch
 _require_xfs_io_falloc
-_require_xfs_io_fiemap
+_require_fiemap
 
 testfile=$TEST_DIR/255.$$
 
tests/generic/316 +1 -1
index 8cb2975..4bb6c4a 100755
@@ -46,7 +46,7 @@ _supported_fs generic
 _supported_os Linux
 
 _require_xfs_io_falloc_punch
-_require_xfs_io_fiemap
+_require_fiemap
 
 testfile=$TEST_DIR/$seq.$$
 
tests/shared/298 +1 -1
index 4541798..e8c3d48 100755
@@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs ext4 xfs
 _supported_os Linux
 _require_fstrim
-_require_xfs_io_fiemap
+_require_fiemap
 _require_fs_space $TEST_DIR 307200
 [ "$FSTYP" = "ext4" ] && _require_dumpe2fs
 
tests/xfs/252 +1 -1
index 00be41a..1a5133e 100755
@@ -47,7 +47,7 @@ _supported_fs xfs
 _supported_os Linux
 
 _require_xfs_io_falloc_punch
-_require_xfs_io_fiemap
+_require_fiemap
 
 testfile=$TEST_DIR/252.$$
 
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#6 lore raw

PATCH v2 5/12 xfstests: fix generic/225 to check fiemap support

In reply to Junho Ryu

generic/225 runs fiemap. Check fiemap support like other tests which use fiemap.

---

v2: renamed _require_xfs_io_fiemap to _require_fiemap

 tests/generic/225 | 1 +
 1 file changed, 1 insertion(+)
tests/generic/225 +1 -0
index 73b125a..1fb1f94 100755
@@ -44,6 +44,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_fiemap
 
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount > /dev/null 2>&1
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#7 lore raw

PATCH v2 6/12 xfstests: fix generic/127 to call _cleanup() only once

In reply to Junho Ryu

The test is already trap-ing signal 0 (EXIT). umount prints error message when target tmpfs is already unmounted.

---

v2: same as v1

 tests/generic/127 | 1 -
 1 file changed, 1 deletion(-)
tests/generic/127 +0 -1
index 58ca91e..47bd1ca 100755
@@ -117,5 +117,4 @@ _fsx_std_nommap
 _fsx_std_mmap
 
 status=0
-_cleanup
 exit
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#8 lore raw

PATCH v2 7/12 xfstests: check O_DIRECT support before testing direct I/O

In reply to Junho Ryu

Some filesystems do not support O_DIRECT. Check whether TEST_DIR supports it by running xfs_io with and without -d flag.

---

v2: renamed _require_xfs_io_direct to _require_odirect

 common/rc         | 15 +++++++++++++++
 tests/generic/091 |  1 +
 tests/generic/130 |  1 +
 tests/generic/133 |  1 +
 tests/generic/135 |  1 +
 tests/generic/226 |  1 +
 tests/generic/263 |  1 +
 tests/generic/299 |  1 +
 tests/generic/300 |  1 +
 9 files changed, 23 insertions(+)
common/rc +15 -0
index 1db313b..9e0e727 100644
@@ -1155,6 +1155,7 @@ _require_aiodio()
         AIO_TEST=src/aio-dio-regress/$1
         [ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
     fi
+    _require_odirect
 }
 
 # run an aio-dio program
@@ -1293,6 +1294,20 @@ _require_fiemap()
 		_notrun "xfs_io fiemap command failed (no fs support?)"
 }
 
+# check that kernel and filesystem support direct I/O
+_require_odirect()
+{
+	testfile=$TEST_DIR/$$.direct
+	$XFS_IO_PROG -F -f -c "pwrite 0 20k" $testfile 2>&1
+	if [ $? -eq 0 ]; then
+		$XFS_IO_PROG -F -f -d -c "pwrite 0 20k" $testfile 2>&1
+		if [ $? -ne 0 ]; then
+			_notrun "O_DIRECT is not supported"
+		fi
+	fi
+	rm -f $testfile 2>&1 > /dev/null
+}
+
 # Check that a fs has enough free space (in 1024b blocks)
 #
 _require_fs_space()
tests/generic/091 +1 -0
index bb176f1..bb5c92c 100755
@@ -38,6 +38,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 # real QA test starts here
 _supported_fs generic
 _supported_os Linux
+_require_odirect
 
 rm -f $seqres.full
 
tests/generic/130 +1 -0
index 8367dc7..1e96630 100755
@@ -50,6 +50,7 @@ _supported_os Linux IRIX
 
 _require_scratch
 _require_sparse_files
+_require_odirect
 
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
tests/generic/133 +1 -0
index 7fb1695..8af4dde 100755
@@ -38,6 +38,7 @@ trap "exit \$status" 0 1 2 3 15
 # real QA test starts here
 _supported_fs generic
 _supported_os Linux IRIX
+_require_odirect
 
 echo "Buffered writer, buffered reader"
 $XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
tests/generic/135 +1 -0
index e3b827a..79558f5 100755
@@ -39,6 +39,7 @@ trap "exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux IRIX
 
+_require_odirect
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 
tests/generic/226 +1 -0
index b98e889..4ad56a5 100755
@@ -37,6 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux IRIX
 _require_scratch
+_require_odirect
 
 # real QA test starts here
 rm -f $seqres.full
tests/generic/263 +1 -0
index bc59865..f639215 100755
@@ -38,6 +38,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 # real QA test starts here
 _supported_fs generic
 _supported_os Linux
+_require_odirect
 
 rm -f $seqres.full
 
tests/generic/299 +1 -0
index 14cce96..c674542 100755
@@ -43,6 +43,7 @@ _supported_fs generic
 _supported_os Linux
 _need_to_be_root
 _require_scratch
+_require_odirect
 
 NUM_JOBS=$((4*LOAD_FACTOR))
 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
tests/generic/300 +1 -0
index 7c60728..9231cb7 100755
@@ -43,6 +43,7 @@ _supported_fs generic
 _supported_os Linux
 _need_to_be_root
 _require_scratch
+_require_odirect
 
 NUM_JOBS=$((4*LOAD_FACTOR))
 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#9 lore raw

PATCH v2 8/12 xfstests: add executable permission to tests

In reply to Junho Ryu

From: Hugh Dickins <[email protected]>

add executable permission to generic/311, generic/314 and generic/315. Just like other tests in the same directory.

---

v2: same as v1

 tests/generic/311 | 0
 tests/generic/315 | 0
 tests/generic/321 | 0
 tests/generic/322 | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 tests/generic/311
 mode change 100644 => 100755 tests/generic/315
 mode change 100644 => 100755 tests/generic/321
 mode change 100644 => 100755 tests/generic/322
tests/generic/311 +0 -0
old mode 100644
new mode 100755
tests/generic/315 +0 -0
old mode 100644
new mode 100755
tests/generic/321 +0 -0
old mode 100644
new mode 100755
tests/generic/322 +0 -0
old mode 100644
new mode 100755
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#10 lore raw

PATCH v2 9/12 xfstests: skip generic/076 which cannot work on tmpfs

In reply to Junho Ryu

Skip generic/076 which tests concurrent access while testing tmpfs because there are other tests cover the case using fsstress.

---

v2: check whether SCRATCH_DEV is a block device instead of checking whether
FSTYP is tmpfs.

 tests/generic/076 | 2 ++
 1 file changed, 2 insertions(+)
tests/generic/076 +2 -0
index a53840f..7ab2fbc 100755
@@ -57,6 +57,8 @@ _supported_os IRIX Linux
 
 _require_scratch
 
+[ -d "$SCRATCH_DEV" ] || _notrun "this test requires block device"
+
 echo "*** init fs"
 
 rm -f $seqres.full
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#11 lore raw

Re: [PATCH v2 09/12] xfstests: skip generic/076 which cannot work on tmpfs

Hi,

here, you were probably looking for -b option (that tests if its argument is a block device) instead of -d option (that tests if its argument is a directory). Otherwise, this patch would skip the test case for an arbitrary file system.

-Boris

----- Original Message -----

Quoted 28 lines

Skip generic/076 which tests concurrent access while testing tmpfs because there are other tests cover the case using fsstress.

---

v2: check whether SCRATCH_DEV is a block device instead of checking whether
FSTYP is tmpfs.

 tests/generic/076 | 2 ++
 1 file changed, 2 insertions(+)
tests/generic/076 +2 -1
index a53840f..7ab2fbc 100755
@@ -57,6 +57,8 @@ _supported_os IRIX Linux
 
 _require_scratch
 
+[ -d "$SCRATCH_DEV" ] || _notrun "this test requires block device"
+
 echo "*** init fs"
 
 rm -f $seqres.full
--
Quoted 3 lines

1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

author
#12 lore raw

PATCH v2 10/12 xfstests: do not unmount tmpfs during remount.

In reply to Junho Ryu

Several tests unmount then re-mount the scratch filesystem, to check that the content is unchanged; but unmounting a tmpfs is designed to lose its content, which causes such tests to fail unnecessarily. Add _scratch_remount(), which instead uses remount on a tmpfs to preserve its contents. Also add _test_remount() to do the same for the test device.

---

v2: same as v1

 common/rc             | 34 ++++++++++++++++++++++++++++++++--
 tests/generic/135     | 17 +++--------------
 tests/generic/169     | 20 ++++++--------------
 tests/generic/169.out |  6 ++----
 tests/generic/192     |  3 +--
 tests/generic/226     |  3 +--
 tests/generic/258     |  3 +--
 tests/generic/306     |  3 +--
 8 files changed, 47 insertions(+), 42 deletions(-)
common/rc +32 -2
index 9e0e727..3b2f812 100644
@@ -302,8 +302,20 @@ _scratch_unmount()
 
 _scratch_remount()
 {
-    _scratch_unmount
-    _scratch_mount
+    CWD=`pwd`
+    cd /
+
+    case $FSTYP in
+    tmpfs)
+        mount -o remount "$@" $SCRATCH_MNT
+        ;;
+    *)
+        _scratch_unmount
+        _scratch_mount "$@"
+        ;;
+    esac
+
+    cd $CWD
 }
 
 _test_mount()
@@ -312,6 +324,24 @@ _test_mount()
     _mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR
 }
 
+_test_remount()
+{
+    CWD=`pwd`
+    cd /
+
+    case $FSTYP in
+    tmpfs)
+        mount -o remount "$@" $TEST_DIR
+        ;;
+    *)
+        umount $TEST_DIR
+        _test_mount "$@"
+        ;;
+    esac
+
+    cd $CWD
+}
+
 _scratch_mkfs_options()
 {
     _scratch_options mkfs
tests/generic/135 +3 -14
index 79558f5..cfa9779 100755
@@ -41,19 +41,8 @@ _supported_os Linux IRIX
 
 _require_odirect
 _require_scratch
-_scratch_mkfs >/dev/null 2>&1
-
-_umount_mount()
-{
-    CWD=`pwd`
-    cd /
-    # pipe error into /dev/null, in case not mounted (after _require_scratch)
-    umount $SCRATCH_MNT 2>/dev/null
-    _scratch_mount
-    cd "$CWD"
-}
-
-_umount_mount
+_scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed"
+_scratch_mount > /dev/null 2>&1 || _fail "mount failed"
 
 cd $SCRATCH_MNT
 
@@ -71,7 +60,7 @@ $XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x78 0 4k' trunc_file > /dev/null
 $XFS_IO_PROG -f -c 'truncate 2k' trunc_file > /dev/null
 $XFS_IO_PROG -c 'pwrite 1k 0 1k' trunc_file > /dev/null
 
-_umount_mount
+_scratch_remount
 
 # check file size and contents
 od -Ad -x async_file
tests/generic/169 +6 -14
index ebeffa7..ebfb106 100755
@@ -73,13 +73,9 @@ $XFS_IO_PROG -a -c "pwrite 0 5k" -c "fsync" \
 	$SCRATCH_MNT/testfile \
 	| _show_wrote_and_stat_only
 
-echo "# unmounting scratch"
-umount $SCRATCH_MNT>>$seqres.full 2>&1 \
-    || _fail "unmount failed"
-
-echo "# mounting scratch"
-_scratch_mount >>$seqres.full 2>&1 \
-    || _fail "mount failed: $MOUNT_OPTIONS"
+echo "# remounting scratch"
+_scratch_remount >>$seqres.full 2>&1 \
+    || _fail "remount failed: $MOUNT_OPTIONS"
 
 echo "# stating file to confirm correct size"
 $XFS_IO_PROG -r -c "stat" $SCRATCH_MNT/testfile \
@@ -90,13 +86,9 @@ $XFS_IO_PROG -f -c "pwrite 0 5" -c s -c "pwrite 5 5" \
 	-c "stat" $SCRATCH_MNT/nextfile \
 	| _show_wrote_and_stat_only
 
-echo "# unmounting scratch"
-umount $SCRATCH_MNT>>$seqres.full 2>&1 \
-    || _fail "unmount failed"
-
-echo "# mounting scratch"
-_scratch_mount >>$seqres.full 2>&1 \
-    || _fail "mount failed: $MOUNT_OPTIONS"
+echo "# remounting scratch"
+_scratch_remount >>$seqres.full 2>&1 \
+    || _fail "remount failed: $MOUNT_OPTIONS"
 
 echo "# stating file to confirm correct size"
 $XFS_IO_PROG -r -c "stat" $SCRATCH_MNT/nextfile \
tests/generic/169.out +2 -4
index 22a5b77..5f7df39 100644
@@ -5,15 +5,13 @@ wrote 5120/5120 bytes at offset 0
 wrote 5120/5120 bytes at offset 5120
 wrote 5120/5120 bytes at offset 10240
 stat.size = 15360
-# unmounting scratch
-# mounting scratch
+# remounting scratch
 # stating file to confirm correct size
 stat.size = 15360
 # appending 10 bytes to new file, sync at 5 bytes
 wrote 5/5 bytes at offset 0
 wrote 5/5 bytes at offset 5
 stat.size = 10
-# unmounting scratch
-# mounting scratch
+# remounting scratch
 # stating file to confirm correct size
 stat.size = 10
tests/generic/192 +1 -2
index 2b4e41c..ec069b0 100755
@@ -76,8 +76,7 @@ cat $testfile
 time2=`_access_time $testfile | tee -a $seqres.full`
 
 cd /
-umount $TEST_DIR
-_test_mount
+_test_remount
 time3=`_access_time $testfile | tee -a $seqres.full`
 
 delta1=`expr $time2 - $time1`
tests/generic/226 +1 -2
index 4ad56a5..1327c9e 100755
@@ -61,8 +61,7 @@ for I in `seq 1 $loops`; do
 done
 
 echo
-umount $SCRATCH_DEV
-_scratch_mount
+_scratch_remount
 
 echo "--> $loops direct 64m writes in a loop"
 for I in `seq 1 $loops`; do
tests/generic/258 +1 -2
index 3aeb5ce..567a39a 100755
@@ -61,8 +61,7 @@ fi
 
 # unmount, remount, and check the timestamp
 echo "Remounting to flush cache"
-umount $TEST_DEV
-_test_mount
+_test_remount
 
 # Should yield -315593940 (prior to epoch)
 echo "Testing for negative seconds since epoch"
tests/generic/306 +1 -2
index 04d28df..56313f2 100755
@@ -66,8 +66,7 @@ touch $BINDFILE || _fail "Could not create bind mount file"
 touch $TARGET || _fail "Could not create symlink target"
 ln -s $TARGET $SYMLINK
 
-_scratch_unmount || _fail "Could not unmount scratch device"
-_scratch_mount -o ro || _fail "Could not mount scratch readonly"
+_scratch_remount -o ro || _fail "Could not remount scratch readonly"
 
 # We should be able to read & write to/from these devices even on an RO fs
 echo "== try to create new file"
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#13 lore raw

PATCH v2 11/12 xfstests: do not unmount before calling _check_scratch_fs()

In reply to Junho Ryu

Many tests do not unmount SCRATCH_DEV before calling _check_scratch_fs(). Change generic/053 to call check a filesystem without unmounting the device.

---

v2: extracted from patch 9

 tests/generic/053 | 2 --
 1 file changed, 2 deletions(-)
tests/generic/053 +0 -2
index b8bd9e6..cf46a93 100755
@@ -81,9 +81,7 @@ list_acls()
 
 echo "acls before repair:"
 list_acls
-_do 'unmount $SCRATCH_DEV' 'umount $SCRATCH_DEV'
 _do 'repair filesystem' '_check_scratch_fs'
-_do 'mount filesytem' '_scratch_mount'
 echo "acls after repair: "
 list_acls
 
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#14 lore raw

PATCH v2 12/12 xfstests: check if filesystem supports chattr

In reply to Junho Ryu

Add _require_chattr which verifies exit code of chattr command and call it before running generic/277.

---

v2: extracted from patch 9

 common/attr       | 13 +++++++++++++
 tests/generic/277 |  2 ++
 2 files changed, 15 insertions(+)
common/attr +13 -0
index 4a3ac9e..278633f 100644
@@ -218,5 +218,18 @@ else # Assume max ~1 block of attrs
 fi
 
 export MAX_ATTRVAL_SIZE
+
+_require_chattr()
+{
+    touch $TEST_DIR/syscalltest
+    chattr +A $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1
+    if [ $? -ne 0 ]; then
+      _notrun "chattr has failed to change attribute of a file in TEST_DIR"
+    fi
+    cat $TEST_DIR/syscalltest.out >> $seqres.full
+
+    rm -f $TEST_DIR/syscalltest.out
+}
+
 # make sure this script returns success
 /bin/true
tests/generic/277 +2 -0
index 8461ad9..c31f7c4 100755
@@ -38,11 +38,13 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
+. ./common/attr
 
 # real QA test starts here
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_chattr
 
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount
Signature · 6 lines
1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#15 lore raw

Re: [PATCH v2 12/12] xfstests: check if filesystem supports chattr

Hi Christoph,

I'm not sure what you meant by "it might be worth to have a common _require_chattr helper chared with generic/079". I cannot find "chattr" in "generic/079".

Regards,
Junho

Quoted 54 lines · Junho Ryu

Add _require_chattr which verifies exit code of chattr command and call it before running generic/277.

---

v2: extracted from patch 9

 common/attr       | 13 +++++++++++++
 tests/generic/277 |  2 ++
 2 files changed, 15 insertions(+)
common/attr +13 -0
index 4a3ac9e..278633f 100644
@@ -218,5 +218,18 @@ else # Assume max ~1 block of attrs
 fi
 
 export MAX_ATTRVAL_SIZE
+
+_require_chattr()
+{
+    touch $TEST_DIR/syscalltest
+    chattr +A $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1
+    if [ $? -ne 0 ]; then
+      _notrun "chattr has failed to change attribute of a file in TEST_DIR"
+    fi
+    cat $TEST_DIR/syscalltest.out >> $seqres.full
+
+    rm -f $TEST_DIR/syscalltest.out
+}
+
 # make sure this script returns success
 /bin/true
tests/generic/277 +2 -1
index 8461ad9..c31f7c4 100755
@@ -38,11 +38,13 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
+. ./common/attr
 
 # real QA test starts here
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_chattr
 
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount
--
Quoted 2 lines

1.8.5.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs