]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/log: add ext4 support for log state probing
authorTheodore Ts'o <tytso@mit.edu>
Sun, 5 Feb 2017 06:53:35 +0000 (01:53 -0500)
committerEryu Guan <eguan@redhat.com>
Mon, 6 Feb 2017 06:15:08 +0000 (14:15 +0800)
This enables generic/052, generic/054, and generic/055 for ext4.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/log

index 82899c67ed854c78b0fac450b1132aa4179d11cb..d1c19ff54bed27a6ab8c39ea69238b6b8571306d 100644 (file)
@@ -228,6 +228,14 @@ _scratch_f2fs_logstate()
     echo $?
 }
 
+_scratch_ext4_logstate()
+{
+    $DUMPE2FS_PROG -h $SCRATCH_DEV 2> /dev/null | tee -a $seqres.full | \
+       grep "^Filesystem features" | grep -q needs_recovery
+    test $? -ne 0
+    echo $?
+}
+
 _scratch_dump_log()
 {
        case "$FSTYP" in
@@ -237,6 +245,9 @@ _scratch_dump_log()
        f2fs)
                $DUMP_F2FS_PROG $SCRATCH_DEV
                ;;
+       ext4)
+               $DUMPE2FS_PROG -h $SCRATCH_DEV
+               ;;
        *)
                ;;
        esac
@@ -251,6 +262,9 @@ _test_dump_log()
        f2fs)
                $DUMP_F2FS_PROG $TEST_DEV
                ;;
+       ext4)
+               $DUMPE2FS_PROG -h $TEST_DEV
+               ;;
        *)
                ;;
        esac
@@ -265,6 +279,9 @@ _print_logstate()
     f2fs)
         dirty=$(_scratch_f2fs_logstate)
         ;;
+    ext4)
+        dirty=$(_scratch_ext4_logstate)
+        ;;
     *)
         ;;
     esac
@@ -532,6 +549,11 @@ _require_logstate()
             _notrun "This test requires dump.f2fs utility."
         fi
         ;;
+    ext4)
+       if [ -z "$DUMPE2FS_PROG" ]; then
+               _notrun "This test requires dumpe2fs utility."
+       fi
+       ;;
     *)
         _notrun "$FSTYP does not support log state probing."
         ;;
@@ -570,6 +592,22 @@ _f2fs_log_config()
     echo "  test10    active_logs=6,background_gc=on,discard,inline_data,inline_dentry"
 }
 
+_ext4_log_config()
+{
+    echo "# mkfs-opt             mount-opt"
+    echo "# ------------------------------"
+    echo "  /dev/null     data=writeback"
+    echo "  /dev/null     data=ordered"
+    echo "  /dev/null     data=journal"
+    echo "  /dev/null     data=ordered,data_err=abort"
+    echo "  /dev/null     data=writeback,nojournal_checksum"
+    echo "  /dev/null     data=ordered,nojournal_checksum"
+    echo "  /dev/null     data=journal,nojournal_checksum"
+    echo "  /dev/null     data=ordered,data_err=abort,nojournal_checksum"
+    echo "  /dev/null     data=writeback,journal_checksum"
+    echo "  /dev/null     data=ordered,journal_checksum"
+}
+
 _get_log_configs()
 {
     case "$FSTYP" in
@@ -579,6 +617,9 @@ _get_log_configs()
     f2fs)
         _f2fs_log_config
         ;;
+    ext4)
+        _ext4_log_config
+        ;;
     *)
         _notrun "$FSTYP does not support log configs."
         ;;