bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests: skip failing test on FS/system that lack SEEK_HOLE su


From: Jim Meyering
Subject: Re: [PATCH] tests: skip failing test on FS/system that lack SEEK_HOLE support
Date: Thu, 02 Aug 2012 15:35:29 +0200

Jim Meyering wrote:

> For now at least, I want to continue to be able run "expensive"
> tests, so added this explicit test for SEEK_HOLE support.
> If not available (e.g., on ext4 and tmpfs), skip it.
> Otherwise, modern linux w/{btrfs,xfs,ocfs2}, run the test.
>
>>From 5f2b9f161777f883225e8b4c8f1303e42b3a4978 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <address@hidden>
> Date: Thu, 2 Aug 2012 14:58:57 +0200
> Subject: [PATCH] tests: skip failing test on FS/system that lack SEEK_HOLE
>  support
>
> * tests/big-hole: Test for SEEK_HOLE support.  If not available,
> skip this test.  Hence, this test is now skipped on linux-3.5.0 with
> ext4 or tmpfs.  The test runs (and passes) with at least btrfs, xfs,
> or ocfs2.
> ---
>  tests/big-hole | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/tests/big-hole b/tests/big-hole
> index 20ade97..df9fa32 100755
> --- a/tests/big-hole
> +++ b/tests/big-hole
> @@ -5,6 +5,12 @@
>
>  expensive_
>
> +# Skip this test if there is no usable SEEK_HOLE support,
> +# as is the case with linux-3.5.0 on ext4 and tmpfs file systems.
> +perl -e '$f=*STDERR; sysseek($f,2**22,0); syswrite($f,"a");' \

Not quite.
This is the first use of perl, so it's better to add a configure-time
check for it and use $PERL in place of "perl".
Then when it's missing you'll get a better diagnostic.
Here's the revised patch:

>From 97b9d2b5e88367d39663a09a485b83857bc63180 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 2 Aug 2012 14:58:57 +0200
Subject: [PATCH] tests: skip failing test on FS/system that lack SEEK_HOLE
 support

* tests/big-hole: Test for SEEK_HOLE support.  If not available,
skip this test.  Hence, this test is now skipped on linux-3.5.0 with
ext4 or tmpfs.  The test runs (and passes) with at least btrfs, xfs,
or ocfs2.
* bootstrap.conf (gnulib_modules): Use the perl module.
---
 bootstrap.conf | 1 +
 tests/big-hole | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/bootstrap.conf b/bootstrap.conf
index f89a56e..c47954d 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -61,6 +61,7 @@ mempcpy
 minmax
 obstack
 openat-safer
+perl
 progname
 propername
 quote
diff --git a/tests/big-hole b/tests/big-hole
index 20ade97..f1c5121 100755
--- a/tests/big-hole
+++ b/tests/big-hole
@@ -5,6 +5,12 @@

 expensive_

+# Skip this test if there is no usable SEEK_HOLE support,
+# as is the case with linux-3.5.0 on ext4 and tmpfs file systems.
+$PERL -e '$f=*STDERR; sysseek($f,2**22,0); syswrite($f,"a");' \
+    -e 'exit !!(0+sysseek($f,0,4))' 2> seek-hole-test \
+  || skip_ "this system/FS lacks SEEK_HOLE support"
+
 # Try to make this test not THAT expensive, on typical hosts.
 virtual_memory_KiB=10240
 if echo x | (ulimit -v $virtual_memory_KiB && grep x) >/dev/null 2>&1; then
--
1.7.12.rc1.10.g97c7934



reply via email to

[Prev in Thread] Current Thread [Next in Thread]