Dont write to /dev/console explicitly, its bad form.
[xfstests-dev.git] / 044
diff --git a/044 b/044
index b994b7c35b7826e406d4088322213ac785c19478..be5c4de67de20755b193aee070b6b71069466a63 100755 (executable)
--- a/044
+++ b/044
@@ -1,8 +1,7 @@
 #! /bin/sh
-# XFS QA Test No. 044
-# $Id: 1.1 $
+# FS QA Test No. 044
 #
-# external log uuid/format tests
+# external log uuid/format tests (TODO - version 2 log format)
 #
 #-----------------------------------------------------------------------
 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
@@ -52,15 +51,17 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common.filter
 
 # real QA test starts here
+_supported_fs xfs
+_supported_os Linux
 
 _require_logdev
 
 _filter_logprint()
 {
        perl -ne '
-           s/data device: ([\w|\/]+)/data device: DDEV/;
-           s/log device: ([\w|\/]+) daddr: (\d+) length: (\d+)/log device: LDEV daddr: XXX length: XXX/;
-           s/log file: "([\w|\/]+)" daddr: (\d+) length: (\d+)/log device: LDEV daddr: XXX length: XXX/;
+           s/data device: ([\w|\/.-]+)/data device: DDEV/;
+           s/log device: ([\w|\/.-]+) daddr: (\d+) length: (\d+)/log device: LDEV daddr: XXX length: XXX/;
+           s/log file: "([\w|\/.-]+)" daddr: (\d+) length: (\d+)/log device: LDEV daddr: XXX length: XXX/;
            s/uuid: ([abcdef\d-]+)\s+format: (.+)/uuid: UUID format: FORMAT/;
            s/skipped (\w+) zeroed blocks/skipped XXX zeroed blocks/;
            print;
@@ -70,7 +71,7 @@ _filter_logprint()
 _check_mount()
 {
     echo "    *** mount (expect success)"
-    if ! mount -t xfs -o logdev=$SCRATCH_LOGDEV $SCRATCH_DEV $SCRATCH_MNT
+    if ! _scratch_mount
     then
         echo "        !!! mount failed (expecting success)"
         status=1
@@ -89,7 +90,7 @@ _check_mount()
 _check_no_mount()
 {
     echo "    *** mount (expect failure)"
-    if mount -t xfs -o logdev=$SCRATCH_LOGDEV $SCRATCH_DEV $SCRATCH_MNT >$tmp.err 2>&1
+    if _scratch_mount >$tmp.err 2>&1
     then
         cat $tmp.err
         echo "        !!! mount succeeded (expecting failure)"
@@ -122,12 +123,19 @@ _unexpected()
 # 
 _require_scratch
 
-echo -e -n "\n\r*** XFS QA 044 - expect mount failure messages\n\r\n\r" >/dev/console
-
 echo "*** mkfs"
+
+# this test only works for version 1 logs currently
+lversion=1
 lsize=16777216
-ldev=$SCRATCH_LOGDEV
-mkfs_xfs -llogdev=$ldev,size=$lsize $SCRATCH_DEV | _filter_mkfs 2>/dev/null
+_scratch_mkfs_xfs -lsize=$lsize,version=$lversion >$tmp.mkfs0 2>&1
+[ $? -ne 0 ] && \
+    _notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
+_filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs1
+. $tmp.mkfs1
+[ $lversion -ne 1 ] && \
+    _notrun "Cannot run this test yet using MKFS_OPTIONS specified"
+
 _check_mount
 _check_require_logdev