* [PATCH] xfstests: add _require_seek_data_hole to check seek data/hole
@ 2013-03-26 9:14 Zheng Liu
2013-04-05 14:54 ` Rich Johnston
0 siblings, 1 reply; 3+ messages in thread
From: Zheng Liu @ 2013-03-26 9:14 UTC (permalink / raw)
To: xfs; +Cc: Zheng Liu
From: Zheng Liu <wenqing.lz@taobao.com>
In xfstests 285 and 286 we don't check whether the target file system
supports seek data/hole operation or not. Here _require_seek_data_hole
is defined to do this work.
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
285 | 1 +
286 | 2 ++
common.rc | 12 ++++++++++++
src/seek_sanity_test.c | 19 ++++++++++++++-----
4 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/285 b/285
index 8726b9e..4cad633 100644
--- a/285
+++ b/285
@@ -42,6 +42,7 @@ _supported_fs generic
_supported_os Linux
_require_xfs_io_falloc
+_require_seek_data_hole
BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile
diff --git a/286 b/286
index 9567244..6f34724 100644
--- a/286
+++ b/286
@@ -39,6 +39,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fs generic
_supported_os Linux
+_require_seek_data_hole
+
src=$TEST_DIR/seek_copy_testfile
dest=$TEST_DIR/seek_copy_testfile.dest
diff --git a/common.rc b/common.rc
index 319680d..3c01211 100644
--- a/common.rc
+++ b/common.rc
@@ -1205,6 +1205,18 @@ _require_fail_make_request()
not found. Seems that CONFIG_FAIL_MAKE_REQUEST kernel config option not enabled"
}
+#
+# Check if the file system supports seek_data/hole.
+#
+_require_seek_data_hole()
+{
+ testfile=$TEST_DIR/$$.seek
+ testseek=`$here/src/seek_sanity_test -t $testfile 2>&1`
+ rm -f $testfile &>/dev/null
+ echo $testseek | grep -q "Kernel does not support" && \
+ _notrun "File system does not support llseek(2) SEEK_DATA/HOLE"
+}
+
# check that a FS on a device is mounted
# if so, return mount point
#
diff --git a/src/seek_sanity_test.c b/src/seek_sanity_test.c
index 3897f02..3b5217b 100644
--- a/src/seek_sanity_test.c
+++ b/src/seek_sanity_test.c
@@ -660,17 +660,26 @@ int main(int argc, char **argv)
{
int ret = -1;
int i = 0;
+ int opt;
+ int check_support = 0;
int numtests = sizeof(seek_tests) / sizeof(struct testrec);
- if (argc != 2) {
- fprintf(stdout, "Usage: %s base_file_path\n", argv[0]);
- return ret;
+ while ((opt = getopt(argc, argv, "t")) != -1) {
+ switch (opt) {
+ case 't':
+ check_support++;
+ break;
+ default:
+ fprintf(stdout, "Usage: %s [-t] base_file_path\n",
+ argv[0]);
+ return ret;
+ }
}
- base_file_path = (char *)strdup(argv[1]);
+ base_file_path = (char *)strdup(argv[optind]);
ret = test_basic_support();
- if (ret)
+ if (ret || check_support)
goto out;
for (i = 0; i < numtests; ++i) {
--
1.7.12.rc2.18.g61b472e
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfstests: add _require_seek_data_hole to check seek data/hole
2013-03-26 9:14 [PATCH] xfstests: add _require_seek_data_hole to check seek data/hole Zheng Liu
@ 2013-04-05 14:54 ` Rich Johnston
2013-04-08 3:59 ` Zheng Liu
0 siblings, 1 reply; 3+ messages in thread
From: Rich Johnston @ 2013-04-05 14:54 UTC (permalink / raw)
To: Zheng Liu; +Cc: Zheng Liu, xfs
Looks reasonable, will you please rework this for TOT changes?
tests 285 and 286 are now in the tests/generic directory and
common.rc is now common/rc
Thanks
--Rich
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfstests: add _require_seek_data_hole to check seek data/hole
2013-04-05 14:54 ` Rich Johnston
@ 2013-04-08 3:59 ` Zheng Liu
0 siblings, 0 replies; 3+ messages in thread
From: Zheng Liu @ 2013-04-08 3:59 UTC (permalink / raw)
To: Rich Johnston; +Cc: Zheng Liu, xfs
On Fri, Apr 05, 2013 at 09:54:29AM -0500, Rich Johnston wrote:
> Looks reasonable, will you please rework this for TOT changes?
>
> tests 285 and 286 are now in the tests/generic directory and
> common.rc is now common/rc
Thanks for pointing it out. I will rework this patch.
Regards,
- Zheng
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-08 3:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-26 9:14 [PATCH] xfstests: add _require_seek_data_hole to check seek data/hole Zheng Liu
2013-04-05 14:54 ` Rich Johnston
2013-04-08 3:59 ` Zheng Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox