linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfstests: Add pairing mount options test
@ 2014-01-08  6:30 Qu Wenruo
  2014-01-10 16:15 ` Eric Sandeen
  0 siblings, 1 reply; 11+ messages in thread
From: Qu Wenruo @ 2014-01-08  6:30 UTC (permalink / raw)
  To: xfs; +Cc: Eric Sandeen

Test remount btrfs with different pairing options like barrier and no barrier.

Mainly used to test the following comming btrfs kernel commit:(Not in
mainline yet)
8dd6d2c btrfs: Add treelog mount option.
f1eccd3 btrfs: Add datasum mount option.
aad3269 btrfs: Add datacow mount option.
22bab74 btrfs: Add acl mount option.
170e45e btrfs: Add noflushoncommit mount option.
ce41bc9 btrfs: Add noenospc_debug mount option.
f3c639b btrfs: Add nodiscard mount option.
962cbee btrfs: Add noautodefrag mount option.
0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: Eric Sandeen <sandeen@redhat.com>
---
 tests/btrfs/025     | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/025.out |   2 +
 tests/btrfs/group   |   1 +
 3 files changed, 128 insertions(+)
 create mode 100755 tests/btrfs/025
 create mode 100644 tests/btrfs/025.out

diff --git a/tests/btrfs/025 b/tests/btrfs/025
new file mode 100755
index 0000000..014da19
--- /dev/null
+++ b/tests/btrfs/025
@@ -0,0 +1,125 @@
+#!/bin/bash
+# Btrfs QA test No. 025
+#
+# Check for paired btrfs mount options
+#
+# Regression test for the following btrfs commits
+# 8dd6d2c btrfs: Add treelog mount option.
+# f1eccd3 btrfs: Add datasum mount option.
+# aad3269 btrfs: Add datacow mount option.
+# 22bab74 btrfs: Add acl mount option.
+# 170e45e btrfs: Add noflushoncommit mount option.
+# ce41bc9 btrfs: Add noenospc_debug mount option.
+# f3c639b btrfs: Add nodiscard mount option.
+# 962cbee btrfs: Add noautodefrag mount option.
+# 0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2014 Fujitsu, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+status=0	# success is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+PAIRING_OPTIONS="autodefrag noautodefrag discard nodiscard enospc_debug noenospc_debug flushoncommit noflushoncommit noacl acl nobarrier barrier nodatacow datacow nodatasum datasum notreelog treelog space_cache nospace_cache ssd nossd"
+
+# options that does not show in mount options
+HIDDEN_OPTIONS="noautodefrag nodiscard noenospc_debug noflushoncommit acl barrier datacow datasum treelog nossd"
+_cleanup()
+{
+	rm $tmp.running &> /dev/null
+	wait
+	cd /
+	_scratch_unmount &> /dev/null
+}
+
+# check the mount option
+check_mount_opt()
+{
+	mount_point=$1
+	expected_opt=$2
+
+	mount_opt=`cat /proc/mounts | grep $mount_point | cut -d\  -f4`
+	if grep $2 $mount_opt; then
+		_fail "test failed: expected $expected_opt option not shown in mount options"
+	fi
+}
+
+# background noise 
+start_bgnoise()
+{
+	touch $tmp.running
+	while [ -f "$tmp.running" ]; do
+		run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 500 -p 4
+		if [ $? != 0 ]; then
+			_fail "Some error happened executing fsstress when remounting"
+		fi
+	done &
+	noise_pid=`jobs -p %1`
+	echo $noise_pid > $tmp.running
+}
+
+stop_bgnoise()
+{
+	pid=`cat $tmp.running`
+	rm $tmp.running
+	wait $pid
+}
+
+# get standard environment, filters
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs btrfs
+_supported_os Linux
+
+_need_to_be_root
+_require_scratch
+
+# no need to use the original mount options
+unset MOUNT_OPTIONS
+
+_scratch_mkfs > /dev/null 2>&1
+_scratch_mount
+
+start_bgnoise
+for remount_opt in $PAIRING_OPTIONS; do
+	# Sleep for a while ensuring fsstress to do enough stress
+	sleep 1
+	_remount $SCRATCH_MNT $remount_opt
+	if [ $? != 0 ]; then
+		stop_bgnoise
+		_fail "test failed: $remount_opt not supported"
+	fi
+	if [[ ! $HIDDEN_OPTIONS =~ $remount ]]; then
+		check_mount_opt $SCRATCH_MNT $remount_opt
+			
+		# Special check for nodatacow
+		if [ $remount_opt == "nodatacow" ]; then
+			check_mount_opt $SCRATCH_MNT nodatasum
+		fi
+	fi
+done
+stop_bgnoise
+_scratch_unmount || _fail "umount failed"
+echo "Silence is golden"
+status=0; exit
diff --git a/tests/btrfs/025.out b/tests/btrfs/025.out
new file mode 100644
index 0000000..3d70951
--- /dev/null
+++ b/tests/btrfs/025.out
@@ -0,0 +1,2 @@
+QA output created by 025
+Silence is golden
diff --git a/tests/btrfs/group b/tests/btrfs/group
index 87e7bca..1a4dad8 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -27,3 +27,4 @@
 022 auto
 023 auto
 024 auto quick
+025 auto quick
-- 
1.8.5.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: Add pairing mount options test
  2014-01-08  6:30 [PATCH] xfstests: Add pairing mount options test Qu Wenruo
@ 2014-01-10 16:15 ` Eric Sandeen
  2014-01-13  1:21   ` Qu Wenruo
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Sandeen @ 2014-01-10 16:15 UTC (permalink / raw)
  To: Qu Wenruo, xfs; +Cc: Eric Sandeen, linux-btrfs

On 1/8/14, 12:30 AM, Qu Wenruo wrote:
> Test remount btrfs with different pairing options like barrier and no barrier.

It seems that while this tests that the remount succeeds, and that
the option string is present in /proc/mounts, it does not test that
the mount option is actually in effect.

I suppose for many of these options that would be hard to test; for
i.e. acl though it should be trivial.

What do you think, is this enough to ensure that remount handling
is working as expected for all of these options?

Thanks,
-Eric

> Mainly used to test the following comming btrfs kernel commit:(Not in
> mainline yet)
> 8dd6d2c btrfs: Add treelog mount option.
> f1eccd3 btrfs: Add datasum mount option.
> aad3269 btrfs: Add datacow mount option.
> 22bab74 btrfs: Add acl mount option.
> 170e45e btrfs: Add noflushoncommit mount option.
> ce41bc9 btrfs: Add noenospc_debug mount option.
> f3c639b btrfs: Add nodiscard mount option.
> 962cbee btrfs: Add noautodefrag mount option.
> 0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"
> 
> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
> Cc: Eric Sandeen <sandeen@redhat.com>
> ---
>  tests/btrfs/025     | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/btrfs/025.out |   2 +
>  tests/btrfs/group   |   1 +
>  3 files changed, 128 insertions(+)
>  create mode 100755 tests/btrfs/025
>  create mode 100644 tests/btrfs/025.out
> 
> diff --git a/tests/btrfs/025 b/tests/btrfs/025
> new file mode 100755
> index 0000000..014da19
> --- /dev/null
> +++ b/tests/btrfs/025
> @@ -0,0 +1,125 @@
> +#!/bin/bash
> +# Btrfs QA test No. 025
> +#
> +# Check for paired btrfs mount options
> +#
> +# Regression test for the following btrfs commits
> +# 8dd6d2c btrfs: Add treelog mount option.
> +# f1eccd3 btrfs: Add datasum mount option.
> +# aad3269 btrfs: Add datacow mount option.
> +# 22bab74 btrfs: Add acl mount option.
> +# 170e45e btrfs: Add noflushoncommit mount option.
> +# ce41bc9 btrfs: Add noenospc_debug mount option.
> +# f3c639b btrfs: Add nodiscard mount option.
> +# 962cbee btrfs: Add noautodefrag mount option.
> +# 0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2014 Fujitsu, Inc.  All Rights Reserved.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> +#-----------------------------------------------------------------------
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +status=0	# success is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +PAIRING_OPTIONS="autodefrag noautodefrag discard nodiscard enospc_debug noenospc_debug flushoncommit noflushoncommit noacl acl nobarrier barrier nodatacow datacow nodatasum datasum notreelog treelog space_cache nospace_cache ssd nossd"
> +
> +# options that does not show in mount options
> +HIDDEN_OPTIONS="noautodefrag nodiscard noenospc_debug noflushoncommit acl barrier datacow datasum treelog nossd"
> +_cleanup()
> +{
> +	rm $tmp.running &> /dev/null
> +	wait
> +	cd /
> +	_scratch_unmount &> /dev/null
> +}
> +
> +# check the mount option
> +check_mount_opt()
> +{
> +	mount_point=$1
> +	expected_opt=$2
> +
> +	mount_opt=`cat /proc/mounts | grep $mount_point | cut -d\  -f4`
> +	if grep $2 $mount_opt; then
> +		_fail "test failed: expected $expected_opt option not shown in mount options"
> +	fi
> +}
> +
> +# background noise 
> +start_bgnoise()
> +{
> +	touch $tmp.running
> +	while [ -f "$tmp.running" ]; do
> +		run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 500 -p 4
> +		if [ $? != 0 ]; then
> +			_fail "Some error happened executing fsstress when remounting"
> +		fi
> +	done &
> +	noise_pid=`jobs -p %1`
> +	echo $noise_pid > $tmp.running
> +}
> +
> +stop_bgnoise()
> +{
> +	pid=`cat $tmp.running`
> +	rm $tmp.running
> +	wait $pid
> +}
> +
> +# get standard environment, filters
> +. ./common/rc
> +. ./common/filter
> +
> +# real QA test starts here
> +_supported_fs btrfs
> +_supported_os Linux
> +
> +_need_to_be_root
> +_require_scratch
> +
> +# no need to use the original mount options
> +unset MOUNT_OPTIONS
> +
> +_scratch_mkfs > /dev/null 2>&1
> +_scratch_mount
> +
> +start_bgnoise
> +for remount_opt in $PAIRING_OPTIONS; do
> +	# Sleep for a while ensuring fsstress to do enough stress
> +	sleep 1
> +	_remount $SCRATCH_MNT $remount_opt
> +	if [ $? != 0 ]; then
> +		stop_bgnoise
> +		_fail "test failed: $remount_opt not supported"
> +	fi
> +	if [[ ! $HIDDEN_OPTIONS =~ $remount ]]; then
> +		check_mount_opt $SCRATCH_MNT $remount_opt
> +			
> +		# Special check for nodatacow
> +		if [ $remount_opt == "nodatacow" ]; then
> +			check_mount_opt $SCRATCH_MNT nodatasum
> +		fi
> +	fi
> +done
> +stop_bgnoise
> +_scratch_unmount || _fail "umount failed"
> +echo "Silence is golden"
> +status=0; exit
> diff --git a/tests/btrfs/025.out b/tests/btrfs/025.out
> new file mode 100644
> index 0000000..3d70951
> --- /dev/null
> +++ b/tests/btrfs/025.out
> @@ -0,0 +1,2 @@
> +QA output created by 025
> +Silence is golden
> diff --git a/tests/btrfs/group b/tests/btrfs/group
> index 87e7bca..1a4dad8 100644
> --- a/tests/btrfs/group
> +++ b/tests/btrfs/group
> @@ -27,3 +27,4 @@
>  022 auto
>  023 auto
>  024 auto quick
> +025 auto quick
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: Add pairing mount options test
  2014-01-10 16:15 ` Eric Sandeen
@ 2014-01-13  1:21   ` Qu Wenruo
  2014-01-13  1:35     ` Eric Sandeen
  0 siblings, 1 reply; 11+ messages in thread
From: Qu Wenruo @ 2014-01-13  1:21 UTC (permalink / raw)
  To: Eric Sandeen, xfs; +Cc: Eric Sandeen, linux-btrfs

On fri, 10 Jan 2014 10:15:37 -0600, Eric Sandeen wrote:
> On 1/8/14, 12:30 AM, Qu Wenruo wrote:
>> Test remount btrfs with different pairing options like barrier and no barrier.
> It seems that while this tests that the remount succeeds, and that
> the option string is present in /proc/mounts, it does not test that
> the mount option is actually in effect.

Yes, this is what the new test case is intended to do.
This case was just a test case tests the mount options themselves
to ensure all the pairing mount options works during remounting,
since most pairing options are missing before.
>
> I suppose for many of these options that would be hard to test; for
> i.e. acl though it should be trivial.
>
> What do you think, is this enough to ensure that remount handling
> is working as expected for all of these options?
In my opinion, this test should just focuses on the remount handling and
the pairing options.
For the detailed function should be examineed in other test cases.

Also, most of the pairing options are instructive,
and some may not be in effect before next transaction (for the incomming 
noinode_cache options),
so I think is OK for just examining the options and remount handling for 
now.

Thanks
Qu
>
> Thanks,
> -Eric
>
>> Mainly used to test the following comming btrfs kernel commit:(Not in
>> mainline yet)
>> 8dd6d2c btrfs: Add treelog mount option.
>> f1eccd3 btrfs: Add datasum mount option.
>> aad3269 btrfs: Add datacow mount option.
>> 22bab74 btrfs: Add acl mount option.
>> 170e45e btrfs: Add noflushoncommit mount option.
>> ce41bc9 btrfs: Add noenospc_debug mount option.
>> f3c639b btrfs: Add nodiscard mount option.
>> 962cbee btrfs: Add noautodefrag mount option.
>> 0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"
>>
>> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
>> Cc: Eric Sandeen <sandeen@redhat.com>
>> ---
>>   tests/btrfs/025     | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>>   tests/btrfs/025.out |   2 +
>>   tests/btrfs/group   |   1 +
>>   3 files changed, 128 insertions(+)
>>   create mode 100755 tests/btrfs/025
>>   create mode 100644 tests/btrfs/025.out
>>
>> diff --git a/tests/btrfs/025 b/tests/btrfs/025
>> new file mode 100755
>> index 0000000..014da19
>> --- /dev/null
>> +++ b/tests/btrfs/025
>> @@ -0,0 +1,125 @@
>> +#!/bin/bash
>> +# Btrfs QA test No. 025
>> +#
>> +# Check for paired btrfs mount options
>> +#
>> +# Regression test for the following btrfs commits
>> +# 8dd6d2c btrfs: Add treelog mount option.
>> +# f1eccd3 btrfs: Add datasum mount option.
>> +# aad3269 btrfs: Add datacow mount option.
>> +# 22bab74 btrfs: Add acl mount option.
>> +# 170e45e btrfs: Add noflushoncommit mount option.
>> +# ce41bc9 btrfs: Add noenospc_debug mount option.
>> +# f3c639b btrfs: Add nodiscard mount option.
>> +# 962cbee btrfs: Add noautodefrag mount option.
>> +# 0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"
>> +#
>> +#-----------------------------------------------------------------------
>> +# Copyright (c) 2014 Fujitsu, Inc.  All Rights Reserved.
>> +#
>> +# This program is free software; you can redistribute it and/or
>> +# modify it under the terms of the GNU General Public License as
>> +# published by the Free Software Foundation.
>> +#
>> +# This program is distributed in the hope that it would be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> +# GNU General Public License for more details.
>> +#
>> +# You should have received a copy of the GNU General Public License
>> +# along with this program; if not, write the Free Software Foundation,
>> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>> +#-----------------------------------------------------------------------
>> +#
>> +
>> +seq=`basename $0`
>> +seqres=$RESULT_DIR/$seq
>> +echo "QA output created by $seq"
>> +
>> +status=0	# success is the default!
>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>> +
>> +PAIRING_OPTIONS="autodefrag noautodefrag discard nodiscard enospc_debug noenospc_debug flushoncommit noflushoncommit noacl acl nobarrier barrier nodatacow datacow nodatasum datasum notreelog treelog space_cache nospace_cache ssd nossd"
>> +
>> +# options that does not show in mount options
>> +HIDDEN_OPTIONS="noautodefrag nodiscard noenospc_debug noflushoncommit acl barrier datacow datasum treelog nossd"
>> +_cleanup()
>> +{
>> +	rm $tmp.running &> /dev/null
>> +	wait
>> +	cd /
>> +	_scratch_unmount &> /dev/null
>> +}
>> +
>> +# check the mount option
>> +check_mount_opt()
>> +{
>> +	mount_point=$1
>> +	expected_opt=$2
>> +
>> +	mount_opt=`cat /proc/mounts | grep $mount_point | cut -d\  -f4`
>> +	if grep $2 $mount_opt; then
>> +		_fail "test failed: expected $expected_opt option not shown in mount options"
>> +	fi
>> +}
>> +
>> +# background noise
>> +start_bgnoise()
>> +{
>> +	touch $tmp.running
>> +	while [ -f "$tmp.running" ]; do
>> +		run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 500 -p 4
>> +		if [ $? != 0 ]; then
>> +			_fail "Some error happened executing fsstress when remounting"
>> +		fi
>> +	done &
>> +	noise_pid=`jobs -p %1`
>> +	echo $noise_pid > $tmp.running
>> +}
>> +
>> +stop_bgnoise()
>> +{
>> +	pid=`cat $tmp.running`
>> +	rm $tmp.running
>> +	wait $pid
>> +}
>> +
>> +# get standard environment, filters
>> +. ./common/rc
>> +. ./common/filter
>> +
>> +# real QA test starts here
>> +_supported_fs btrfs
>> +_supported_os Linux
>> +
>> +_need_to_be_root
>> +_require_scratch
>> +
>> +# no need to use the original mount options
>> +unset MOUNT_OPTIONS
>> +
>> +_scratch_mkfs > /dev/null 2>&1
>> +_scratch_mount
>> +
>> +start_bgnoise
>> +for remount_opt in $PAIRING_OPTIONS; do
>> +	# Sleep for a while ensuring fsstress to do enough stress
>> +	sleep 1
>> +	_remount $SCRATCH_MNT $remount_opt
>> +	if [ $? != 0 ]; then
>> +		stop_bgnoise
>> +		_fail "test failed: $remount_opt not supported"
>> +	fi
>> +	if [[ ! $HIDDEN_OPTIONS =~ $remount ]]; then
>> +		check_mount_opt $SCRATCH_MNT $remount_opt
>> +			
>> +		# Special check for nodatacow
>> +		if [ $remount_opt == "nodatacow" ]; then
>> +			check_mount_opt $SCRATCH_MNT nodatasum
>> +		fi
>> +	fi
>> +done
>> +stop_bgnoise
>> +_scratch_unmount || _fail "umount failed"
>> +echo "Silence is golden"
>> +status=0; exit
>> diff --git a/tests/btrfs/025.out b/tests/btrfs/025.out
>> new file mode 100644
>> index 0000000..3d70951
>> --- /dev/null
>> +++ b/tests/btrfs/025.out
>> @@ -0,0 +1,2 @@
>> +QA output created by 025
>> +Silence is golden
>> diff --git a/tests/btrfs/group b/tests/btrfs/group
>> index 87e7bca..1a4dad8 100644
>> --- a/tests/btrfs/group
>> +++ b/tests/btrfs/group
>> @@ -27,3 +27,4 @@
>>   022 auto
>>   023 auto
>>   024 auto quick
>> +025 auto quick
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: Add pairing mount options test
  2014-01-13  1:21   ` Qu Wenruo
@ 2014-01-13  1:35     ` Eric Sandeen
  2014-01-13  1:52       ` Dave Chinner
  2014-01-13  1:55       ` Qu Wenruo
  0 siblings, 2 replies; 11+ messages in thread
From: Eric Sandeen @ 2014-01-13  1:35 UTC (permalink / raw)
  To: Qu Wenruo, xfs; +Cc: Eric Sandeen, linux-btrfs

On 1/12/14, 7:21 PM, Qu Wenruo wrote:
> On fri, 10 Jan 2014 10:15:37 -0600, Eric Sandeen wrote:
>> On 1/8/14, 12:30 AM, Qu Wenruo wrote:
>>> Test remount btrfs with different pairing options like barrier and no barrier.
>> It seems that while this tests that the remount succeeds, and that
>> the option string is present in /proc/mounts, it does not test that
>> the mount option is actually in effect.
> 
> Yes, this is what the new test case is intended to do.
> This case was just a test case tests the mount options themselves
> to ensure all the pairing mount options works during remounting,
> since most pairing options are missing before.
>>
>> I suppose for many of these options that would be hard to test; for
>> i.e. acl though it should be trivial.
>>
>> What do you think, is this enough to ensure that remount handling
>> is working as expected for all of these options?
> In my opinion, this test should just focuses on the remount handling and
> the pairing options.
> For the detailed function should be examineed in other test cases.

Except those won't test that a remount with those options actually *worked*;
in fact they don't do remount at all.

In other words, all this does is test that an option flag was set or unset in
the superblock, but it doesn't really test whether the option has been
properly set up (or torn down) as a result.

I won't say no to this, but it seems to be of somewhat limited use.

-Eric

> Also, most of the pairing options are instructive,
> and some may not be in effect before next transaction (for the incomming noinode_cache options),
> so I think is OK for just examining the options and remount handling for now.
> 
> Thanks
> Qu
>>
>> Thanks,
>> -Eric
>>
>>> Mainly used to test the following comming btrfs kernel commit:(Not in
>>> mainline yet)
>>> 8dd6d2c btrfs: Add treelog mount option.
>>> f1eccd3 btrfs: Add datasum mount option.
>>> aad3269 btrfs: Add datacow mount option.
>>> 22bab74 btrfs: Add acl mount option.
>>> 170e45e btrfs: Add noflushoncommit mount option.
>>> ce41bc9 btrfs: Add noenospc_debug mount option.
>>> f3c639b btrfs: Add nodiscard mount option.
>>> 962cbee btrfs: Add noautodefrag mount option.
>>> 0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"
>>>
>>> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
>>> Cc: Eric Sandeen <sandeen@redhat.com>
>>> ---
>>>   tests/btrfs/025     | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>   tests/btrfs/025.out |   2 +
>>>   tests/btrfs/group   |   1 +
>>>   3 files changed, 128 insertions(+)
>>>   create mode 100755 tests/btrfs/025
>>>   create mode 100644 tests/btrfs/025.out
>>>
>>> diff --git a/tests/btrfs/025 b/tests/btrfs/025
>>> new file mode 100755
>>> index 0000000..014da19
>>> --- /dev/null
>>> +++ b/tests/btrfs/025
>>> @@ -0,0 +1,125 @@
>>> +#!/bin/bash
>>> +# Btrfs QA test No. 025
>>> +#
>>> +# Check for paired btrfs mount options
>>> +#
>>> +# Regression test for the following btrfs commits
>>> +# 8dd6d2c btrfs: Add treelog mount option.
>>> +# f1eccd3 btrfs: Add datasum mount option.
>>> +# aad3269 btrfs: Add datacow mount option.
>>> +# 22bab74 btrfs: Add acl mount option.
>>> +# 170e45e btrfs: Add noflushoncommit mount option.
>>> +# ce41bc9 btrfs: Add noenospc_debug mount option.
>>> +# f3c639b btrfs: Add nodiscard mount option.
>>> +# 962cbee btrfs: Add noautodefrag mount option.
>>> +# 0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"
>>> +#
>>> +#-----------------------------------------------------------------------
>>> +# Copyright (c) 2014 Fujitsu, Inc.  All Rights Reserved.
>>> +#
>>> +# This program is free software; you can redistribute it and/or
>>> +# modify it under the terms of the GNU General Public License as
>>> +# published by the Free Software Foundation.
>>> +#
>>> +# This program is distributed in the hope that it would be useful,
>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>> +# GNU General Public License for more details.
>>> +#
>>> +# You should have received a copy of the GNU General Public License
>>> +# along with this program; if not, write the Free Software Foundation,
>>> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>>> +#-----------------------------------------------------------------------
>>> +#
>>> +
>>> +seq=`basename $0`
>>> +seqres=$RESULT_DIR/$seq
>>> +echo "QA output created by $seq"
>>> +
>>> +status=0    # success is the default!
>>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>>> +
>>> +PAIRING_OPTIONS="autodefrag noautodefrag discard nodiscard enospc_debug noenospc_debug flushoncommit noflushoncommit noacl acl nobarrier barrier nodatacow datacow nodatasum datasum notreelog treelog space_cache nospace_cache ssd nossd"
>>> +
>>> +# options that does not show in mount options
>>> +HIDDEN_OPTIONS="noautodefrag nodiscard noenospc_debug noflushoncommit acl barrier datacow datasum treelog nossd"
>>> +_cleanup()
>>> +{
>>> +    rm $tmp.running &> /dev/null
>>> +    wait
>>> +    cd /
>>> +    _scratch_unmount &> /dev/null
>>> +}
>>> +
>>> +# check the mount option
>>> +check_mount_opt()
>>> +{
>>> +    mount_point=$1
>>> +    expected_opt=$2
>>> +
>>> +    mount_opt=`cat /proc/mounts | grep $mount_point | cut -d\  -f4`
>>> +    if grep $2 $mount_opt; then
>>> +        _fail "test failed: expected $expected_opt option not shown in mount options"
>>> +    fi
>>> +}
>>> +
>>> +# background noise
>>> +start_bgnoise()
>>> +{
>>> +    touch $tmp.running
>>> +    while [ -f "$tmp.running" ]; do
>>> +        run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 500 -p 4
>>> +        if [ $? != 0 ]; then
>>> +            _fail "Some error happened executing fsstress when remounting"
>>> +        fi
>>> +    done &
>>> +    noise_pid=`jobs -p %1`
>>> +    echo $noise_pid > $tmp.running
>>> +}
>>> +
>>> +stop_bgnoise()
>>> +{
>>> +    pid=`cat $tmp.running`
>>> +    rm $tmp.running
>>> +    wait $pid
>>> +}
>>> +
>>> +# get standard environment, filters
>>> +. ./common/rc
>>> +. ./common/filter
>>> +
>>> +# real QA test starts here
>>> +_supported_fs btrfs
>>> +_supported_os Linux
>>> +
>>> +_need_to_be_root
>>> +_require_scratch
>>> +
>>> +# no need to use the original mount options
>>> +unset MOUNT_OPTIONS
>>> +
>>> +_scratch_mkfs > /dev/null 2>&1
>>> +_scratch_mount
>>> +
>>> +start_bgnoise
>>> +for remount_opt in $PAIRING_OPTIONS; do
>>> +    # Sleep for a while ensuring fsstress to do enough stress
>>> +    sleep 1
>>> +    _remount $SCRATCH_MNT $remount_opt
>>> +    if [ $? != 0 ]; then
>>> +        stop_bgnoise
>>> +        _fail "test failed: $remount_opt not supported"
>>> +    fi
>>> +    if [[ ! $HIDDEN_OPTIONS =~ $remount ]]; then
>>> +        check_mount_opt $SCRATCH_MNT $remount_opt
>>> +           
>>> +        # Special check for nodatacow
>>> +        if [ $remount_opt == "nodatacow" ]; then
>>> +            check_mount_opt $SCRATCH_MNT nodatasum
>>> +        fi
>>> +    fi
>>> +done
>>> +stop_bgnoise
>>> +_scratch_unmount || _fail "umount failed"
>>> +echo "Silence is golden"
>>> +status=0; exit
>>> diff --git a/tests/btrfs/025.out b/tests/btrfs/025.out
>>> new file mode 100644
>>> index 0000000..3d70951
>>> --- /dev/null
>>> +++ b/tests/btrfs/025.out
>>> @@ -0,0 +1,2 @@
>>> +QA output created by 025
>>> +Silence is golden
>>> diff --git a/tests/btrfs/group b/tests/btrfs/group
>>> index 87e7bca..1a4dad8 100644
>>> --- a/tests/btrfs/group
>>> +++ b/tests/btrfs/group
>>> @@ -27,3 +27,4 @@
>>>   022 auto
>>>   023 auto
>>>   024 auto quick
>>> +025 auto quick
>>>
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: Add pairing mount options test
  2014-01-13  1:35     ` Eric Sandeen
@ 2014-01-13  1:52       ` Dave Chinner
  2014-01-13  2:26         ` Qu Wenruo
  2014-01-13  1:55       ` Qu Wenruo
  1 sibling, 1 reply; 11+ messages in thread
From: Dave Chinner @ 2014-01-13  1:52 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Qu Wenruo, Eric Sandeen, linux-btrfs, xfs

On Sun, Jan 12, 2014 at 07:35:44PM -0600, Eric Sandeen wrote:
> On 1/12/14, 7:21 PM, Qu Wenruo wrote:
> > On fri, 10 Jan 2014 10:15:37 -0600, Eric Sandeen wrote:
> >> On 1/8/14, 12:30 AM, Qu Wenruo wrote:
> >>> Test remount btrfs with different pairing options like barrier and no barrier.
> >> It seems that while this tests that the remount succeeds, and that
> >> the option string is present in /proc/mounts, it does not test that
> >> the mount option is actually in effect.
> > 
> > Yes, this is what the new test case is intended to do.
> > This case was just a test case tests the mount options themselves
> > to ensure all the pairing mount options works during remounting,
> > since most pairing options are missing before.
> >>
> >> I suppose for many of these options that would be hard to test; for
> >> i.e. acl though it should be trivial.
> >>
> >> What do you think, is this enough to ensure that remount handling
> >> is working as expected for all of these options?
> > In my opinion, this test should just focuses on the remount handling and
> > the pairing options.
> > For the detailed function should be examineed in other test cases.
> 
> Except those won't test that a remount with those options actually *worked*;
> in fact they don't do remount at all.
> 
> In other words, all this does is test that an option flag was set or unset in
> the superblock, but it doesn't really test whether the option has been
> properly set up (or torn down) as a result.
> 
> I won't say no to this, but it seems to be of somewhat limited use.

What happens to the test when mount options are deprecated/removed?
How are we going to handle the matrix of testable/untestable mount
options across kernels with different mount option support?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: Add pairing mount options test
  2014-01-13  1:35     ` Eric Sandeen
  2014-01-13  1:52       ` Dave Chinner
@ 2014-01-13  1:55       ` Qu Wenruo
  1 sibling, 0 replies; 11+ messages in thread
From: Qu Wenruo @ 2014-01-13  1:55 UTC (permalink / raw)
  To: Eric Sandeen, xfs; +Cc: Eric Sandeen, linux-btrfs

On Sun, 12 Jan 2014 19:35:44 -0600, Eric Sandeen wrote:
> On 1/12/14, 7:21 PM, Qu Wenruo wrote:
>> On fri, 10 Jan 2014 10:15:37 -0600, Eric Sandeen wrote:
>>> On 1/8/14, 12:30 AM, Qu Wenruo wrote:
>>>> Test remount btrfs with different pairing options like barrier and no barrier.
>>> It seems that while this tests that the remount succeeds, and that
>>> the option string is present in /proc/mounts, it does not test that
>>> the mount option is actually in effect.
>> Yes, this is what the new test case is intended to do.
>> This case was just a test case tests the mount options themselves
>> to ensure all the pairing mount options works during remounting,
>> since most pairing options are missing before.
>>> I suppose for many of these options that would be hard to test; for
>>> i.e. acl though it should be trivial.
>>>
>>> What do you think, is this enough to ensure that remount handling
>>> is working as expected for all of these options?
>> In my opinion, this test should just focuses on the remount handling and
>> the pairing options.
>> For the detailed function should be examineed in other test cases.
> Except those won't test that a remount with those options actually *worked*;
> in fact they don't do remount at all.
>
> In other words, all this does is test that an option flag was set or unset in
> the superblock, but it doesn't really test whether the option has been
> properly set up (or torn down) as a result.
>
> I won't say no to this, but it seems to be of somewhat limited use.
>
> -Eric
It is true that this test case just tests the flags.
But sometimes it is unsafe to just trigger the flags.
(All right, just the inode_cache flags which is not in the test case)

Though the case is mainly for the flags/mount options examining, but it 
may be
able to find some flag triggering defeats if run for enough long time.

Anyway, thanks for your commenting.

Thanks
Qu
>> Also, most of the pairing options are instructive,
>> and some may not be in effect before next transaction (for the incomming noinode_cache options),
>> so I think is OK for just examining the options and remount handling for now.
>>
>> Thanks
>> Qu
>>> Thanks,
>>> -Eric
>>>
>>>> Mainly used to test the following comming btrfs kernel commit:(Not in
>>>> mainline yet)
>>>> 8dd6d2c btrfs: Add treelog mount option.
>>>> f1eccd3 btrfs: Add datasum mount option.
>>>> aad3269 btrfs: Add datacow mount option.
>>>> 22bab74 btrfs: Add acl mount option.
>>>> 170e45e btrfs: Add noflushoncommit mount option.
>>>> ce41bc9 btrfs: Add noenospc_debug mount option.
>>>> f3c639b btrfs: Add nodiscard mount option.
>>>> 962cbee btrfs: Add noautodefrag mount option.
>>>> 0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"
>>>>
>>>> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
>>>> Cc: Eric Sandeen <sandeen@redhat.com>
>>>> ---
>>>>    tests/btrfs/025     | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>>    tests/btrfs/025.out |   2 +
>>>>    tests/btrfs/group   |   1 +
>>>>    3 files changed, 128 insertions(+)
>>>>    create mode 100755 tests/btrfs/025
>>>>    create mode 100644 tests/btrfs/025.out
>>>>
>>>> diff --git a/tests/btrfs/025 b/tests/btrfs/025
>>>> new file mode 100755
>>>> index 0000000..014da19
>>>> --- /dev/null
>>>> +++ b/tests/btrfs/025
>>>> @@ -0,0 +1,125 @@
>>>> +#!/bin/bash
>>>> +# Btrfs QA test No. 025
>>>> +#
>>>> +# Check for paired btrfs mount options
>>>> +#
>>>> +# Regression test for the following btrfs commits
>>>> +# 8dd6d2c btrfs: Add treelog mount option.
>>>> +# f1eccd3 btrfs: Add datasum mount option.
>>>> +# aad3269 btrfs: Add datacow mount option.
>>>> +# 22bab74 btrfs: Add acl mount option.
>>>> +# 170e45e btrfs: Add noflushoncommit mount option.
>>>> +# ce41bc9 btrfs: Add noenospc_debug mount option.
>>>> +# f3c639b btrfs: Add nodiscard mount option.
>>>> +# 962cbee btrfs: Add noautodefrag mount option.
>>>> +# 0b4fa2a btrfs: Add "barrier" option to support "-o remount,barrier"
>>>> +#
>>>> +#-----------------------------------------------------------------------
>>>> +# Copyright (c) 2014 Fujitsu, Inc.  All Rights Reserved.
>>>> +#
>>>> +# This program is free software; you can redistribute it and/or
>>>> +# modify it under the terms of the GNU General Public License as
>>>> +# published by the Free Software Foundation.
>>>> +#
>>>> +# This program is distributed in the hope that it would be useful,
>>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>>> +# GNU General Public License for more details.
>>>> +#
>>>> +# You should have received a copy of the GNU General Public License
>>>> +# along with this program; if not, write the Free Software Foundation,
>>>> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>>>> +#-----------------------------------------------------------------------
>>>> +#
>>>> +
>>>> +seq=`basename $0`
>>>> +seqres=$RESULT_DIR/$seq
>>>> +echo "QA output created by $seq"
>>>> +
>>>> +status=0    # success is the default!
>>>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>>>> +
>>>> +PAIRING_OPTIONS="autodefrag noautodefrag discard nodiscard enospc_debug noenospc_debug flushoncommit noflushoncommit noacl acl nobarrier barrier nodatacow datacow nodatasum datasum notreelog treelog space_cache nospace_cache ssd nossd"
>>>> +
>>>> +# options that does not show in mount options
>>>> +HIDDEN_OPTIONS="noautodefrag nodiscard noenospc_debug noflushoncommit acl barrier datacow datasum treelog nossd"
>>>> +_cleanup()
>>>> +{
>>>> +    rm $tmp.running &> /dev/null
>>>> +    wait
>>>> +    cd /
>>>> +    _scratch_unmount &> /dev/null
>>>> +}
>>>> +
>>>> +# check the mount option
>>>> +check_mount_opt()
>>>> +{
>>>> +    mount_point=$1
>>>> +    expected_opt=$2
>>>> +
>>>> +    mount_opt=`cat /proc/mounts | grep $mount_point | cut -d\  -f4`
>>>> +    if grep $2 $mount_opt; then
>>>> +        _fail "test failed: expected $expected_opt option not shown in mount options"
>>>> +    fi
>>>> +}
>>>> +
>>>> +# background noise
>>>> +start_bgnoise()
>>>> +{
>>>> +    touch $tmp.running
>>>> +    while [ -f "$tmp.running" ]; do
>>>> +        run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 500 -p 4
>>>> +        if [ $? != 0 ]; then
>>>> +            _fail "Some error happened executing fsstress when remounting"
>>>> +        fi
>>>> +    done &
>>>> +    noise_pid=`jobs -p %1`
>>>> +    echo $noise_pid > $tmp.running
>>>> +}
>>>> +
>>>> +stop_bgnoise()
>>>> +{
>>>> +    pid=`cat $tmp.running`
>>>> +    rm $tmp.running
>>>> +    wait $pid
>>>> +}
>>>> +
>>>> +# get standard environment, filters
>>>> +. ./common/rc
>>>> +. ./common/filter
>>>> +
>>>> +# real QA test starts here
>>>> +_supported_fs btrfs
>>>> +_supported_os Linux
>>>> +
>>>> +_need_to_be_root
>>>> +_require_scratch
>>>> +
>>>> +# no need to use the original mount options
>>>> +unset MOUNT_OPTIONS
>>>> +
>>>> +_scratch_mkfs > /dev/null 2>&1
>>>> +_scratch_mount
>>>> +
>>>> +start_bgnoise
>>>> +for remount_opt in $PAIRING_OPTIONS; do
>>>> +    # Sleep for a while ensuring fsstress to do enough stress
>>>> +    sleep 1
>>>> +    _remount $SCRATCH_MNT $remount_opt
>>>> +    if [ $? != 0 ]; then
>>>> +        stop_bgnoise
>>>> +        _fail "test failed: $remount_opt not supported"
>>>> +    fi
>>>> +    if [[ ! $HIDDEN_OPTIONS =~ $remount ]]; then
>>>> +        check_mount_opt $SCRATCH_MNT $remount_opt
>>>> +
>>>> +        # Special check for nodatacow
>>>> +        if [ $remount_opt == "nodatacow" ]; then
>>>> +            check_mount_opt $SCRATCH_MNT nodatasum
>>>> +        fi
>>>> +    fi
>>>> +done
>>>> +stop_bgnoise
>>>> +_scratch_unmount || _fail "umount failed"
>>>> +echo "Silence is golden"
>>>> +status=0; exit
>>>> diff --git a/tests/btrfs/025.out b/tests/btrfs/025.out
>>>> new file mode 100644
>>>> index 0000000..3d70951
>>>> --- /dev/null
>>>> +++ b/tests/btrfs/025.out
>>>> @@ -0,0 +1,2 @@
>>>> +QA output created by 025
>>>> +Silence is golden
>>>> diff --git a/tests/btrfs/group b/tests/btrfs/group
>>>> index 87e7bca..1a4dad8 100644
>>>> --- a/tests/btrfs/group
>>>> +++ b/tests/btrfs/group
>>>> @@ -27,3 +27,4 @@
>>>>    022 auto
>>>>    023 auto
>>>>    024 auto quick
>>>> +025 auto quick
>>>>
>>> -- 
>>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: Add pairing mount options test
  2014-01-13  1:52       ` Dave Chinner
@ 2014-01-13  2:26         ` Qu Wenruo
  2014-01-13  3:26           ` Dave Chinner
  0 siblings, 1 reply; 11+ messages in thread
From: Qu Wenruo @ 2014-01-13  2:26 UTC (permalink / raw)
  To: Dave Chinner, Eric Sandeen; +Cc: Eric Sandeen, linux-btrfs, xfs

On mon, 13 Jan 2014 12:52:39 +1100, Dave Chinner wrote:
> On Sun, Jan 12, 2014 at 07:35:44PM -0600, Eric Sandeen wrote:
>> On 1/12/14, 7:21 PM, Qu Wenruo wrote:
>>> On fri, 10 Jan 2014 10:15:37 -0600, Eric Sandeen wrote:
>>>> On 1/8/14, 12:30 AM, Qu Wenruo wrote:
>>>>> Test remount btrfs with different pairing options like barrier and no barrier.
>>>> It seems that while this tests that the remount succeeds, and that
>>>> the option string is present in /proc/mounts, it does not test that
>>>> the mount option is actually in effect.
>>> Yes, this is what the new test case is intended to do.
>>> This case was just a test case tests the mount options themselves
>>> to ensure all the pairing mount options works during remounting,
>>> since most pairing options are missing before.
>>>> I suppose for many of these options that would be hard to test; for
>>>> i.e. acl though it should be trivial.
>>>>
>>>> What do you think, is this enough to ensure that remount handling
>>>> is working as expected for all of these options?
>>> In my opinion, this test should just focuses on the remount handling and
>>> the pairing options.
>>> For the detailed function should be examineed in other test cases.
>> Except those won't test that a remount with those options actually *worked*;
>> in fact they don't do remount at all.
>>
>> In other words, all this does is test that an option flag was set or unset in
>> the superblock, but it doesn't really test whether the option has been
>> properly set up (or torn down) as a result.
>>
>> I won't say no to this, but it seems to be of somewhat limited use.
> What happens to the test when mount options are deprecated/removed?
> How are we going to handle the matrix of testable/untestable mount
> options across kernels with different mount option support?
>
> Cheers,
>
> Dave.
In my opinion,there may be two ways to deal it:
1) Introduce up_limit_kver and down_limit_kver to *every* mount option.
If needed also add deprecated flags.

Ithink this can handle the version related things quite well.
But for the test case, it may be overkilled.
Most codes will be focused on theversion handling even though the case only
tests the flags.

On the other hand, it would be quitenice if xfstests framework can 
introduce such
version handling systems.

2) Manual editing after mount options change.
If any options become deprecated/removed, just remove them from 
PAIRING_OPTIONS and HIDDEN_OPTIONS.

For the old kernels with does not support these new options, NG is what 
it should be.
Since missing pairing options meaning that users can't trigger a funtion 
without unmount,
NG inform users the fact.
(Recently, one user asked why there is no "barrier" mountoption in 
btrfs. From the respect of users,
missing pairing mount options is a defeat)

This method will introduce more effort tomaintain the test case, but due 
to the small codes and
relativly less changes in mount options, I consider it as an acceptable 
method.

It would be quite nice if any one can provide any better idea.

Thanks
Qu

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: Add pairing mount options test
  2014-01-13  2:26         ` Qu Wenruo
@ 2014-01-13  3:26           ` Dave Chinner
  2014-01-13  4:00             ` Qu Wenruo
  0 siblings, 1 reply; 11+ messages in thread
From: Dave Chinner @ 2014-01-13  3:26 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: Eric Sandeen, Eric Sandeen, linux-btrfs, xfs

On Mon, Jan 13, 2014 at 10:26:05AM +0800, Qu Wenruo wrote:
> On mon, 13 Jan 2014 12:52:39 +1100, Dave Chinner wrote:
> >On Sun, Jan 12, 2014 at 07:35:44PM -0600, Eric Sandeen wrote:
> >>I won't say no to this, but it seems to be of somewhat limited use.
> >What happens to the test when mount options are deprecated/removed?
> >How are we going to handle the matrix of testable/untestable mount
> >options across kernels with different mount option support?
> In my opinion,there may be two ways to deal it:
> 1) Introduce up_limit_kver and down_limit_kver to *every* mount option.
> If needed also add deprecated flags.

Both of which are messy, and kernel version number checks don't work
with vendor kernels that have stuff back ported to them.

> This method will introduce more effort tomaintain the test case, but
> due to the small codes and
> relativly less changes in mount options, I consider it as an
> acceptable method.

What you are saying is that such a test will require constant
maintenance from upstream developers to keep working across all the
kernels that btrfs supports.

When combined with Eric's comments that it doesn't test the
functionality and so has relatively little benefit in terms of
improving code coverage, it doesn't paint a pretty picture. So from
that point of view, I'd say no to such a test.

> It would be quite nice if any one can provide any better idea.

Write a test for each individual feature that exercises and
validates that feature in some way. Part of a functional test would
be to test that the mount options for that function do what they are
intended to do. Eric suggested the same thing (though in a different
way).

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: Add pairing mount options test
  2014-01-13  3:26           ` Dave Chinner
@ 2014-01-13  4:00             ` Qu Wenruo
  2014-01-13  4:44               ` Eric Sandeen
  2014-01-13 21:23               ` Dave Chinner
  0 siblings, 2 replies; 11+ messages in thread
From: Qu Wenruo @ 2014-01-13  4:00 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Eric Sandeen, Eric Sandeen, linux-btrfs, xfs

On Mon, 13 Jan 2014 14:26:50 +1100, Dave Chinner wrote:
> On Mon, Jan 13, 2014 at 10:26:05AM +0800, Qu Wenruo wrote:
>> On mon, 13 Jan 2014 12:52:39 +1100, Dave Chinner wrote:
>>> On Sun, Jan 12, 2014 at 07:35:44PM -0600, Eric Sandeen wrote:
>>>> I won't say no to this, but it seems to be of somewhat limited use.
>>> What happens to the test when mount options are deprecated/removed?
>>> How are we going to handle the matrix of testable/untestable mount
>>> options across kernels with different mount option support?
>> In my opinion,there may be two ways to deal it:
>> 1) Introduce up_limit_kver and down_limit_kver to *every* mount option.
>> If needed also add deprecated flags.
> Both of which are messy, and kernel version number checks don't work
> with vendor kernels that have stuff back ported to them.
>
>> This method will introduce more effort tomaintain the test case, but
>> due to the small codes and
>> relativly less changes in mount options, I consider it as an
>> acceptable method.
> What you are saying is that such a test will require constant
> maintenance from upstream developers to keep working across all the
> kernels that btrfs supports.
>
> When combined with Eric's comments that it doesn't test the
> functionality and so has relatively little benefit in terms of
> improving code coverage, it doesn't paint a pretty picture. So from
> that point of view, I'd say no to such a test.
>
>> It would be quite nice if any one can provide any better idea.
> Write a test for each individual feature that exercises and
> validates that feature in some way. Part of a functional test would
> be to test that the mount options for that function do what they are
> intended to do. Eric suggested the same thing (though in a different
> way).
>
> Cheers,
>
> Dave.
That's right, individual test case is the best way.

But most of the options are just instructive options,
and only affects performance, it's very hard to test. (like space_cace 
and nospace_cache)

If really spilt into individual test case, most cases will be much like this
case just remount it with backgroud fsstress.

Only inode_cache can cause different inode number allocation and can be 
examined.

Now I'm interested in how other filesystems like xfs makes sure that 
every pairing
mount options are tested.

Thanks
Qu

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: Add pairing mount options test
  2014-01-13  4:00             ` Qu Wenruo
@ 2014-01-13  4:44               ` Eric Sandeen
  2014-01-13 21:23               ` Dave Chinner
  1 sibling, 0 replies; 11+ messages in thread
From: Eric Sandeen @ 2014-01-13  4:44 UTC (permalink / raw)
  To: Qu Wenruo, Dave Chinner; +Cc: Eric Sandeen, linux-btrfs, xfs

On 1/12/14, 10:00 PM, Qu Wenruo wrote:
> Now I'm interested in how other filesystems like xfs makes sure that every pairing
> mount options are tested.

For starters, xfs actually doesn't handle very many options during remount.

Many of them are quite tricky to do, which made me wonder if they all
actually worked properly for btrfs.  :)

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: Add pairing mount options test
  2014-01-13  4:00             ` Qu Wenruo
  2014-01-13  4:44               ` Eric Sandeen
@ 2014-01-13 21:23               ` Dave Chinner
  1 sibling, 0 replies; 11+ messages in thread
From: Dave Chinner @ 2014-01-13 21:23 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: Eric Sandeen, Eric Sandeen, linux-btrfs, xfs

On Mon, Jan 13, 2014 at 12:00:26PM +0800, Qu Wenruo wrote:
> On Mon, 13 Jan 2014 14:26:50 +1100, Dave Chinner wrote:
> >On Mon, Jan 13, 2014 at 10:26:05AM +0800, Qu Wenruo wrote:
> >>On mon, 13 Jan 2014 12:52:39 +1100, Dave Chinner wrote:
> >>>On Sun, Jan 12, 2014 at 07:35:44PM -0600, Eric Sandeen wrote:
> >>>>I won't say no to this, but it seems to be of somewhat limited use.
> >>>What happens to the test when mount options are deprecated/removed?
> >>>How are we going to handle the matrix of testable/untestable mount
> >>>options across kernels with different mount option support?
> >>In my opinion,there may be two ways to deal it:
> >>1) Introduce up_limit_kver and down_limit_kver to *every* mount option.
> >>If needed also add deprecated flags.
> >Both of which are messy, and kernel version number checks don't work
> >with vendor kernels that have stuff back ported to them.
> >
> >>This method will introduce more effort tomaintain the test case, but
> >>due to the small codes and
> >>relativly less changes in mount options, I consider it as an
> >>acceptable method.
> >What you are saying is that such a test will require constant
> >maintenance from upstream developers to keep working across all the
> >kernels that btrfs supports.
> >
> >When combined with Eric's comments that it doesn't test the
> >functionality and so has relatively little benefit in terms of
> >improving code coverage, it doesn't paint a pretty picture. So from
> >that point of view, I'd say no to such a test.
> >
> >>It would be quite nice if any one can provide any better idea.
> >Write a test for each individual feature that exercises and
> >validates that feature in some way. Part of a functional test would
> >be to test that the mount options for that function do what they are
> >intended to do. Eric suggested the same thing (though in a different
> >way).
> >
> >Cheers,
> >
> >Dave.
> That's right, individual test case is the best way.
> 
> But most of the options are just instructive options,
> and only affects performance, it's very hard to test. (like
> space_cace and nospace_cache)

Bad example. nospace_cache/space_cache change what is stored on
disk, and affect *mount* processing depending on whether there is
a cache or not. It also affects how tools like fsck.btrfs check the
filesystem and so on. There is far more to test than just remount
behaviour when testing the functionality of such a mount option, and
that's the reason why they should be done in targeted feature
tests.

> Now I'm interested in how other filesystems like xfs makes sure that
> every pairing
> mount options are tested.

XFS has extremely limited remount option support, and we already
have xfs/189 for that. And it does all sorts of interesting things
to support the different configurations and behaviours of /etc/mtab
that different distros use because that changes mount behaviour....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2014-01-13 21:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08  6:30 [PATCH] xfstests: Add pairing mount options test Qu Wenruo
2014-01-10 16:15 ` Eric Sandeen
2014-01-13  1:21   ` Qu Wenruo
2014-01-13  1:35     ` Eric Sandeen
2014-01-13  1:52       ` Dave Chinner
2014-01-13  2:26         ` Qu Wenruo
2014-01-13  3:26           ` Dave Chinner
2014-01-13  4:00             ` Qu Wenruo
2014-01-13  4:44               ` Eric Sandeen
2014-01-13 21:23               ` Dave Chinner
2014-01-13  1:55       ` Qu Wenruo

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).