* [PATCH v2 01/12] xfstests: use mount point instead of device name
@ 2013-12-17 22:18 Junho Ryu
2013-12-17 22:18 ` [PATCH v2 02/12] xfstests: _scratch_mkfs_sized() for tmpfs Junho Ryu
` (10 more replies)
0 siblings, 11 replies; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, Junho Ryu
From: Hugh Dickins <hughd@google.com>
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
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Junho Ryu <jayr@google.com>
---
v2: same as v1
tests/generic/256 | 2 +-
tests/generic/273 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/generic/256 b/tests/generic/256
index cfe7237..c6c8f2f 100755
--- a/tests/generic/256
+++ b/tests/generic/256
@@ -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
diff --git a/tests/generic/273 b/tests/generic/273
index 8e121a2..dc87a92 100755
--- a/tests/generic/273
+++ b/tests/generic/273
@@ -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
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 02/12] xfstests: _scratch_mkfs_sized() for tmpfs
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
@ 2013-12-17 22:18 ` Junho Ryu
2013-12-18 5:33 ` Boris Ranto
2013-12-17 22:18 ` [PATCH v2 03/12] xfstests: increase tmpfs memory size Junho Ryu
` (9 subsequent siblings)
10 siblings, 1 reply; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, Junho Ryu
From: Hugh Dickins <hughd@google.com>
_scratch_mkfs_sized() avoid blockdev and update MOUNT_OPTIONS with
required size on tmpfs, so those tests using it can now run.
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Junho Ryu <jayr@google.com>
---
v2: same as v1
common/rc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/common/rc b/common/rc
index a2005c9..c78356e 100644
--- a/common/rc
+++ b/common/rc
@@ -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"
;;
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 03/12] xfstests: increase tmpfs memory size
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
2013-12-17 22:18 ` [PATCH v2 02/12] xfstests: _scratch_mkfs_sized() for tmpfs Junho Ryu
@ 2013-12-17 22:18 ` Junho Ryu
2013-12-17 22:21 ` Junho Ryu
2013-12-17 22:18 ` [PATCH v2 04/12] xfstests: rename _require_xfs_io_fiemap to _require_fiemap Junho Ryu
` (8 subsequent siblings)
10 siblings, 1 reply; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, Junho Ryu
512M is not enough for generic/129, generic/213 and generic/247. Raise
default tmpfs size to 1G.
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Junho Ryu <jayr@google.com>
---
v2: same as v1
common/rc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/common/rc b/common/rc
index c78356e..45a45b0 100644
--- a/common/rc
+++ b/common/rc
@@ -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
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 04/12] xfstests: rename _require_xfs_io_fiemap to _require_fiemap
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
2013-12-17 22:18 ` [PATCH v2 02/12] xfstests: _scratch_mkfs_sized() for tmpfs Junho Ryu
2013-12-17 22:18 ` [PATCH v2 03/12] xfstests: increase tmpfs memory size Junho Ryu
@ 2013-12-17 22:18 ` Junho Ryu
2013-12-17 22:18 ` [PATCH v2 05/12] xfstests: fix generic/225 to check fiemap support Junho Ryu
` (7 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, 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.
Signed-off-by: Junho Ryu <jayr@google.com>
---
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(-)
diff --git a/common/defrag b/common/defrag
index a4bc976..81b58e7 100644
--- a/common/defrag
+++ b/common/defrag
@@ -38,7 +38,7 @@ _require_defrag()
esac
_require_command $DEFRAG_PROG
- _require_xfs_io_fiemap
+ _require_fiemap
}
_extent_count()
diff --git a/common/rc b/common/rc
index 45a45b0..1db313b 100644
--- a/common/rc
+++ b/common/rc
@@ -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" \
diff --git a/tests/generic/255 b/tests/generic/255
index dd329b4..739629c 100755
--- a/tests/generic/255
+++ b/tests/generic/255
@@ -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.$$
diff --git a/tests/generic/316 b/tests/generic/316
index 8cb2975..4bb6c4a 100755
--- a/tests/generic/316
+++ b/tests/generic/316
@@ -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.$$
diff --git a/tests/shared/298 b/tests/shared/298
index 4541798..e8c3d48 100755
--- a/tests/shared/298
+++ b/tests/shared/298
@@ -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
diff --git a/tests/xfs/252 b/tests/xfs/252
index 00be41a..1a5133e 100755
--- a/tests/xfs/252
+++ b/tests/xfs/252
@@ -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.$$
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 05/12] xfstests: fix generic/225 to check fiemap support
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
` (2 preceding siblings ...)
2013-12-17 22:18 ` [PATCH v2 04/12] xfstests: rename _require_xfs_io_fiemap to _require_fiemap Junho Ryu
@ 2013-12-17 22:18 ` Junho Ryu
2013-12-17 22:18 ` [PATCH v2 06/12] xfstests: fix generic/127 to call _cleanup() only once Junho Ryu
` (6 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, Junho Ryu
generic/225 runs fiemap. Check fiemap support like other tests which
use fiemap.
Signed-off-by: Junho Ryu <jayr@google.com>
---
v2: renamed _require_xfs_io_fiemap to _require_fiemap
tests/generic/225 | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/generic/225 b/tests/generic/225
index 73b125a..1fb1f94 100755
--- a/tests/generic/225
+++ b/tests/generic/225
@@ -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
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 06/12] xfstests: fix generic/127 to call _cleanup() only once
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
` (3 preceding siblings ...)
2013-12-17 22:18 ` [PATCH v2 05/12] xfstests: fix generic/225 to check fiemap support Junho Ryu
@ 2013-12-17 22:18 ` Junho Ryu
2013-12-17 22:18 ` [PATCH v2 07/12] xfstests: check O_DIRECT support before testing direct I/O Junho Ryu
` (5 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, Junho Ryu
The test is already trap-ing signal 0 (EXIT). umount prints error
message when target tmpfs is already unmounted.
Signed-off-by: Junho Ryu <jayr@google.com>
---
v2: same as v1
tests/generic/127 | 1 -
1 file changed, 1 deletion(-)
diff --git a/tests/generic/127 b/tests/generic/127
index 58ca91e..47bd1ca 100755
--- a/tests/generic/127
+++ b/tests/generic/127
@@ -117,5 +117,4 @@ _fsx_std_nommap
_fsx_std_mmap
status=0
-_cleanup
exit
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 07/12] xfstests: check O_DIRECT support before testing direct I/O
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
` (4 preceding siblings ...)
2013-12-17 22:18 ` [PATCH v2 06/12] xfstests: fix generic/127 to call _cleanup() only once Junho Ryu
@ 2013-12-17 22:18 ` Junho Ryu
2013-12-17 22:18 ` [PATCH v2 08/12] xfstests: add executable permission to tests Junho Ryu
` (4 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, Junho Ryu
Some filesystems do not support O_DIRECT. Check whether TEST_DIR supports it
by running xfs_io with and without -d flag.
Signed-off-by: Junho Ryu <jayr@google.com>
---
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(+)
diff --git a/common/rc b/common/rc
index 1db313b..9e0e727 100644
--- a/common/rc
+++ b/common/rc
@@ -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()
diff --git a/tests/generic/091 b/tests/generic/091
index bb176f1..bb5c92c 100755
--- a/tests/generic/091
+++ b/tests/generic/091
@@ -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
diff --git a/tests/generic/130 b/tests/generic/130
index 8367dc7..1e96630 100755
--- a/tests/generic/130
+++ b/tests/generic/130
@@ -50,6 +50,7 @@ _supported_os Linux IRIX
_require_scratch
_require_sparse_files
+_require_odirect
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
diff --git a/tests/generic/133 b/tests/generic/133
index 7fb1695..8af4dde 100755
--- a/tests/generic/133
+++ b/tests/generic/133
@@ -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
diff --git a/tests/generic/135 b/tests/generic/135
index e3b827a..79558f5 100755
--- a/tests/generic/135
+++ b/tests/generic/135
@@ -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
diff --git a/tests/generic/226 b/tests/generic/226
index b98e889..4ad56a5 100755
--- a/tests/generic/226
+++ b/tests/generic/226
@@ -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
diff --git a/tests/generic/263 b/tests/generic/263
index bc59865..f639215 100755
--- a/tests/generic/263
+++ b/tests/generic/263
@@ -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
diff --git a/tests/generic/299 b/tests/generic/299
index 14cce96..c674542 100755
--- a/tests/generic/299
+++ b/tests/generic/299
@@ -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`
diff --git a/tests/generic/300 b/tests/generic/300
index 7c60728..9231cb7 100755
--- a/tests/generic/300
+++ b/tests/generic/300
@@ -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`
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 08/12] xfstests: add executable permission to tests
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
` (5 preceding siblings ...)
2013-12-17 22:18 ` [PATCH v2 07/12] xfstests: check O_DIRECT support before testing direct I/O Junho Ryu
@ 2013-12-17 22:18 ` Junho Ryu
2013-12-17 22:18 ` [PATCH v2 09/12] xfstests: skip generic/076 which cannot work on tmpfs Junho Ryu
` (3 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, Junho Ryu
From: Hugh Dickins <hughd@google.com>
add executable permission to generic/311, generic/314 and generic/315.
Just like other tests in the same directory.
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Junho Ryu <jayr@google.com>
---
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
diff --git a/tests/generic/311 b/tests/generic/311
old mode 100644
new mode 100755
diff --git a/tests/generic/315 b/tests/generic/315
old mode 100644
new mode 100755
diff --git a/tests/generic/321 b/tests/generic/321
old mode 100644
new mode 100755
diff --git a/tests/generic/322 b/tests/generic/322
old mode 100644
new mode 100755
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 09/12] xfstests: skip generic/076 which cannot work on tmpfs
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
` (6 preceding siblings ...)
2013-12-17 22:18 ` [PATCH v2 08/12] xfstests: add executable permission to tests Junho Ryu
@ 2013-12-17 22:18 ` Junho Ryu
2013-12-18 5:20 ` Boris Ranto
2013-12-17 22:18 ` [PATCH v2 10/12] xfstests: do not unmount tmpfs during remount Junho Ryu
` (2 subsequent siblings)
10 siblings, 1 reply; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, Junho Ryu
Skip generic/076 which tests concurrent access while testing tmpfs
because there are other tests cover the case using fsstress.
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Junho Ryu <jayr@google.com>
---
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(+)
diff --git a/tests/generic/076 b/tests/generic/076
index a53840f..7ab2fbc 100755
--- a/tests/generic/076
+++ b/tests/generic/076
@@ -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
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 10/12] xfstests: do not unmount tmpfs during remount.
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
` (7 preceding siblings ...)
2013-12-17 22:18 ` [PATCH v2 09/12] xfstests: skip generic/076 which cannot work on tmpfs Junho Ryu
@ 2013-12-17 22:18 ` Junho Ryu
2013-12-17 22:18 ` [PATCH v2 11/12] xfstests: do not unmount before calling _check_scratch_fs() Junho Ryu
2013-12-17 22:18 ` [PATCH v2 12/12] xfstests: check if filesystem supports chattr Junho Ryu
10 siblings, 0 replies; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, 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.
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Junho Ryu <jayr@google.com>
---
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(-)
diff --git a/common/rc b/common/rc
index 9e0e727..3b2f812 100644
--- a/common/rc
+++ b/common/rc
@@ -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
diff --git a/tests/generic/135 b/tests/generic/135
index 79558f5..cfa9779 100755
--- a/tests/generic/135
+++ b/tests/generic/135
@@ -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
diff --git a/tests/generic/169 b/tests/generic/169
index ebeffa7..ebfb106 100755
--- a/tests/generic/169
+++ b/tests/generic/169
@@ -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 \
diff --git a/tests/generic/169.out b/tests/generic/169.out
index 22a5b77..5f7df39 100644
--- a/tests/generic/169.out
+++ b/tests/generic/169.out
@@ -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
diff --git a/tests/generic/192 b/tests/generic/192
index 2b4e41c..ec069b0 100755
--- a/tests/generic/192
+++ b/tests/generic/192
@@ -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`
diff --git a/tests/generic/226 b/tests/generic/226
index 4ad56a5..1327c9e 100755
--- a/tests/generic/226
+++ b/tests/generic/226
@@ -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
diff --git a/tests/generic/258 b/tests/generic/258
index 3aeb5ce..567a39a 100755
--- a/tests/generic/258
+++ b/tests/generic/258
@@ -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"
diff --git a/tests/generic/306 b/tests/generic/306
index 04d28df..56313f2 100755
--- a/tests/generic/306
+++ b/tests/generic/306
@@ -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"
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 11/12] xfstests: do not unmount before calling _check_scratch_fs()
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
` (8 preceding siblings ...)
2013-12-17 22:18 ` [PATCH v2 10/12] xfstests: do not unmount tmpfs during remount Junho Ryu
@ 2013-12-17 22:18 ` Junho Ryu
2013-12-17 22:18 ` [PATCH v2 12/12] xfstests: check if filesystem supports chattr Junho Ryu
10 siblings, 0 replies; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, 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.
Signed-off-by: Junho Ryu <jayr@google.com>
---
v2: extracted from patch 9
tests/generic/053 | 2 --
1 file changed, 2 deletions(-)
diff --git a/tests/generic/053 b/tests/generic/053
index b8bd9e6..cf46a93 100755
--- a/tests/generic/053
+++ b/tests/generic/053
@@ -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
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 12/12] xfstests: check if filesystem supports chattr
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
` (9 preceding siblings ...)
2013-12-17 22:18 ` [PATCH v2 11/12] xfstests: do not unmount before calling _check_scratch_fs() Junho Ryu
@ 2013-12-17 22:18 ` Junho Ryu
2013-12-17 22:23 ` Junho Ryu
10 siblings, 1 reply; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:18 UTC (permalink / raw)
To: xfs; +Cc: tytso, hughd, branto, Junho Ryu
Add _require_chattr which verifies exit code of chattr command and call
it before running generic/277.
Signed-off-by: Junho Ryu <jayr@google.com>
---
v2: extracted from patch 9
common/attr | 13 +++++++++++++
tests/generic/277 | 2 ++
2 files changed, 15 insertions(+)
diff --git a/common/attr b/common/attr
index 4a3ac9e..278633f 100644
--- a/common/attr
+++ b/common/attr
@@ -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
diff --git a/tests/generic/277 b/tests/generic/277
index 8461ad9..c31f7c4 100755
--- a/tests/generic/277
+++ b/tests/generic/277
@@ -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
--
1.8.5.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 03/12] xfstests: increase tmpfs memory size
2013-12-17 22:18 ` [PATCH v2 03/12] xfstests: increase tmpfs memory size Junho Ryu
@ 2013-12-17 22:21 ` Junho Ryu
0 siblings, 0 replies; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:21 UTC (permalink / raw)
To: xfs, Christoph Hellwig
Cc: Theodore Ts'o, Hugh Dickins, Boris Ranto, Junho Ryu
Hi Christoph,
I'm sorry. Patch 1 has been committed before I fold it into the first
patch as you have suggested.
Regards,
Junho
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 12/12] xfstests: check if filesystem supports chattr
2013-12-17 22:18 ` [PATCH v2 12/12] xfstests: check if filesystem supports chattr Junho Ryu
@ 2013-12-17 22:23 ` Junho Ryu
0 siblings, 0 replies; 16+ messages in thread
From: Junho Ryu @ 2013-12-17 22:23 UTC (permalink / raw)
To: xfs, Christoph Hellwig
Cc: Theodore Ts'o, Hugh Dickins, Boris Ranto, Junho Ryu
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
On Tue, Dec 17, 2013 at 2:18 PM, Junho Ryu <jayr@google.com> wrote:
> Add _require_chattr which verifies exit code of chattr command and call
> it before running generic/277.
>
> Signed-off-by: Junho Ryu <jayr@google.com>
> ---
>
> v2: extracted from patch 9
>
> common/attr | 13 +++++++++++++
> tests/generic/277 | 2 ++
> 2 files changed, 15 insertions(+)
>
> diff --git a/common/attr b/common/attr
> index 4a3ac9e..278633f 100644
> --- a/common/attr
> +++ b/common/attr
> @@ -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
> diff --git a/tests/generic/277 b/tests/generic/277
> index 8461ad9..c31f7c4 100755
> --- a/tests/generic/277
> +++ b/tests/generic/277
> @@ -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
> --
> 1.8.5.1
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 09/12] xfstests: skip generic/076 which cannot work on tmpfs
2013-12-17 22:18 ` [PATCH v2 09/12] xfstests: skip generic/076 which cannot work on tmpfs Junho Ryu
@ 2013-12-18 5:20 ` Boris Ranto
0 siblings, 0 replies; 16+ messages in thread
From: Boris Ranto @ 2013-12-18 5:20 UTC (permalink / raw)
To: Junho Ryu; +Cc: tytso, hughd, xfs
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 -----
> Skip generic/076 which tests concurrent access while testing tmpfs
> because there are other tests cover the case using fsstress.
>
> Signed-off-by: Hugh Dickins <hughd@google.com>
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Signed-off-by: Junho Ryu <jayr@google.com>
> ---
>
> 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(+)
>
> diff --git a/tests/generic/076 b/tests/generic/076
> index a53840f..7ab2fbc 100755
> --- a/tests/generic/076
> +++ b/tests/generic/076
> @@ -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
> --
> 1.8.5.1
>
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 02/12] xfstests: _scratch_mkfs_sized() for tmpfs
2013-12-17 22:18 ` [PATCH v2 02/12] xfstests: _scratch_mkfs_sized() for tmpfs Junho Ryu
@ 2013-12-18 5:33 ` Boris Ranto
0 siblings, 0 replies; 16+ messages in thread
From: Boris Ranto @ 2013-12-18 5:33 UTC (permalink / raw)
To: Junho Ryu; +Cc: tytso, hughd, xfs
Same here, the patch uses -d instead of -b option.
----- Original Message -----
> From: Hugh Dickins <hughd@google.com>
>
> _scratch_mkfs_sized() avoid blockdev and update MOUNT_OPTIONS with
> required size on tmpfs, so those tests using it can now run.
>
> Signed-off-by: Hugh Dickins <hughd@google.com>
> Signed-off-by: Junho Ryu <jayr@google.com>
> ---
>
> v2: same as v1
>
> common/rc | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/common/rc b/common/rc
> index a2005c9..c78356e 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -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"
> ;;
> --
> 1.8.5.1
>
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2013-12-18 5:33 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-17 22:18 [PATCH v2 01/12] xfstests: use mount point instead of device name Junho Ryu
2013-12-17 22:18 ` [PATCH v2 02/12] xfstests: _scratch_mkfs_sized() for tmpfs Junho Ryu
2013-12-18 5:33 ` Boris Ranto
2013-12-17 22:18 ` [PATCH v2 03/12] xfstests: increase tmpfs memory size Junho Ryu
2013-12-17 22:21 ` Junho Ryu
2013-12-17 22:18 ` [PATCH v2 04/12] xfstests: rename _require_xfs_io_fiemap to _require_fiemap Junho Ryu
2013-12-17 22:18 ` [PATCH v2 05/12] xfstests: fix generic/225 to check fiemap support Junho Ryu
2013-12-17 22:18 ` [PATCH v2 06/12] xfstests: fix generic/127 to call _cleanup() only once Junho Ryu
2013-12-17 22:18 ` [PATCH v2 07/12] xfstests: check O_DIRECT support before testing direct I/O Junho Ryu
2013-12-17 22:18 ` [PATCH v2 08/12] xfstests: add executable permission to tests Junho Ryu
2013-12-17 22:18 ` [PATCH v2 09/12] xfstests: skip generic/076 which cannot work on tmpfs Junho Ryu
2013-12-18 5:20 ` Boris Ranto
2013-12-17 22:18 ` [PATCH v2 10/12] xfstests: do not unmount tmpfs during remount Junho Ryu
2013-12-17 22:18 ` [PATCH v2 11/12] xfstests: do not unmount before calling _check_scratch_fs() Junho Ryu
2013-12-17 22:18 ` [PATCH v2 12/12] xfstests: check if filesystem supports chattr Junho Ryu
2013-12-17 22:23 ` Junho Ryu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).