public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: xfs@oss.sgi.com
Subject: [PATCH] Xfstest 245: accept ENOTEMPTY as a valid error for the test
Date: Tue, 30 Nov 2010 15:39:25 -0500	[thread overview]
Message-ID: <1291149565-31762-1-git-send-email-josef@redhat.com> (raw)

Testt 245 only checks to see if the rename returned EEXIST, but according to the
rename(2) manpage, ENOTEMPTY is also a valid result, which is in fact what Btrfs
returns.  So just filter the output for ENOTEMPTY so that either EEXIST or
ENOTEMPTY will pass the test.  It's not pretty I know, but I couldn't really
figure out a good way to get an either/or output to compare.  With this fix
Btrfs now passes 245.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
---
 245 |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 245

diff --git a/245 b/245
old mode 100644
new mode 100755
index 9c1cd3a..02b3173
--- a/245
+++ b/245
@@ -48,6 +48,14 @@ _cleanup()
 	rm -rf $dir
 }
 
+# According to the rename(2) manpage you can get either EEXIST or ENOTEMPTY as an
+# error for trying to rename a non-empty directory, so just catch the error for
+# ENOTMEMPTY and replace it with the EEXIST output so that either result passes
+_filter_directory_not_empty()
+{
+	sed -e "s,Directory not empty,File exists,g"
+}
+ 
 trap "_cleanup ; exit \$status" 0 1 2 3 15
 
 
@@ -59,7 +67,7 @@ touch $dir/aa/1
 mkdir $dir/ab/aa
 touch $dir/ab/aa/2
 
-mv $dir/ab/aa/ $dir 2>&1 | _filter_test_dir
+mv $dir/ab/aa/ $dir 2>&1 | _filter_test_dir | _filter_directory_not_empty
 
 status=0
 exit $status
-- 
1.6.6.1

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

             reply	other threads:[~2010-11-30 20:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30 20:39 Josef Bacik [this message]
2010-11-30 22:26 ` [PATCH] Xfstest 245: accept ENOTEMPTY as a valid error for the test Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291149565-31762-1-git-send-email-josef@redhat.com \
    --to=josef@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox