diff mbox

fstests: fix error redirection in generic/256

Message ID 20161112164720.GA18127@infradead.org (mailing list archive)
State New, archived
Headers show

Commit Message

Christoph Hellwig Nov. 12, 2016, 4:47 p.m. UTC
Not sure if my shell is the problem here, but I need this explicit
redirection to ignore the error output from mkdir and xfs_io, otherwise
the test fails due to the error messages from these commands.

Signed-off-by: Christoph Hellwig <hch@lst.de>

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

Comments

Eryu Guan Nov. 12, 2016, 6:39 p.m. UTC | #1
On Sat, Nov 12, 2016 at 08:47:20AM -0800, Christoph Hellwig wrote:
> Not sure if my shell is the problem here, but I need this explicit
> redirection to ignore the error output from mkdir and xfs_io, otherwise
> the test fails due to the error messages from these commands.

That's weird, from bash manpage, "&>" should be equivalent to "> ... 2>&1"

There're many other tests use "&>" as well, do you see such failures
from other tests, such as generic/347?

Thanks,
Eryu
--
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
Christoph Hellwig Nov. 13, 2016, 12:11 p.m. UTC | #2
On Sun, Nov 13, 2016 at 02:39:43AM +0800, Eryu Guan wrote:
> On Sat, Nov 12, 2016 at 08:47:20AM -0800, Christoph Hellwig wrote:
> > Not sure if my shell is the problem here, but I need this explicit
> > redirection to ignore the error output from mkdir and xfs_io, otherwise
> > the test fails due to the error messages from these commands.
> 
> That's weird, from bash manpage, "&>" should be equivalent to "> ... 2>&1"
> 
> There're many other tests use "&>" as well, do you see such failures
> from other tests, such as generic/347?

generic/347 works fine for me, but I'm not sure I hit an error there
which would have to be redirected.
--
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
Christoph Hellwig Jan. 9, 2017, 1:40 p.m. UTC | #3
On Sun, Nov 13, 2016 at 02:39:43AM +0800, Eryu Guan wrote:
> On Sat, Nov 12, 2016 at 08:47:20AM -0800, Christoph Hellwig wrote:
> > Not sure if my shell is the problem here, but I need this explicit
> > redirection to ignore the error output from mkdir and xfs_io, otherwise
> > the test fails due to the error messages from these commands.
> 
> That's weird, from bash manpage, "&>" should be equivalent to "> ... 2>&1"
> 
> There're many other tests use "&>" as well, do you see such failures
> from other tests, such as generic/347?

No.  But 256 keeps on failing for me without this.  Given that it's
just a slightly more verbose syntax is there any reason not to just
apply this patch for now?
--
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
Eryu Guan Jan. 10, 2017, 3:46 a.m. UTC | #4
On Mon, Jan 09, 2017 at 05:40:08AM -0800, Christoph Hellwig wrote:
> On Sun, Nov 13, 2016 at 02:39:43AM +0800, Eryu Guan wrote:
> > On Sat, Nov 12, 2016 at 08:47:20AM -0800, Christoph Hellwig wrote:
> > > Not sure if my shell is the problem here, but I need this explicit
> > > redirection to ignore the error output from mkdir and xfs_io, otherwise
> > > the test fails due to the error messages from these commands.
> > 
> > That's weird, from bash manpage, "&>" should be equivalent to "> ... 2>&1"
> > 
> > There're many other tests use "&>" as well, do you see such failures
> > from other tests, such as generic/347?
> 
> No.  But 256 keeps on failing for me without this.  Given that it's
> just a slightly more verbose syntax is there any reason not to just
> apply this patch for now?

Ok, I've queued it up for next update.

Thanks,
Eryu
--
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
Eryu Guan Jan. 10, 2017, 4:27 a.m. UTC | #5
On Mon, Jan 09, 2017 at 05:40:08AM -0800, Christoph Hellwig wrote:
> On Sun, Nov 13, 2016 at 02:39:43AM +0800, Eryu Guan wrote:
> > On Sat, Nov 12, 2016 at 08:47:20AM -0800, Christoph Hellwig wrote:
> > > Not sure if my shell is the problem here, but I need this explicit
> > > redirection to ignore the error output from mkdir and xfs_io, otherwise
> > > the test fails due to the error messages from these commands.
> > 
> > That's weird, from bash manpage, "&>" should be equivalent to "> ... 2>&1"
> > 
> > There're many other tests use "&>" as well, do you see such failures
> > from other tests, such as generic/347?
> 
> No.  But 256 keeps on failing for me without this.  Given that it's
> just a slightly more verbose syntax is there any reason not to just
> apply this patch for now?

BTW, are you using Debian, or your default shell is not bash? If so, I
guess you may hit this

https://www.spinics.net/lists/fstests/msg00686.html

Changing the default shell to bash for fsgqa user should do the work for
you, I guess.

Thanks,
Eryu
--
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
Christoph Hellwig Jan. 10, 2017, 6:28 a.m. UTC | #6
On Tue, Jan 10, 2017 at 12:27:01PM +0800, Eryu Guan wrote:
> BTW, are you using Debian, or your default shell is not bash? If so, I
> guess you may hit this

Yes, this is debian with dash.

> 
> https://www.spinics.net/lists/fstests/msg00686.html
> 
> Changing the default shell to bash for fsgqa user should do the work for
> you, I guess.

I don't think that's a good idea.  But option 2) from Ted's list to
use a specific shell for executions is a good idea.  I'll look into
that.
--
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
diff mbox

Patch

diff --git a/tests/generic/256 b/tests/generic/256
index cfbf790..2db22cd 100755
--- a/tests/generic/256
+++ b/tests/generic/256
@@ -80,7 +80,7 @@  _fill_fs() {
 	# Creation of files or folders
 	# must not be done as root or
 	# reserved blocks will be consumed
-	_user_do "mkdir -p $dir &> /dev/null"
+	_user_do "mkdir -p $dir > /dev/null 2>&1"
 	if [ $? -ne 0 ] ; then
 		return 0
 	fi
@@ -93,7 +93,7 @@  _fill_fs() {
 	while [ $file_size -ge $block_size ]
 	do
 		bytes_written=0
-		_user_do "$XFS_IO_PROG -f -c \"pwrite 0 $file_size\" $dir/$file_count.bin &> /dev/null"
+		_user_do "$XFS_IO_PROG -f -c \"pwrite 0 $file_size\" $dir/$file_count.bin > /dev/null 2>&1"
 
 		if [ -f $dir/$file_count.bin ]
 		then