All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] test_robind.sh: set default FSTYPES to LTP_BIG_DEV_FS_TYPE
@ 2015-10-31  6:43 Eryu Guan
  2015-10-31  6:43 ` [LTP] [PATCH 2/2] test_robind.sh: add xfs and btrfs support Eryu Guan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Eryu Guan @ 2015-10-31  6:43 UTC (permalink / raw)
  To: ltp

In test_robind.sh LTP_BIG_DEV is used, so use LTP_BIG_DEV_FS_TYPE as
default fs type accordingly. If LTP_BIG_DEV_FS_TYPE is not set, fall
back to ext3.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 testcases/kernel/fs/fs_readonly/test_robind.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/fs/fs_readonly/test_robind.sh b/testcases/kernel/fs/fs_readonly/test_robind.sh
index 0513275..5674ca4 100755
--- a/testcases/kernel/fs/fs_readonly/test_robind.sh
+++ b/testcases/kernel/fs/fs_readonly/test_robind.sh
@@ -123,9 +123,10 @@ setup()
 		mkdir -p $dir
 	done
 
-	# populating the default FS as ext3, if FS is not given
+	# populating the default FS as $LTP_BIG_DEV_FS_TYPE
+	# (or ext3 if it's not set), if FS is not given
 	if [ -z "$*" ]; then
-		FSTYPES="ext3"
+		FSTYPES=${LTP_BIG_DEV_FS_TYPE:-ext3}
 	else
 		FSTYPES="$*"
 	fi
-- 
2.4.3


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

* [LTP] [PATCH 2/2] test_robind.sh: add xfs and btrfs support
  2015-10-31  6:43 [LTP] [PATCH 1/2] test_robind.sh: set default FSTYPES to LTP_BIG_DEV_FS_TYPE Eryu Guan
@ 2015-10-31  6:43 ` Eryu Guan
  2015-11-05 12:20   ` Cyril Hrubis
  2015-11-05 12:22 ` [LTP] [PATCH 1/2] test_robind.sh: set default FSTYPES to LTP_BIG_DEV_FS_TYPE Cyril Hrubis
  2015-11-09  6:31 ` Lei Li
  2 siblings, 1 reply; 7+ messages in thread
From: Eryu Guan @ 2015-10-31  6:43 UTC (permalink / raw)
  To: ltp

Add btrfs support and fix opts for xfs, which needs "-f" too.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 testcases/kernel/fs/fs_readonly/test_robind.sh | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/fs/fs_readonly/test_robind.sh b/testcases/kernel/fs/fs_readonly/test_robind.sh
index 5674ca4..371d5fa 100755
--- a/testcases/kernel/fs/fs_readonly/test_robind.sh
+++ b/testcases/kernel/fs/fs_readonly/test_robind.sh
@@ -197,10 +197,17 @@ for fstype in $FSTYPES; do
 	opts="-F"
 	if [ "$fstype" = "reiserfs" ]; then
 		opts="-f --journal-size 513 -q"
-	elif [ "$fstype" = "jfs" ]; then
+	elif [ "$fstype" = "jfs" -o "$fstype" = "xfs" ]; then
 		opts="-f"
-	elif [ "$fstype" = "xfs" ]; then
-		opts=""
+	elif [ "$fstype" = "btrfs" ]; then
+		# check if mkfs.btrfs supports -f option
+		# detect "-f --force" or "-f|--force" because btrfs-progs
+		# changes usage text in commit 3f312d500b73
+		if mkfs.btrfs 2>&1 | grep -q '\-f[ |]'; then
+			opts="-f"
+		else
+			opts=""
+		fi
 	fi
 
 	if [ "$fstype" != "ramfs" ]; then
-- 
2.4.3


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

* [LTP] [PATCH 2/2] test_robind.sh: add xfs and btrfs support
  2015-10-31  6:43 ` [LTP] [PATCH 2/2] test_robind.sh: add xfs and btrfs support Eryu Guan
@ 2015-11-05 12:20   ` Cyril Hrubis
  2015-11-05 12:55     ` Eryu Guan
  0 siblings, 1 reply; 7+ messages in thread
From: Cyril Hrubis @ 2015-11-05 12:20 UTC (permalink / raw)
  To: ltp

Hi!
> Add btrfs support and fix opts for xfs, which needs "-f" too.
> 
> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
>  testcases/kernel/fs/fs_readonly/test_robind.sh | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/testcases/kernel/fs/fs_readonly/test_robind.sh b/testcases/kernel/fs/fs_readonly/test_robind.sh
> index 5674ca4..371d5fa 100755
> --- a/testcases/kernel/fs/fs_readonly/test_robind.sh
> +++ b/testcases/kernel/fs/fs_readonly/test_robind.sh
> @@ -197,10 +197,17 @@ for fstype in $FSTYPES; do
>  	opts="-F"
>  	if [ "$fstype" = "reiserfs" ]; then
>  		opts="-f --journal-size 513 -q"
> -	elif [ "$fstype" = "jfs" ]; then
> +	elif [ "$fstype" = "jfs" -o "$fstype" = "xfs" ]; then
>  		opts="-f"
> -	elif [ "$fstype" = "xfs" ]; then
> -		opts=""
> +	elif [ "$fstype" = "btrfs" ]; then
> +		# check if mkfs.btrfs supports -f option
> +		# detect "-f --force" or "-f|--force" because btrfs-progs
> +		# changes usage text in commit 3f312d500b73
> +		if mkfs.btrfs 2>&1 | grep -q '\-f[ |]'; then
> +			opts="-f"
> +		else
> +			opts=""
> +		fi
>  	fi

We have this special cases in tst_mkfs function in test.sh, you should
really use that instead of copying the code around.

Lookin at the code in test.sh we should add special case for jfs there
and call tst_mkfs here instead of mkfs.$fstype.

-- 
Cyril Hrubis
chrubis@suse.cz

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

* [LTP] [PATCH 1/2] test_robind.sh: set default FSTYPES to LTP_BIG_DEV_FS_TYPE
  2015-10-31  6:43 [LTP] [PATCH 1/2] test_robind.sh: set default FSTYPES to LTP_BIG_DEV_FS_TYPE Eryu Guan
  2015-10-31  6:43 ` [LTP] [PATCH 2/2] test_robind.sh: add xfs and btrfs support Eryu Guan
@ 2015-11-05 12:22 ` Cyril Hrubis
  2015-11-09  6:31 ` Lei Li
  2 siblings, 0 replies; 7+ messages in thread
From: Cyril Hrubis @ 2015-11-05 12:22 UTC (permalink / raw)
  To: ltp

Hi!
Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

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

* [LTP] [PATCH 2/2] test_robind.sh: add xfs and btrfs support
  2015-11-05 12:20   ` Cyril Hrubis
@ 2015-11-05 12:55     ` Eryu Guan
  0 siblings, 0 replies; 7+ messages in thread
From: Eryu Guan @ 2015-11-05 12:55 UTC (permalink / raw)
  To: ltp

On Thu, Nov 05, 2015 at 01:20:56PM +0100, Cyril Hrubis wrote:
> Hi!
> > Add btrfs support and fix opts for xfs, which needs "-f" too.
> > 
> > Signed-off-by: Eryu Guan <eguan@redhat.com>
> > ---
> >  testcases/kernel/fs/fs_readonly/test_robind.sh | 13 ++++++++++---
> >  1 file changed, 10 insertions(+), 3 deletions(-)
> > 
> > diff --git a/testcases/kernel/fs/fs_readonly/test_robind.sh b/testcases/kernel/fs/fs_readonly/test_robind.sh
> > index 5674ca4..371d5fa 100755
> > --- a/testcases/kernel/fs/fs_readonly/test_robind.sh
> > +++ b/testcases/kernel/fs/fs_readonly/test_robind.sh
> > @@ -197,10 +197,17 @@ for fstype in $FSTYPES; do
> >  	opts="-F"
> >  	if [ "$fstype" = "reiserfs" ]; then
> >  		opts="-f --journal-size 513 -q"
> > -	elif [ "$fstype" = "jfs" ]; then
> > +	elif [ "$fstype" = "jfs" -o "$fstype" = "xfs" ]; then
> >  		opts="-f"
> > -	elif [ "$fstype" = "xfs" ]; then
> > -		opts=""
> > +	elif [ "$fstype" = "btrfs" ]; then
> > +		# check if mkfs.btrfs supports -f option
> > +		# detect "-f --force" or "-f|--force" because btrfs-progs
> > +		# changes usage text in commit 3f312d500b73
> > +		if mkfs.btrfs 2>&1 | grep -q '\-f[ |]'; then
> > +			opts="-f"
> > +		else
> > +			opts=""
> > +		fi
> >  	fi
> 
> We have this special cases in tst_mkfs function in test.sh, you should
> really use that instead of copying the code around.

Thanks for the reminder, I was not aware of tst_mkfs helper.

> 
> Lookin at the code in test.sh we should add special case for jfs there
> and call tst_mkfs here instead of mkfs.$fstype.

Will update the helper and use it.

Thanks!

Eryu

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

* [LTP] [PATCH 1/2] test_robind.sh: set default FSTYPES to LTP_BIG_DEV_FS_TYPE
  2015-10-31  6:43 [LTP] [PATCH 1/2] test_robind.sh: set default FSTYPES to LTP_BIG_DEV_FS_TYPE Eryu Guan
  2015-10-31  6:43 ` [LTP] [PATCH 2/2] test_robind.sh: add xfs and btrfs support Eryu Guan
  2015-11-05 12:22 ` [LTP] [PATCH 1/2] test_robind.sh: set default FSTYPES to LTP_BIG_DEV_FS_TYPE Cyril Hrubis
@ 2015-11-09  6:31 ` Lei Li
  2015-11-09  6:55   ` Eryu Guan
  2 siblings, 1 reply; 7+ messages in thread
From: Lei Li @ 2015-11-09  6:31 UTC (permalink / raw)
  To: ltp

> In test_robind.sh LTP_BIG_DEV is used, so use LTP_BIG_DEV_FS_TYPE as
> default fs type accordingly. If LTP_BIG_DEV_FS_TYPE is not set, fall
> back to ext3.
>
> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
>   testcases/kernel/fs/fs_readonly/test_robind.sh | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/fs/fs_readonly/test_robind.sh b/testcases/kernel/fs/fs_readonly/test_robind.sh
> index 0513275..5674ca4 100755
> --- a/testcases/kernel/fs/fs_readonly/test_robind.sh
> +++ b/testcases/kernel/fs/fs_readonly/test_robind.sh
> @@ -123,9 +123,10 @@ setup()
>   		mkdir -p $dir
>   	done
>
> -	# populating the default FS as ext3, if FS is not given
> +	# populating the default FS as $LTP_BIG_DEV_FS_TYPE
> +	# (or ext3 if it's not set), if FS is not given
>   	if [ -z "$*" ]; then
> -		FSTYPES="ext3"
> +		FSTYPES=${LTP_BIG_DEV_FS_TYPE:-ext3}
Hi!
	Except LTP_BIG_DEV is not set, is there any chance that 
LTP_BIG_DEV_FS_TYP will be NULL? If LTP_BIG_DEV is not set, this test 
case will exit with a tst_brkm, and if LTP_BIG_DEV is set, 
LTP_BIG_DEV_FS_TYPE always gets a value in runltp script, here is the 
snippet:

     if [ -z "$BIG_DEVICE" ]; then
         echo "no big block device was specified on commandline."
         echo "Tests which require a big block device are disabled."
         echo "You can specify it with option -z"
     else
         export LTP_BIG_DEV=$BIG_DEVICE
         if [ -z "$BIG_DEVICE_FS_TYPE" ]; then
             export LTP_BIG_DEV_FS_TYPE="ext2"
         else
             export LTP_BIG_DEV_FS_TYPE=$BIG_DEVICE_FS_TYPE
         fi
     fi

IMHO, FSTYPES should be ${LTP_BIG_DEV_FS_TYP} rather than 
${LTP_BIG_DEV_FS_TYPE:-ext3}.
>   	else
>   		FSTYPES="$*"
>   	fi
>

Thanks
-- 
Rock Lee
rocklee_104@outlook.com

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

* [LTP] [PATCH 1/2] test_robind.sh: set default FSTYPES to LTP_BIG_DEV_FS_TYPE
  2015-11-09  6:31 ` Lei Li
@ 2015-11-09  6:55   ` Eryu Guan
  0 siblings, 0 replies; 7+ messages in thread
From: Eryu Guan @ 2015-11-09  6:55 UTC (permalink / raw)
  To: ltp

On Mon, Nov 09, 2015 at 02:31:32PM +0800, Lei Li wrote:
> >In test_robind.sh LTP_BIG_DEV is used, so use LTP_BIG_DEV_FS_TYPE as
> >default fs type accordingly. If LTP_BIG_DEV_FS_TYPE is not set, fall
> >back to ext3.
> >
> >Signed-off-by: Eryu Guan <eguan@redhat.com>
> >---
> >  testcases/kernel/fs/fs_readonly/test_robind.sh | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> >diff --git a/testcases/kernel/fs/fs_readonly/test_robind.sh b/testcases/kernel/fs/fs_readonly/test_robind.sh
> >index 0513275..5674ca4 100755
> >--- a/testcases/kernel/fs/fs_readonly/test_robind.sh
> >+++ b/testcases/kernel/fs/fs_readonly/test_robind.sh
> >@@ -123,9 +123,10 @@ setup()
> >  		mkdir -p $dir
> >  	done
> >
> >-	# populating the default FS as ext3, if FS is not given
> >+	# populating the default FS as $LTP_BIG_DEV_FS_TYPE
> >+	# (or ext3 if it's not set), if FS is not given
> >  	if [ -z "$*" ]; then
> >-		FSTYPES="ext3"
> >+		FSTYPES=${LTP_BIG_DEV_FS_TYPE:-ext3}
> Hi!
> 	Except LTP_BIG_DEV is not set, is there any chance that LTP_BIG_DEV_FS_TYP
> will be NULL? If LTP_BIG_DEV is not set, this test case will exit with a
> tst_brkm, and if LTP_BIG_DEV is set, LTP_BIG_DEV_FS_TYPE always gets a value
> in runltp script, here is the snippet:

When we "export LTP_BIG_DEV=xxx" but don't export LTP_BIG_DEV_FS_TYPE

> 
>     if [ -z "$BIG_DEVICE" ]; then
>         echo "no big block device was specified on commandline."
>         echo "Tests which require a big block device are disabled."
>         echo "You can specify it with option -z"

runltp checks "$BIG_DEVICE" here, but test_robind.sh checks
"$LTP_BIG_DEV" and tst_brkm if it's empty. So we can export LTP_BIG_DEV
directly to bypass the BIG_DEVICE check in runltp and get no
LTP_BIG_DEV_FS_TYPE set.

Thanks,
Eryu

>     else
>         export LTP_BIG_DEV=$BIG_DEVICE
>         if [ -z "$BIG_DEVICE_FS_TYPE" ]; then
>             export LTP_BIG_DEV_FS_TYPE="ext2"
>         else
>             export LTP_BIG_DEV_FS_TYPE=$BIG_DEVICE_FS_TYPE
>         fi
>     fi
> 
> IMHO, FSTYPES should be ${LTP_BIG_DEV_FS_TYP} rather than
> ${LTP_BIG_DEV_FS_TYPE:-ext3}.
> >  	else
> >  		FSTYPES="$*"
> >  	fi
> >
> 
> Thanks
> -- 
> Rock Lee
> rocklee_104@outlook.com

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

end of thread, other threads:[~2015-11-09  6:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-31  6:43 [LTP] [PATCH 1/2] test_robind.sh: set default FSTYPES to LTP_BIG_DEV_FS_TYPE Eryu Guan
2015-10-31  6:43 ` [LTP] [PATCH 2/2] test_robind.sh: add xfs and btrfs support Eryu Guan
2015-11-05 12:20   ` Cyril Hrubis
2015-11-05 12:55     ` Eryu Guan
2015-11-05 12:22 ` [LTP] [PATCH 1/2] test_robind.sh: set default FSTYPES to LTP_BIG_DEV_FS_TYPE Cyril Hrubis
2015-11-09  6:31 ` Lei Li
2015-11-09  6:55   ` Eryu Guan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.