linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* shared/032 is broken on Fedora
@ 2015-02-11 10:58 Boaz Harrosh
  2015-02-11 13:10 ` Boaz Harrosh
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Boaz Harrosh @ 2015-02-11 10:58 UTC (permalink / raw)
  To: Dave Chinner, xfs, linux-fsdevel


This is not the proper patch just to show a working version for Fedora. But I think
it now breaks the other ARCHs.

What happens is that the output of ${MKFS_PROG}.* is:
	/usr/sbin/mkfs.bfs /usr/sbin/mkfs.btrfs /usr/sbin/mkfs.cramfs /usr/sbin/mkfs.ext2 /usr/sbin/mkfs.ext3 /usr/sbin/mkfs.ext4 ...

So in Fedora sbin has moved to /usr/... and therefor the sed below fails.
My sed foo is not good enough. How to support both places for sbin?

Also why the "_supported_fs xfs btrfs"? So if all those other mkfs.* that are destructive to
foreign filesystem, should the test not fail instead of skipped?
Maybe if the maintainers of all these filesystems day in and day out running xfstests and
see shared/032 failing, they might decide to fix their evil ways. Instead of skipping the
test and the said maintainer just ignores it?

Thanks
Boaz

---
diff --git a/tests/shared/032 b/tests/shared/032
index a410003..726e6b4 100755
--- a/tests/shared/032
+++ b/tests/shared/032
@@ -37,8 +37,8 @@ rm -f $seqres.full
 . ./common/filter
 
 # real QA test starts here
-_supported_fs xfs btrfs
+# _supported_fs xfs btrfs
 _supported_os Linux
 
 _require_scratch_nocheck
 _require_no_large_scratch_dev
@@ -49,8 +49,7 @@ if [ "$FSTYP" == "btrfs" ]; then
 		_notrun "Installed mkfs.btrfs does not support -f option"
 fi
 
-echo "Silence is golden."
-for fs in `echo ${MKFS_PROG}.* | sed -e 's/.sbin.mkfs.//g'`
+for fs in `echo ${MKFS_PROG}.* | sed -e 's/.usr\/sbin.mkfs.//g'`
 do
 	preop=""	# for special input needs
 	preargs=""	# for any special pre-device options

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

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

* Re: shared/032 is broken on Fedora
  2015-02-11 10:58 shared/032 is broken on Fedora Boaz Harrosh
@ 2015-02-11 13:10 ` Boaz Harrosh
  2015-02-11 16:50 ` Eric Sandeen
  2015-02-11 17:11 ` [PATCH] fstests: shared/032 handle mkfs.* in either /sbin or /usr/sbin Eric Sandeen
  2 siblings, 0 replies; 7+ messages in thread
From: Boaz Harrosh @ 2015-02-11 13:10 UTC (permalink / raw)
  To: Boaz Harrosh, Dave Chinner, xfs, linux-fsdevel

On 02/11/2015 12:58 PM, Boaz Harrosh wrote:
> 
> This is not the proper patch just to show a working version for Fedora. But I think
> it now breaks the other ARCHs.
> 
> What happens is that the output of ${MKFS_PROG}.* is:
> 	/usr/sbin/mkfs.bfs /usr/sbin/mkfs.btrfs /usr/sbin/mkfs.cramfs /usr/sbin/mkfs.ext2 /usr/sbin/mkfs.ext3 /usr/sbin/mkfs.ext4 ...
> 
> So in Fedora sbin has moved to /usr/... and therefor the sed below fails.
> My sed foo is not good enough. How to support both places for sbin?
> 
> Also why the "_supported_fs xfs btrfs"? So if all those other mkfs.* that are destructive to
> foreign filesystem, should the test not fail instead of skipped?
> Maybe if the maintainers of all these filesystems day in and day out running xfstests and
> see shared/032 failing, they might decide to fix their evil ways. Instead of skipping the
> test and the said maintainer just ignores it?
> 

I was thinking about fixing this test, say for ext4. And came to the conclusion.

Should I not hack and fix the mount command? This problem is common to all
filesystems. Why do we want to force all mkfs.* maintainers to link with some
global library that checks all registered FSs and see existence of an FS, something
like blkid.

Why not link that library to the driver "mount" command, and not call the
mkfs.$type in question at all unless say --force flag is supplied.

This way I fix this test for all FSs past and future.
(Should I send a patch?)

Thanks
Boaz


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

* Re: shared/032 is broken on Fedora
  2015-02-11 10:58 shared/032 is broken on Fedora Boaz Harrosh
  2015-02-11 13:10 ` Boaz Harrosh
@ 2015-02-11 16:50 ` Eric Sandeen
  2015-02-11 16:55   ` Eric Sandeen
  2015-02-11 17:23   ` Lukáš Czerner
  2015-02-11 17:11 ` [PATCH] fstests: shared/032 handle mkfs.* in either /sbin or /usr/sbin Eric Sandeen
  2 siblings, 2 replies; 7+ messages in thread
From: Eric Sandeen @ 2015-02-11 16:50 UTC (permalink / raw)
  To: Boaz Harrosh, Dave Chinner, xfs, linux-fsdevel, fstests

(cc: fstests list) 

On 2/11/15 4:58 AM, Boaz Harrosh wrote:
> 
> This is not the proper patch just to show a working version for Fedora. But I think
> it now breaks the other ARCHs.
> 
> What happens is that the output of ${MKFS_PROG}.* is:
> 	/usr/sbin/mkfs.bfs /usr/sbin/mkfs.btrfs /usr/sbin/mkfs.cramfs /usr/sbin/mkfs.ext2 /usr/sbin/mkfs.ext3 /usr/sbin/mkfs.ext4 ...
> 
> So in Fedora sbin has moved to /usr/... and therefor the sed below fails.
> My sed foo is not good enough. How to support both places for sbin?

All we really want is the mkfs filesystem type, i.e. the ${FS} in mkfs.${FS}

So 

sed -e 's/.*mkfs.//g'

should work,

awk -F . '{print $NF}' would work too

$ cat mkfses 
/usr/sbin/mkfs.ext4
/sbin/mkfs.ext4

$ cat mkfses | awk -F . '{print $NF}'
ext4
ext4

$ cat mkfses | sed -e 's/.*mkfs.//g'
ext4
ext4

> Also why the "_supported_fs xfs btrfs"? So if all those other mkfs.* that are destructive to
> foreign filesystem, should the test not fail instead of skipped?

mkfs.xfs & mkfs.btrfs are the only filesystems I know of which check for
an existing format before proceeding, so they are the only ones
tested.  Any other fs is skipped, because they are not designed to
do what this test is... testing for.

> Maybe if the maintainers of all these filesystems day in and day out running xfstests and
> see shared/032 failing, they might decide to fix their evil ways. Instead of skipping the
> test and the said maintainer just ignores it?

I think it's just a design decision.  There's no actual requirement to warn about overwriting
a format, so not doing so is not a failure or a bug, IMHO.

-Eric

> Thanks
> Boaz
> 
> ---
> diff --git a/tests/shared/032 b/tests/shared/032
> index a410003..726e6b4 100755
> --- a/tests/shared/032
> +++ b/tests/shared/032
> @@ -37,8 +37,8 @@ rm -f $seqres.full
>  . ./common/filter
>  
>  # real QA test starts here
> -_supported_fs xfs btrfs
> +# _supported_fs xfs btrfs
>  _supported_os Linux
>  
>  _require_scratch_nocheck
>  _require_no_large_scratch_dev
> @@ -49,8 +49,7 @@ if [ "$FSTYP" == "btrfs" ]; then
>  		_notrun "Installed mkfs.btrfs does not support -f option"
>  fi
>  
> -echo "Silence is golden."
> -for fs in `echo ${MKFS_PROG}.* | sed -e 's/.sbin.mkfs.//g'`
> +for fs in `echo ${MKFS_PROG}.* | sed -e 's/.usr\/sbin.mkfs.//g'`
>  do
>  	preop=""	# for special input needs
>  	preargs=""	# for any special pre-device options
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 


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

* Re: shared/032 is broken on Fedora
  2015-02-11 16:50 ` Eric Sandeen
@ 2015-02-11 16:55   ` Eric Sandeen
  2015-02-11 17:23   ` Lukáš Czerner
  1 sibling, 0 replies; 7+ messages in thread
From: Eric Sandeen @ 2015-02-11 16:55 UTC (permalink / raw)
  To: Boaz Harrosh, Dave Chinner, xfs, linux-fsdevel, fstests

On 2/11/15 10:50 AM, Eric Sandeen wrote:
> (cc: fstests list) 
> 
> On 2/11/15 4:58 AM, Boaz Harrosh wrote:
>>
>> This is not the proper patch just to show a working version for Fedora. But I think
>> it now breaks the other ARCHs.
>>
>> What happens is that the output of ${MKFS_PROG}.* is:
>> 	/usr/sbin/mkfs.bfs /usr/sbin/mkfs.btrfs /usr/sbin/mkfs.cramfs /usr/sbin/mkfs.ext2 /usr/sbin/mkfs.ext3 /usr/sbin/mkfs.ext4 ...
>>
>> So in Fedora sbin has moved to /usr/... and therefor the sed below fails.
>> My sed foo is not good enough. How to support both places for sbin?
> 
> All we really want is the mkfs filesystem type, i.e. the ${FS} in mkfs.${FS}
> 
> So 
> 
> sed -e 's/.*mkfs.//g'

Wait, no, I misunderstood what it was working on ;)  Hang on ...

-Eric


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

* [PATCH] fstests: shared/032 handle mkfs.* in either /sbin or /usr/sbin
  2015-02-11 10:58 shared/032 is broken on Fedora Boaz Harrosh
  2015-02-11 13:10 ` Boaz Harrosh
  2015-02-11 16:50 ` Eric Sandeen
@ 2015-02-11 17:11 ` Eric Sandeen
  2015-02-11 17:36   ` [PATCH V2] " Eric Sandeen
  2 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2015-02-11 17:11 UTC (permalink / raw)
  To: Boaz Harrosh, Dave Chinner, xfs, linux-fsdevel, fstests

mkfs programs may live in either /sbin or /usr/sbin, and
the current regexp in this test only catches the latter,
and so the test wont' run properly for the former.

Fix this by iterating over each full path to every mkfs.${FS}
program in ${MKFS.PROG}.*, and extracting the ${FS} part.

We found the paths in the first place by using a wildcard
with the found ${MKFS_PROG}, so we can use that string to
filter out everything except the wildcard match at the end,
which is the fs name we are looking for.

Reported-by: Boaz Harrosh <boaz@plexistor.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/tests/shared/032 b/tests/shared/032
index a410003..8ffb54b 100755
--- a/tests/shared/032
+++ b/tests/shared/032
@@ -50,8 +50,9 @@ if [ "$FSTYP" == "btrfs" ]; then
 fi
 
 echo "Silence is golden."
-for fs in `echo ${MKFS_PROG}.* | sed -e 's/.sbin.mkfs.//g'`
+for mkfs in `echo ${MKFS_PROG}.*`
 do
+	fs=`echo $mkfs | sed -e s:${MKFS_PROG}.::`
 	preop=""	# for special input needs
 	preargs=""	# for any special pre-device options
 	postargs=""	# for any special post-device options



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

* Re: shared/032 is broken on Fedora
  2015-02-11 16:50 ` Eric Sandeen
  2015-02-11 16:55   ` Eric Sandeen
@ 2015-02-11 17:23   ` Lukáš Czerner
  1 sibling, 0 replies; 7+ messages in thread
From: Lukáš Czerner @ 2015-02-11 17:23 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Boaz Harrosh, Dave Chinner, xfs, linux-fsdevel, fstests

On Wed, 11 Feb 2015, Eric Sandeen wrote:

> Date: Wed, 11 Feb 2015 10:50:53 -0600
> From: Eric Sandeen <sandeen@sandeen.net>
> To: Boaz Harrosh <boaz@plexistor.com>, Dave Chinner <david@fromorbit.com>,
>     xfs@oss.sgi.com, linux-fsdevel <linux-fsdevel@vger.kernel.org>,
>     fstests@vger.kernel.org
> Subject: Re: shared/032 is broken on Fedora
> 
> (cc: fstests list) 
> 
> On 2/11/15 4:58 AM, Boaz Harrosh wrote:
> > 
> > This is not the proper patch just to show a working version for Fedora. But I think
> > it now breaks the other ARCHs.
> > 
> > What happens is that the output of ${MKFS_PROG}.* is:
> > 	/usr/sbin/mkfs.bfs /usr/sbin/mkfs.btrfs /usr/sbin/mkfs.cramfs /usr/sbin/mkfs.ext2 /usr/sbin/mkfs.ext3 /usr/sbin/mkfs.ext4 ...
> > 
> > So in Fedora sbin has moved to /usr/... and therefor the sed below fails.
> > My sed foo is not good enough. How to support both places for sbin?
> 
> All we really want is the mkfs filesystem type, i.e. the ${FS} in mkfs.${FS}
> 
> So 
> 
> sed -e 's/.*mkfs.//g'
> 
> should work,
> 
> awk -F . '{print $NF}' would work too
> 
> $ cat mkfses 
> /usr/sbin/mkfs.ext4
> /sbin/mkfs.ext4
> 
> $ cat mkfses | awk -F . '{print $NF}'
> ext4
> ext4
> 
> $ cat mkfses | sed -e 's/.*mkfs.//g'
> ext4
> ext4
> 
> > Also why the "_supported_fs xfs btrfs"? So if all those other mkfs.* that are destructive to
> > foreign filesystem, should the test not fail instead of skipped?
> 
> mkfs.xfs & mkfs.btrfs are the only filesystems I know of which check for
> an existing format before proceeding, so they are the only ones
> tested.  Any other fs is skipped, because they are not designed to
> do what this test is... testing for.

First of all it's not only about other file system, but any common
signatures which the test is ignoring.

Moreover ext4 is looking for existing signatures, but will not complain
in case it's run without the console attached to it so it does not break
existing scripts.

> 
> > Maybe if the maintainers of all these filesystems day in and day out running xfstests and
> > see shared/032 failing, they might decide to fix their evil ways. Instead of skipping the
> > test and the said maintainer just ignores it?
> 
> I think it's just a design decision.  There's no actual requirement to warn about overwriting
> a format, so not doing so is not a failure or a bug, IMHO.

Exactly, also as I said above mkfs.extN is checking for signatures,
but at the same time we can not break scripts people has been using
for lifetime.

-Lukas

> 
> -Eric
> 
> > Thanks
> > Boaz
> > 
> > ---
> > diff --git a/tests/shared/032 b/tests/shared/032
> > index a410003..726e6b4 100755
> > --- a/tests/shared/032
> > +++ b/tests/shared/032
> > @@ -37,8 +37,8 @@ rm -f $seqres.full
> >  . ./common/filter
> >  
> >  # real QA test starts here
> > -_supported_fs xfs btrfs
> > +# _supported_fs xfs btrfs
> >  _supported_os Linux
> >  
> >  _require_scratch_nocheck
> >  _require_no_large_scratch_dev
> > @@ -49,8 +49,7 @@ if [ "$FSTYP" == "btrfs" ]; then
> >  		_notrun "Installed mkfs.btrfs does not support -f option"
> >  fi
> >  
> > -echo "Silence is golden."
> > -for fs in `echo ${MKFS_PROG}.* | sed -e 's/.sbin.mkfs.//g'`
> > +for fs in `echo ${MKFS_PROG}.* | sed -e 's/.usr\/sbin.mkfs.//g'`
> >  do
> >  	preop=""	# for special input needs
> >  	preargs=""	# for any special pre-device options
> > 
> > _______________________________________________
> > xfs mailing list
> > xfs@oss.sgi.com
> > http://oss.sgi.com/mailman/listinfo/xfs
> > 
> 
> --
> 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] 7+ messages in thread

* [PATCH V2] fstests: shared/032 handle mkfs.* in either /sbin or /usr/sbin
  2015-02-11 17:11 ` [PATCH] fstests: shared/032 handle mkfs.* in either /sbin or /usr/sbin Eric Sandeen
@ 2015-02-11 17:36   ` Eric Sandeen
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Sandeen @ 2015-02-11 17:36 UTC (permalink / raw)
  To: Boaz Harrosh, Dave Chinner, xfs, linux-fsdevel, fstests

mkfs executables may live in either /sbin or /usr/sbin, and
the current regexp in this test only catches the former,
and so the test won't run properly with the latter.

Fix this by filtering out whatever was found as
${MKFS_PROG}, rather than a hard-coded /sbin/mkfs path.

Because the list was generated by using a wildcard
with ${MKFS_PROG}.* this will always be the correct filter.

Reported-by: Boaz Harrosh <boaz@plexistor.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: KISS

diff --git a/tests/shared/032 b/tests/shared/032
index a410003..3b06382 100755
--- a/tests/shared/032
+++ b/tests/shared/032
@@ -50,7 +50,7 @@ if [ "$FSTYP" == "btrfs" ]; then
 fi
 
 echo "Silence is golden."
-for fs in `echo ${MKFS_PROG}.* | sed -e 's/.sbin.mkfs.//g'`
+for fs in `echo ${MKFS_PROG}.* | sed -e "s:${MKFS_PROG}.::g"`
 do
 	preop=""	# for special input needs
 	preargs=""	# for any special pre-device options



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

end of thread, other threads:[~2015-02-11 17:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-11 10:58 shared/032 is broken on Fedora Boaz Harrosh
2015-02-11 13:10 ` Boaz Harrosh
2015-02-11 16:50 ` Eric Sandeen
2015-02-11 16:55   ` Eric Sandeen
2015-02-11 17:23   ` Lukáš Czerner
2015-02-11 17:11 ` [PATCH] fstests: shared/032 handle mkfs.* in either /sbin or /usr/sbin Eric Sandeen
2015-02-11 17:36   ` [PATCH V2] " Eric Sandeen

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