public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4/306: require 64bit feature to run ext4/306
@ 2017-03-01  7:57 Xiao Yang
  2017-03-01  8:59 ` Eryu Guan
  0 siblings, 1 reply; 6+ messages in thread
From: Xiao Yang @ 2017-03-01  7:57 UTC (permalink / raw)
  To: fstests; +Cc: Xiao Yang

The 64bit feature isn't supported by mkfs.ext4 on RHEL6, so
we add _require_ext4_mkfs_64bit to check it.  If 64bit feature
isn't supported, we could skip this case.  This feature has
been produced by 'commit 02d6f47e9647d ("mke2fs: Fix up mke2fs
to be able to make 64-bit file systems")'.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 common/rc      | 7 +++++++
 tests/ext4/306 | 1 +
 2 files changed, 8 insertions(+)

diff --git a/common/rc b/common/rc
index 8f23334..0c3c154 100644
--- a/common/rc
+++ b/common/rc
@@ -1669,6 +1669,13 @@ _require_scratch_ext4_crc()
 	_scratch_unmount
 }
 
+# this test requires the 64bit feature to be available in mkfs.ext4
+_require_ext4_mkfs_64bit()
+{
+	$MKFS_EXT4_PROG -F -O 64bit -n $SCRATCH_DEV 512m >/dev/null 2>&1 \
+	   || _notrun "mkfs.ext4 doesn't have 64bit feature"
+}
+
 # this test requires the bigalloc feature to be available in mkfs.ext4
 #
 _require_ext4_mkfs_bigalloc()
diff --git a/tests/ext4/306 b/tests/ext4/306
index fa3b782..4a92dd2 100755
--- a/tests/ext4/306
+++ b/tests/ext4/306
@@ -44,6 +44,7 @@ _supported_fs ext4
 _supported_os Linux
 
 _require_scratch
+_require_ext4_mkfs_64bit
 
 rm -f $seqres.full
 
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ext4/306: require 64bit feature to run ext4/306
  2017-03-01  7:57 [PATCH] ext4/306: require 64bit feature to run ext4/306 Xiao Yang
@ 2017-03-01  8:59 ` Eryu Guan
  2017-03-02  2:24   ` [PATCH v2] " Xiao Yang
  0 siblings, 1 reply; 6+ messages in thread
From: Eryu Guan @ 2017-03-01  8:59 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests

On Wed, Mar 01, 2017 at 03:57:02PM +0800, Xiao Yang wrote:
> The 64bit feature isn't supported by mkfs.ext4 on RHEL6, so
> we add _require_ext4_mkfs_64bit to check it.  If 64bit feature
> isn't supported, we could skip this case.  This feature has
> been produced by 'commit 02d6f47e9647d ("mke2fs: Fix up mke2fs
> to be able to make 64-bit file systems")'.
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
>  common/rc      | 7 +++++++
>  tests/ext4/306 | 1 +
>  2 files changed, 8 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 8f23334..0c3c154 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1669,6 +1669,13 @@ _require_scratch_ext4_crc()
>  	_scratch_unmount
>  }
>  
> +# this test requires the 64bit feature to be available in mkfs.ext4
> +_require_ext4_mkfs_64bit()
> +{
> +	$MKFS_EXT4_PROG -F -O 64bit -n $SCRATCH_DEV 512m >/dev/null 2>&1 \

I think you can use an fs image file instead of the SCRATCH_DEV, so that
it doesn't assume we have SCRATCH_DEV defined.

Thanks,
Eryu

> +	   || _notrun "mkfs.ext4 doesn't have 64bit feature"
> +}
> +
>  # this test requires the bigalloc feature to be available in mkfs.ext4
>  #
>  _require_ext4_mkfs_bigalloc()
> diff --git a/tests/ext4/306 b/tests/ext4/306
> index fa3b782..4a92dd2 100755
> --- a/tests/ext4/306
> +++ b/tests/ext4/306
> @@ -44,6 +44,7 @@ _supported_fs ext4
>  _supported_os Linux
>  
>  _require_scratch
> +_require_ext4_mkfs_64bit
>  
>  rm -f $seqres.full
>  
> -- 
> 1.8.3.1
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] ext4/306: require 64bit feature to run ext4/306
  2017-03-01  8:59 ` Eryu Guan
@ 2017-03-02  2:24   ` Xiao Yang
  2017-03-02  4:22     ` Eryu Guan
  0 siblings, 1 reply; 6+ messages in thread
From: Xiao Yang @ 2017-03-02  2:24 UTC (permalink / raw)
  To: eguan; +Cc: fstests, Xiao Yang

The 64bit feature isn't supported by mkfs.ext4 on RHEL6, so
we add _require_ext4_mkfs_64bit to check it.  If 64bit feature
isn't supported, we could skip this case.  This feature has
been produced by 'commit 02d6f47e9647d ("mke2fs: Fix up mke2fs
to be able to make 64-bit file systems")'.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 common/rc      | 11 +++++++++++
 tests/ext4/306 |  1 +
 2 files changed, 12 insertions(+)

diff --git a/common/rc b/common/rc
index 8f23334..8c4f1c3 100644
--- a/common/rc
+++ b/common/rc
@@ -1669,6 +1669,17 @@ _require_scratch_ext4_crc()
 	_scratch_unmount
 }
 
+# this test requires the 64bit feature to be available in mkfs.ext4
+_require_ext4_mkfs_64bit()
+{
+	local testfile=$TEST_DIR/$$.64bit
+
+	touch $testfile
+	$MKFS_EXT4_PROG -F -O 64bit -n $testfile 512m >/dev/null 2>&1 \
+	   || _notrun "mkfs.ext4 doesn't have 64bit feature"
+	rm -f $testfile
+}
+
 # this test requires the bigalloc feature to be available in mkfs.ext4
 #
 _require_ext4_mkfs_bigalloc()
diff --git a/tests/ext4/306 b/tests/ext4/306
index fa3b782..4a92dd2 100755
--- a/tests/ext4/306
+++ b/tests/ext4/306
@@ -44,6 +44,7 @@ _supported_fs ext4
 _supported_os Linux
 
 _require_scratch
+_require_ext4_mkfs_64bit
 
 rm -f $seqres.full
 
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ext4/306: require 64bit feature to run ext4/306
  2017-03-02  2:24   ` [PATCH v2] " Xiao Yang
@ 2017-03-02  4:22     ` Eryu Guan
  2017-03-02  4:37       ` Xiao Yang
  2017-03-02  6:03       ` [PATCH v3] ext4: add _require_ext4_mkfs_feature to check different features Xiao Yang
  0 siblings, 2 replies; 6+ messages in thread
From: Eryu Guan @ 2017-03-02  4:22 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests

On Thu, Mar 02, 2017 at 10:24:26AM +0800, Xiao Yang wrote:
> The 64bit feature isn't supported by mkfs.ext4 on RHEL6, so
> we add _require_ext4_mkfs_64bit to check it.  If 64bit feature
> isn't supported, we could skip this case.  This feature has
> been produced by 'commit 02d6f47e9647d ("mke2fs: Fix up mke2fs
> to be able to make 64-bit file systems")'.
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
>  common/rc      | 11 +++++++++++
>  tests/ext4/306 |  1 +
>  2 files changed, 12 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 8f23334..8c4f1c3 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1669,6 +1669,17 @@ _require_scratch_ext4_crc()
>  	_scratch_unmount
>  }
>  
> +# this test requires the 64bit feature to be available in mkfs.ext4
> +_require_ext4_mkfs_64bit()
> +{
> +	local testfile=$TEST_DIR/$$.64bit
> +
> +	touch $testfile
> +	$MKFS_EXT4_PROG -F -O 64bit -n $testfile 512m >/dev/null 2>&1 \
> +	   || _notrun "mkfs.ext4 doesn't have 64bit feature"
> +	rm -f $testfile
> +}

Sorry, I didn't realize earlier that _require_mkfs_mkfs_bigalloc() runs
mkfs test against $SCRATCH_DEV too. Seems we should fix it too.

Can you please factor out a new helper, e.g. _mkfs_ext4_supported(), to
accept mkfs options and return mkfs status? So that _require_ext4_mkfs_*
could use this new helper, just pass different feature bits it wants to
test. e.g.

_require_ext4_mkfs_64bit()
{
	_mkfs_ext4_supported -O 64bit || \
		_notrun "mkfs.ext4 doesn't have 64bit feature"
}

Thanks!

Eryu

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ext4/306: require 64bit feature to run ext4/306
  2017-03-02  4:22     ` Eryu Guan
@ 2017-03-02  4:37       ` Xiao Yang
  2017-03-02  6:03       ` [PATCH v3] ext4: add _require_ext4_mkfs_feature to check different features Xiao Yang
  1 sibling, 0 replies; 6+ messages in thread
From: Xiao Yang @ 2017-03-02  4:37 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests

On 2017/03/02 12:22, Eryu Guan   wrote:
> On Thu, Mar 02, 2017 at 10:24:26AM +0800, Xiao Yang wrote:
>> The 64bit feature isn't supported by mkfs.ext4 on RHEL6, so
>> we add _require_ext4_mkfs_64bit to check it.  If 64bit feature
>> isn't supported, we could skip this case.  This feature has
>> been produced by 'commit 02d6f47e9647d ("mke2fs: Fix up mke2fs
>> to be able to make 64-bit file systems")'.
>>
>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
>> ---
>>   common/rc      | 11 +++++++++++
>>   tests/ext4/306 |  1 +
>>   2 files changed, 12 insertions(+)
>>
>> diff --git a/common/rc b/common/rc
>> index 8f23334..8c4f1c3 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -1669,6 +1669,17 @@ _require_scratch_ext4_crc()
>>   	_scratch_unmount
>>   }
>>
>> +# this test requires the 64bit feature to be available in mkfs.ext4
>> +_require_ext4_mkfs_64bit()
>> +{
>> +	local testfile=$TEST_DIR/$$.64bit
>> +
>> +	touch $testfile
>> +	$MKFS_EXT4_PROG -F -O 64bit -n $testfile 512m>/dev/null 2>&1 \
>> +	   || _notrun "mkfs.ext4 doesn't have 64bit feature"
>> +	rm -f $testfile
>> +}
> Sorry, I didn't realize earlier that _require_mkfs_mkfs_bigalloc() runs
> mkfs test against $SCRATCH_DEV too. Seems we should fix it too.
Hi Eryu

I will fix it too. :-)
> Can you please factor out a new helper, e.g. _mkfs_ext4_supported(), to
> accept mkfs options and return mkfs status? So that _require_ext4_mkfs_*
> could use this new helper, just pass different feature bits it wants to
> test. e.g.
>
> _require_ext4_mkfs_64bit()
> {
> 	_mkfs_ext4_supported -O 64bit || \
> 		_notrun "mkfs.ext4 doesn't have 64bit feature"
> }
>
That's good idea, and I am trying to write this new helper as you 
sugguested.

Thanks,
Xiao Yang
> Thanks!
>
> Eryu
>
>
> .
>




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3] ext4: add _require_ext4_mkfs_feature to check different features
  2017-03-02  4:22     ` Eryu Guan
  2017-03-02  4:37       ` Xiao Yang
@ 2017-03-02  6:03       ` Xiao Yang
  1 sibling, 0 replies; 6+ messages in thread
From: Xiao Yang @ 2017-03-02  6:03 UTC (permalink / raw)
  To: eguan; +Cc: fstests, Xiao Yang

1) We add _require_ext4_mkfs_feature to check the specified
   feature whether it is available in mkfs.ext4 or not.

2) We apply _require_ext4_mkfs_feature in ext4/003 and remove
   _require_mkfs_mkfs_bigalloc.

3) We add _require_ext4_mkfs_feature in ext4/306.  When 64bit
   feature is supported by mkfs.ext4, ext4/306 could skip.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 common/rc      | 21 ++++++++++++++++-----
 tests/ext4/003 |  2 +-
 tests/ext4/306 |  1 +
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/common/rc b/common/rc
index 8f23334..cba7b84 100644
--- a/common/rc
+++ b/common/rc
@@ -1669,12 +1669,23 @@ _require_scratch_ext4_crc()
 	_scratch_unmount
 }
 
-# this test requires the bigalloc feature to be available in mkfs.ext4
-#
-_require_ext4_mkfs_bigalloc()
+# Check the specified feature whether it is available in mkfs.ext4 or not.
+_require_ext4_mkfs_feature()
 {
-	$MKFS_EXT4_PROG -F -O bigalloc -n $SCRATCH_DEV 512m >/dev/null 2>&1 \
-	   || _notrun "mkfs.ext4 doesn't have bigalloc feature"
+	local feature=$1
+	local testfile=$TEST_DIR/$$.ext4_mkfs
+
+	if [ -z "$feature" ]; then
+                echo "Usage: _require_ext4_mkfs_feature feature"
+                exit 1
+        fi
+
+	touch $testfile
+	local result=$($MKFS_EXT4_PROG -F -O $feature -n $testfile 512m 2>&1)
+	echo $result | grep -q "Invalid filesystem option" && \
+		_notrun "mkfs.ext4 doesn't support $feature feature"
+
+	rm -f $testfile
 }
 
 # this test requires the ext4 kernel support bigalloc feature
diff --git a/tests/ext4/003 b/tests/ext4/003
index 53875a9..9be4017 100755
--- a/tests/ext4/003
+++ b/tests/ext4/003
@@ -38,7 +38,7 @@ _supported_fs ext4
 _supported_os Linux
 
 _require_scratch
-_require_ext4_mkfs_bigalloc
+_require_ext4_mkfs_feature "bigalloc"
 _require_ext4_bigalloc
 
 rm -f $seqres.full
diff --git a/tests/ext4/306 b/tests/ext4/306
index fa3b782..be765e6 100755
--- a/tests/ext4/306
+++ b/tests/ext4/306
@@ -44,6 +44,7 @@ _supported_fs ext4
 _supported_os Linux
 
 _require_scratch
+_require_ext4_mkfs_feature "64bit"
 
 rm -f $seqres.full
 
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-02  6:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-01  7:57 [PATCH] ext4/306: require 64bit feature to run ext4/306 Xiao Yang
2017-03-01  8:59 ` Eryu Guan
2017-03-02  2:24   ` [PATCH v2] " Xiao Yang
2017-03-02  4:22     ` Eryu Guan
2017-03-02  4:37       ` Xiao Yang
2017-03-02  6:03       ` [PATCH v3] ext4: add _require_ext4_mkfs_feature to check different features Xiao Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox