]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
Fix v2 log scripts so that they are not run if v2 log support is not there.
authorTim Shimmin <tes@sgi.com>
Fri, 13 Aug 2004 13:06:25 +0000 (13:06 +0000)
committerTim Shimmin <tes@sgi.com>
Fri, 13 Aug 2004 13:06:25 +0000 (13:06 +0000)
018
018.out
082
082.out
086
087
common.log
group

diff --git a/018 b/018
index 5ab3609b2ef8ef01aa39aaefe6ba32cc8c8393b5..72ebec144e3c70bdbd58f089edca7b33988f7327 100755 (executable)
--- a/018
+++ b/018
@@ -55,7 +55,6 @@ _cleanup()
     cd /
     _cleanup_logfiles
     rm -f $tmp.*
-    echo "*** unmount"
     umount $SCRATCH_MNT 2>/dev/null
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -66,6 +65,7 @@ _supported_os IRIX Linux
 # prelim
 rm -f $seq.full $tmp.*
 _require_scratch
+_require_v2log 
 
 # link correct .out file
 _link_out_file $seq.op
diff --git a/018.out b/018.out
index 5867504ede4f03d41993b6e0a01a47d9066bf25a..130c466eaa06a426465da8c8fe09e843afdc7b18 100644 (file)
--- a/018.out
+++ b/018.out
@@ -15,4 +15,3 @@ QA output created by 018
 *** compare logprint: 018.op with 018.fulldir/op.mnt-ologbsize=256k.mkfs-lversion=2.filtered
 *** compare logprint: 018.trans_inode with 018.fulldir/trans_inode.mnt-ologbsize=256k.mkfs-lversion=2.filtered
 *** compare logprint: 018.trans_buf with 018.fulldir/trans_buf.mnt-ologbsize=256k.mkfs-lversion=2.filtered
-*** unmount
diff --git a/082 b/082
index 49ebbaa09fdf8b7ec48cb894bbecde88611a4f55..1b99cf40a7ddb57d9c10e93530afc00c56ba9577 100755 (executable)
--- a/082
+++ b/082
@@ -55,7 +55,6 @@ _cleanup()
     cd /
     _cleanup_logfiles
     rm -f $tmp.*
-    echo "*** unmount"
     umount $SCRATCH_MNT 2>/dev/null
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -67,6 +66,7 @@ _supported_os IRIX Linux
 # prelim
 rm -f $seq.full $tmp.*
 _require_scratch
+_require_v2log 
 
 # link correct .out file
 _link_out_file $seq.op
diff --git a/082.out b/082.out
index c1f1542e90ceffe72361f423bb23e7264caaecfc..c753096397c4971e39cf3029c4d229a0d003057e 100644 (file)
--- a/082.out
+++ b/082.out
@@ -37,4 +37,3 @@ QA output created by 082
 
 *** Cannot mkfs for this test using option specified: -l version=2,su=5120 -l size=2000b ***
 
-*** unmount
diff --git a/086 b/086
index 8a3d0678b74107a758252b55fa13149bb186cef7..8fe339c9969764e22f7ff9e694a6bf8c7fe9ae14 100755 (executable)
--- a/086
+++ b/086
@@ -59,6 +59,7 @@ _supported_os IRIX Linux
 
 rm -f $seq.full $tmp.*
 _require_scratch
+_require_v2log 
 
 echo "*** init FS"
 umount $SCRATCH_DEV >/dev/null 2>&1
diff --git a/087 b/087
index ea8a0a5ce60a97685977b91794a9e601813be613..285953dacbd6b4f405a722aaccf091483f44ff94 100755 (executable)
--- a/087
+++ b/087
@@ -72,6 +72,7 @@ _supported_os IRIX Linux
 
 rm -f $seq.full $tmp.*
 _require_scratch
+_require_v2log 
 
 echo "*** init FS"
 umount $SCRATCH_DEV >/dev/null 2>&1
index 3f277db5115e97492a39afd3bde1316dd7e52843..019dd1c7449c5f1888a59dfcb75c6f8cfdd9e3a3 100644 (file)
@@ -437,6 +437,49 @@ _cmp_op_output()
     fi
 }
 
+# return xfs log version of device
+# e.g.
+#   _log_version /dev/dsk/dks0d1s4
+#
+_log_version()
+{
+    _dev=$1 
+    vers=`xfs_db -c 'sb 0' -c 'p versionnum' -r $_dev | $AWK_PROG '{print $3}'`
+    logver=`echo $vers | sed -e 's/0x[0-9a-f]\([0-9a-f]\)[0-9a-f][0-9a-f]/\1/'` 
+    if [ $logver = 4 -o $logver = 5 -o $logver = 6 -o $logver = 7 -o \
+         $logver = c -o $logver = d -o $logver = e -o $logver = f ]; then
+       echo 2
+    else
+       echo 1
+    fi
+}
+
+_require_v2log()
+{
+    # test out mkfs to see if it supports "-l version=2"
+    export MKFS_OPTIONS="-l version=2"
+    if ! _scratch_mkfs_xfs $extra_ops >>$seq.full 2>&1; then
+        _notrun "mkfs does not support v2 logs"
+    fi
+
+    # test out mount to see if it mounts a v2 log fs
+    export MOUNT_OPTIONS="-o logbsize=32k"
+    if ! _scratch_mount >>$seq.full 2>&1; then
+        _notrun "mount/kernel does not support v2 logs"
+    fi
+
+    # check after unmount to see if it is clean
+    # i.e. it is not a 6.5.25 buggy version checking kernel
+    touch $SCRATCH_MNT/file
+    umount $SCRATCH_DEV >>$seq.full 2>&1
+    if _scratch_xfs_logprint -t | tee -a $seq.full \
+        | head | grep -q "<DIRTY>"; then
+        _notrun "kernel does not support v2 logs"
+    fi
+    # otherwise presume it does support v2 logs...:)
+}
+
 
 # make sure this script returns success
 /bin/true
diff --git a/group b/group
index 4fb1a44581ea1def18dc03bbcdc9885e3a2a7b97..505d6d25983870faf88d40230e33b274e918d365 100644 (file)
--- a/group
+++ b/group
@@ -28,6 +28,7 @@ logprint      tes@sgi.com dxm@sgi.com
 
 # XFS log related testing
 log            tes@sgi.com
+v2log          tes@sgi.com
 
 # xfsdump, xfsrestore, xfsinvutil
 dump           tes@sgi.com ivanr@sgi.com
@@ -87,7 +88,7 @@ ioctl         nathans@sgi.com
 015 other auto
 016 rw auto
 017 other auto
-018 log logprint auto
+018 log logprint v2log auto
 019 mkfs auto
 020 metadata attr auto
 021 db attr auto
@@ -151,13 +152,13 @@ ioctl             nathans@sgi.com
 079 acl attr ioctl metadata auto
 080 rw ioctl
 081 log logprint quota auto
-082 log logprint auto
+082 log logprint v2log auto
 083 rw auto
 084 ioctl rw auto
-085 log
-086 log 
-087 log
-088 perms
+085 log auto
+086 log v2log auto 
+087 log v2log auto
+088 perms auto
 089 metadata auto
 090 rw
 091 rw