Skip to contentSkip to conversation

Skip _check_test_fs unless a test is actually run

PATCH In review Theodore Ts'o 3 participants 9 messages Jun 19, 2009 – Jun 20, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Skip _check_test_fs unless a test is actually run

Running _check_test_fs can take a non-trivial amount of time, and if a test has been skipped because it doesn't work on Linux, or it doesn't work of for ext4, it's pointless to re-run _check_test_fs. So move the call to _check_test_fs so it is only run if a test is actually run.

---
 check |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
check +1 -1
index 545c010..1aae528 100755
@@ -308,10 +308,10 @@ do
     then
 	try="$try $seq"
 	n_try=`expr $n_try + 1`
+        _check_test_fs
     fi
     
     seq="after_$seq"
-    _check_test_fs
 done
 
 interrupt=false
Signature · 6 lines
1.6.3.2.1.gb9f7d.dirty

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw

PATCH 2/3 Fix common.config to allow SCRATCH_DEV and SCRATCH_MNT to be optional

Commit 3ae9f2f8 purports to allow SCRATCH_DEV and SCRATCH_MNT to be optional, but tests in common.config will cause check to exit with an error if these environment variables are not defined. Fix this problem.

---
 common.config |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
common.config +4 -4
index 64df893..b304247 100644
@@ -23,10 +23,10 @@
 #                   mounted XFS file system, needs to be be world
 #                   writeable
 # TEST_DEV -        device for file system containing TEST_DIR
-# SCRATCH_DEV -     device you can make a scratch file system on
-# SCRATCH_MNT -     mount point for scratch file system
 #
 # and optionally:
+# SCRATCH_DEV -     device you can make a scratch file system on
+# SCRATCH_MNT -     mount point for scratch file system
 # SCRATCH_LOGDEV -  scratch log device for external log testing
 # SCRATCH_RTDEV -   scratch rt dev
 # TEST_LOGDEV -     test log device for external log testing
@@ -202,8 +202,8 @@ known_hosts()
   [ -z "$TEST_DIR" ]       && MC="$MC TEST_DIR"
   [ -z "$TEST_DEV" ]       && MC="$MC TEST_DEV"
 
-  [ -z "$SCRATCH_MNT" ]    && MC="$MC SCRATCH_MNT"
-  [ -z "$SCRATCH_DEV" ]    && MC="$MC SCRATCH_DEV"
+#  [ -z "$SCRATCH_MNT" ]    && MC="$MC SCRATCH_MNT"
+#  [ -z "$SCRATCH_DEV" ]    && MC="$MC SCRATCH_DEV"
 
   [ "$MC" ] && (echo "Warning: need to define parameters for host $HOST";\
 	        echo "       or set variables:"; \
Signature · 6 lines
1.6.3.2.1.gb9f7d.dirty

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw

Re: [PATCH 2/3] Fix common.config to allow SCRATCH_DEV and SCRATCH_MNT to be optional

Quoted 5 lines · Theodore Ts'o

Commit 3ae9f2f8 purports to allow SCRATCH_DEV and SCRATCH_MNT to be optional, but tests in common.config will cause check to exit with an error if these environment variables are not defined. Fix this problem.

Thanks, I've put this in.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw

PATCH 3/3 Fix _require_scratch test for extN, resierfs, gfs2, and btrfs

In reply to Theodore Ts'o

The extN, reiserfs, gfs2, and btrfs filesysytem types should use the same check for a block device as XFS and UDF, and not the test for NFS, which was checking for host:/foo/bar/baz when checking for a scratch device.

Also, the NFS logic was also incorrect, in that it would allow a zero-length SCRATCH_DEV to continue.

---
 common.rc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
common.rc +2 -2
index 581cfba..8b9ba7d 100644
@@ -593,7 +593,7 @@ _supported_os()
 _require_scratch()
 {
     case "$FSTYP" in
-	xfs|udf)
+	xfs|udf|ext2|ext3|ext4|reiserfs|gfs2|btrfs)
 		 if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]
 		 then
 		     _notrun "this test requires a valid \$SCRATCH_DEV"
@@ -603,7 +603,7 @@ _require_scratch()
 		     _notrun "this test requires a valid \$SCRATCH_DEV"
 		 fi
 		 ;;
-	nfs*|ext2|ext3|ext4|reiserfs|gfs2|btrfs)
+	nfs*)
 		 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
 		 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]
 		 then
Signature · 6 lines
1.6.3.2.1.gb9f7d.dirty

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 3/3
#4 lore raw

Re: [PATCH 3/3] Fix _require_scratch test for extN, resierfs, gfs2, and btrfs

Quoted 7 lines · Theodore Ts'o

The extN, reiserfs, gfs2, and btrfs filesysytem types should use the same check for a block device as XFS and UDF, and not the test for NFS, which was checking for host:/foo/bar/baz when checking for a scratch device.

Also, the NFS logic was also incorrect, in that it would allow a zero-length SCRATCH_DEV to continue.

This part wasn't addressed in the patch, right?

Quoted 1 line
Quoted 34 lines

---
common.rc | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)
common.rc +2 -2
index 581cfba..8b9ba7d 100644
@@ -593,7 +593,7 @@ _supported_os()
 _require_scratch()
 {
    case "$FSTYP" in
-	xfs|udf)
+	xfs|udf|ext2|ext3|ext4|reiserfs|gfs2|btrfs)
 		 if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]
 		 then
 		     _notrun "this test requires a valid \$SCRATCH_DEV"
@@ -603,7 +603,7 @@ _require_scratch()
 		     _notrun "this test requires a valid \$SCRATCH_DEV"
 		 fi
 		 ;;
-	nfs*|ext2|ext3|ext4|reiserfs|gfs2|btrfs)
+	nfs*)
 		 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
 		 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]
 		 then
Signature · 6 lines
1.6.3.2.1.gb9f7d.dirty

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#5 lore raw

PATCH 1/1 Fix _require_scratch test for extN, resierfs, gfs2, and btrfs

The extN, reiserfs, gfs2, and btrfs filesysytem types should use the same check for a block device as XFS and UDF, and not the test for NFS, which was checking for host:/foo/bar/baz when checking for a scratch device.

Also, the NFS logic was also incorrect, in that it would allow a zero-length SCRATCH_DEV to continue.

---

Oops, I sent the wrong version of the patch earlier. Sorry about that!!

- Ted

 common.rc |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
common.rc +3 -3
index 581cfba..cfab2cd 100644
@@ -593,7 +593,7 @@ _supported_os()
 _require_scratch()
 {
     case "$FSTYP" in
-	xfs|udf)
+	xfs|udf|ext2|ext3|ext4|reiserfs|gfs2|btrfs)
 		 if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]
 		 then
 		     _notrun "this test requires a valid \$SCRATCH_DEV"
@@ -603,9 +603,9 @@ _require_scratch()
 		     _notrun "this test requires a valid \$SCRATCH_DEV"
 		 fi
 		 ;;
-	nfs*|ext2|ext3|ext4|reiserfs|gfs2|btrfs)
+	nfs*)
 		 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
-		 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]
+		 if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]
 		 then
 		     _notrun "this test requires a valid \$SCRATCH_DEV"
 		 fi
Signature · 6 lines
1.6.3.2.1.gb9f7d.dirty

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#6 lore raw

Re: [PATCH] Fix _require_scratch test for extN, resierfs, gfs2, and btrfs

Quoted 7 lines · Theodore Ts'o

The extN, reiserfs, gfs2, and btrfs filesysytem types should use the same check for a block device as XFS and UDF, and not the test for NFS, which was checking for host:/foo/bar/baz when checking for a scratch device.

Also, the NFS logic was also incorrect, in that it would allow a zero-length SCRATCH_DEV to continue.

Thanks, I've applied this with a small modification to make the local disk case the default in the case statement so that we don't have to touch this function when adding support for additional local filesystems.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/3
#7 lore raw
In reply to Theodore Ts'o
Quoted 4 lines · Theodore Ts'o

Running _check_test_fs can take a non-trivial amount of time, and if a test has been skipped because it doesn't work on Linux, or it doesn't work of for ext4, it's pointless to re-run _check_test_fs. So move the call to _check_test_fs so it is only run if a test is actually run.

Definitely makes sense.

Quoted 1 line
Quoted 20 lines

---
check | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
check +1 -1
index 545c010..1aae528 100755
@@ -308,10 +308,10 @@ do
    then
 	try="$try $seq"
 	n_try=`expr $n_try + 1`
+        _check_test_fs
    fi
 
    seq="after_$seq"
-    _check_test_fs

done

Quoted 8 lines

interrupt=false

Signature · 6 lines
1.6.3.2.1.gb9f7d.dirty

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#8 lore raw
In reply to Theodore Ts'o
Quoted 4 lines · Theodore Ts'o

Running _check_test_fs can take a non-trivial amount of time, and if a test has been skipped because it doesn't work on Linux, or it doesn't work of for ext4, it's pointless to re-run _check_test_fs. So move the call to _check_test_fs so it is only run if a test is actually run.

Thanks, I've put this in.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs