public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsqa: test 214 leaves files around that cause 236 to fail
@ 2010-06-20 23:42 Dave Chinner
  2010-06-21  7:21 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Chinner @ 2010-06-20 23:42 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

Test 214 and 236 use the same file names for test files in the TEST
filesystem and don't check/create clean initial test state. Hence if
you run 214 then 236, 236 will fail with:

+link: cannot create link `/mnt/test/ouch2' to `/mnt/test/ouch': File exists
+ctime: 1277076527 -> 1277076527
+Fatal error: ctime not updated after link

Ensure that both tests clean up after themselves properly and also
ensure a clean state before they start.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 214 |    2 ++
 236 |   13 +++++--------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/214 b/214
index eb18825..cef7626 100755
--- a/214
+++ b/214
@@ -29,6 +29,7 @@ echo "QA output created by $seq"
 
 _cleanup()
 {
+	rm -f $TEST_DIR/ouch*
 	cd /
 	rm -f $tmp.*
 }
@@ -51,6 +52,7 @@ _supported_os Linux
 [ -n "$XFS_IO_PROG" ] || _notrun "xfs_io executable not found"
 
 rm -f $seq.full
+rm -f $TEST_DIR/ouch*
 
 _require_xfs_io_falloc
 
diff --git a/236 b/236
index 4d257f0..a7500ed 100644
--- a/236
+++ b/236
@@ -30,15 +30,12 @@ echo "QA output created by $seq"
 
 _cleanup()
 {
-	if [ -a $TEST_DIR/ouch2 ]; then
-		rm -f $TEST_DIR/ouch2
-	fi
-	if [ -a $TEST_DIR/ouch ]; then
-		rm -f $TEST_DIR/ouch
-	fi
+	rm -f $TEST_DIR/ouch*
 }
 
 here=`pwd`
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common.rc
@@ -48,6 +45,8 @@ _supported_fs generic
 # only Linux supports fallocate
 _supported_os Linux
 
+rm -f $TEST_DIR/ouch*
+
 # create a file and get its ctime
 touch $TEST_DIR/ouch
 ctime=`stat -c %Z $TEST_DIR/ouch`
@@ -65,8 +64,6 @@ if [ $ctime2 -le $ctime ]; then
 	exit 1
 fi
 
-_cleanup
-
 echo "Test over."
 # success, all done
 status=0
-- 
1.7.1

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

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

* Re: [PATCH] xfsqa: test 214 leaves files around that cause 236 to fail
  2010-06-20 23:42 [PATCH] xfsqa: test 214 leaves files around that cause 236 to fail Dave Chinner
@ 2010-06-21  7:21 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2010-06-21  7:21 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Mon, Jun 21, 2010 at 09:42:58AM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> Test 214 and 236 use the same file names for test files in the TEST
> filesystem and don't check/create clean initial test state. Hence if
> you run 214 then 236, 236 will fail with:
> 
> +link: cannot create link `/mnt/test/ouch2' to `/mnt/test/ouch': File exists
> +ctime: 1277076527 -> 1277076527
> +Fatal error: ctime not updated after link
> 
> Ensure that both tests clean up after themselves properly and also
> ensure a clean state before they start.

Looks good,


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

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

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

end of thread, other threads:[~2010-06-21  7:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-20 23:42 [PATCH] xfsqa: test 214 leaves files around that cause 236 to fail Dave Chinner
2010-06-21  7:21 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox