2023-12-28 01:33:56

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 00/11] tests: Add new testcases for ubifs_repair

This patchset add new testcases for UBIFS repair.
Detailed testcases are explained in tests/ubifs_repair-tests/README.txt.

After testing(fs/ubifs/repair.c):
Kernel code coverage: 90%
kernel function coverage: 100%

Zhihao Cheng (11):
tests: Add common libs for ubifs_repair test
tests: ubifs_repair: Add authentication refusing test
tests: ubifs_repair: Add cycle mount+repair test
tests: ubifs_repair: Add powercut+repair+mount test
tests: ubifs_repair: Add corrupt+repair+fault_inject test
tests: ubifs_repair: Add cycle_powercut+repair test
tests: ubifs_repair: Add random_corrupt+repair test
tests: ubifs_repair: Add corrupted images
tests: ubifs_repair: Add bad images repairing test
tests: ubifs_repair: Add run_all script
tests: ubifs_repair: Add README

.gitignore | 9 +
Makefile.am | 2 +
configure.ac | 11 +-
tests/ubifs_repair-tests/Makemodule.am | 52 +++
tests/ubifs_repair-tests/README.txt | 233 ++++++++++++++
tests/ubifs_repair-tests/images/dentry_key.gz | Bin 0 -> 5377 bytes
tests/ubifs_repair-tests/images/dentry_nlen.gz | Bin 0 -> 5386 bytes
tests/ubifs_repair-tests/images/dentry_type.gz | Bin 0 -> 5384 bytes
tests/ubifs_repair-tests/images/dir_lost.gz | Bin 0 -> 5381 bytes
tests/ubifs_repair-tests/images/good.gz | Bin 0 -> 5251 bytes
tests/ubifs_repair-tests/images/inode_data.gz | Bin 0 -> 5297 bytes
tests/ubifs_repair-tests/images/inode_mode.gz | Bin 0 -> 5383 bytes
tests/ubifs_repair-tests/images/inode_nlink.gz | Bin 0 -> 5383 bytes
tests/ubifs_repair-tests/images/inode_size.gz | Bin 0 -> 5384 bytes
tests/ubifs_repair-tests/images/inode_xcnt.gz | Bin 0 -> 5388 bytes
tests/ubifs_repair-tests/images/log.gz | Bin 0 -> 5232 bytes
tests/ubifs_repair-tests/images/lpt_dirty.gz | Bin 0 -> 5360 bytes
tests/ubifs_repair-tests/images/lpt_flags.gz | Bin 0 -> 5361 bytes
tests/ubifs_repair-tests/images/lpt_free.gz | Bin 0 -> 5350 bytes
tests/ubifs_repair-tests/images/lpt_pos.gz | Bin 0 -> 5374 bytes
.../images/master_highest_inum.gz | Bin 0 -> 5034 bytes
tests/ubifs_repair-tests/images/master_lpt.gz | Bin 0 -> 5035 bytes
tests/ubifs_repair-tests/images/master_tnc.gz | Bin 0 -> 5024 bytes
.../ubifs_repair-tests/images/master_total_dead.gz | Bin 0 -> 5033 bytes
.../images/master_total_dirty.gz | Bin 0 -> 5032 bytes
.../ubifs_repair-tests/images/master_total_free.gz | Bin 0 -> 5030 bytes
tests/ubifs_repair-tests/images/root_dir.gz | Bin 0 -> 1298 bytes
tests/ubifs_repair-tests/images/sb_fanout.gz | Bin 0 -> 5322 bytes
tests/ubifs_repair-tests/images/sb_fmt_version.gz | Bin 0 -> 5326 bytes
tests/ubifs_repair-tests/images/sb_leb_size.gz | Bin 0 -> 5324 bytes
tests/ubifs_repair-tests/images/sb_log_lebs.gz | Bin 0 -> 5323 bytes
tests/ubifs_repair-tests/images/sb_min_io_size.gz | Bin 0 -> 5328 bytes
.../images/soft_link_data_len.gz | Bin 0 -> 5389 bytes
tests/ubifs_repair-tests/images/tnc_lv0_key.gz | Bin 0 -> 5414 bytes
tests/ubifs_repair-tests/images/tnc_lv0_len.gz | Bin 0 -> 5420 bytes
tests/ubifs_repair-tests/images/tnc_lv0_pos.gz | Bin 0 -> 5404 bytes
tests/ubifs_repair-tests/images/tnc_noleaf_key.gz | Bin 0 -> 5430 bytes
tests/ubifs_repair-tests/images/tnc_noleaf_len.gz | Bin 0 -> 5437 bytes
tests/ubifs_repair-tests/images/tnc_noleaf_pos.gz | Bin 0 -> 5418 bytes
tests/ubifs_repair-tests/images/xentry_key.gz | Bin 0 -> 5378 bytes
tests/ubifs_repair-tests/images/xentry_nlen.gz | Bin 0 -> 5386 bytes
tests/ubifs_repair-tests/images/xentry_type.gz | Bin 0 -> 5386 bytes
tests/ubifs_repair-tests/images/xinode_flags.gz | Bin 0 -> 5384 bytes
tests/ubifs_repair-tests/images/xinode_key.gz | Bin 0 -> 5383 bytes
tests/ubifs_repair-tests/images/xinode_mode.gz | Bin 0 -> 5386 bytes
tests/ubifs_repair-tests/lib/common.sh.in | 347 +++++++++++++++++++++
.../tests/authentication_refuse.sh.in | 69 ++++
.../cycle_corrupted_repair_fault_inject.sh.in | 233 ++++++++++++++
.../tests/cycle_mount_repair_check.sh.in | 177 +++++++++++
.../tests/cycle_powercut_mount_repair.sh.in | 132 ++++++++
.../tests/powercut_repair_mount.sh.in | 138 ++++++++
.../tests/random_corrupted_repair.sh.in | 205 ++++++++++++
.../tests/repair_bad_image.sh.in | 274 ++++++++++++++++
.../ubifs_repair-tests/ubifs_repair_run_all.sh.in | 59 ++++
54 files changed, 1940 insertions(+), 1 deletion(-)
create mode 100644 tests/ubifs_repair-tests/Makemodule.am
create mode 100644 tests/ubifs_repair-tests/README.txt
create mode 100644 tests/ubifs_repair-tests/images/dentry_key.gz
create mode 100644 tests/ubifs_repair-tests/images/dentry_nlen.gz
create mode 100644 tests/ubifs_repair-tests/images/dentry_type.gz
create mode 100644 tests/ubifs_repair-tests/images/dir_lost.gz
create mode 100644 tests/ubifs_repair-tests/images/good.gz
create mode 100644 tests/ubifs_repair-tests/images/inode_data.gz
create mode 100644 tests/ubifs_repair-tests/images/inode_mode.gz
create mode 100644 tests/ubifs_repair-tests/images/inode_nlink.gz
create mode 100644 tests/ubifs_repair-tests/images/inode_size.gz
create mode 100644 tests/ubifs_repair-tests/images/inode_xcnt.gz
create mode 100644 tests/ubifs_repair-tests/images/log.gz
create mode 100644 tests/ubifs_repair-tests/images/lpt_dirty.gz
create mode 100644 tests/ubifs_repair-tests/images/lpt_flags.gz
create mode 100644 tests/ubifs_repair-tests/images/lpt_free.gz
create mode 100644 tests/ubifs_repair-tests/images/lpt_pos.gz
create mode 100644 tests/ubifs_repair-tests/images/master_highest_inum.gz
create mode 100644 tests/ubifs_repair-tests/images/master_lpt.gz
create mode 100644 tests/ubifs_repair-tests/images/master_tnc.gz
create mode 100644 tests/ubifs_repair-tests/images/master_total_dead.gz
create mode 100644 tests/ubifs_repair-tests/images/master_total_dirty.gz
create mode 100644 tests/ubifs_repair-tests/images/master_total_free.gz
create mode 100644 tests/ubifs_repair-tests/images/root_dir.gz
create mode 100644 tests/ubifs_repair-tests/images/sb_fanout.gz
create mode 100644 tests/ubifs_repair-tests/images/sb_fmt_version.gz
create mode 100644 tests/ubifs_repair-tests/images/sb_leb_size.gz
create mode 100644 tests/ubifs_repair-tests/images/sb_log_lebs.gz
create mode 100644 tests/ubifs_repair-tests/images/sb_min_io_size.gz
create mode 100644 tests/ubifs_repair-tests/images/soft_link_data_len.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_lv0_key.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_lv0_len.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_lv0_pos.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_noleaf_key.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_noleaf_len.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_noleaf_pos.gz
create mode 100644 tests/ubifs_repair-tests/images/xentry_key.gz
create mode 100644 tests/ubifs_repair-tests/images/xentry_nlen.gz
create mode 100644 tests/ubifs_repair-tests/images/xentry_type.gz
create mode 100644 tests/ubifs_repair-tests/images/xinode_flags.gz
create mode 100644 tests/ubifs_repair-tests/images/xinode_key.gz
create mode 100644 tests/ubifs_repair-tests/images/xinode_mode.gz
create mode 100755 tests/ubifs_repair-tests/lib/common.sh.in
create mode 100755 tests/ubifs_repair-tests/tests/authentication_refuse.sh.in
create mode 100755 tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh.in
create mode 100755 tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh.in
create mode 100755 tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh.in
create mode 100755 tests/ubifs_repair-tests/tests/powercut_repair_mount.sh.in
create mode 100755 tests/ubifs_repair-tests/tests/random_corrupted_repair.sh.in
create mode 100755 tests/ubifs_repair-tests/tests/repair_bad_image.sh.in
create mode 100755 tests/ubifs_repair-tests/ubifs_repair_run_all.sh.in

--
2.13.6



2023-12-28 01:34:01

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 01/11] tests: Add common libs for ubifs_repair test

This is a preparation for adding ubifs_repair testcases. Add some common
functions, for example: powercut, load_mtdram, mount_ubifs, encryption
operations, etc.

Signed-off-by: Zhihao Cheng <[email protected]>
---
.gitignore | 1 +
Makefile.am | 1 +
configure.ac | 3 +-
tests/ubifs_repair-tests/Makemodule.am | 2 +
tests/ubifs_repair-tests/lib/common.sh.in | 347 ++++++++++++++++++++++++++++++
5 files changed, 353 insertions(+), 1 deletion(-)
create mode 100644 tests/ubifs_repair-tests/Makemodule.am
create mode 100755 tests/ubifs_repair-tests/lib/common.sh.in

diff --git a/.gitignore b/.gitignore
index 8c51ee5..c811883 100644
--- a/.gitignore
+++ b/.gitignore
@@ -112,6 +112,7 @@ tests/fs-tests/stress/fs_stress00.sh
tests/fs-tests/stress/fs_stress01.sh
tests/ubi-tests/runubitests.sh
tests/ubi-tests/ubi-stress-test.sh
+tests/ubifs_repair-tests/lib/common.sh

#
# Files generated by autotools
diff --git a/Makefile.am b/Makefile.am
index dd14d96..1454233 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -63,6 +63,7 @@ include tests/jittertest/Makemodule.am
include tests/checkfs/Makemodule.am
include tests/fs-tests/Makemodule.am
include tests/mtd-tests/Makemodule.am
+include tests/ubifs_repair-tests/Makemodule.am
endif

if UNIT_TESTS
diff --git a/configure.ac b/configure.ac
index cd48bb0..d3d3589 100644
--- a/configure.ac
+++ b/configure.ac
@@ -354,6 +354,7 @@ AC_CONFIG_FILES([tests/fs-tests/fs_help_all.sh
tests/fs-tests/stress/fs_stress00.sh
tests/fs-tests/stress/fs_stress01.sh
tests/ubi-tests/runubitests.sh
- tests/ubi-tests/ubi-stress-test.sh])
+ tests/ubi-tests/ubi-stress-test.sh
+ tests/ubifs_repair-tests/lib/common.sh])

AC_OUTPUT([Makefile])
diff --git a/tests/ubifs_repair-tests/Makemodule.am b/tests/ubifs_repair-tests/Makemodule.am
new file mode 100644
index 0000000..caa503d
--- /dev/null
+++ b/tests/ubifs_repair-tests/Makemodule.am
@@ -0,0 +1,2 @@
+test_SCRIPTS += \
+ tests/ubifs_repair-tests/lib/common.sh
diff --git a/tests/ubifs_repair-tests/lib/common.sh.in b/tests/ubifs_repair-tests/lib/common.sh.in
new file mode 100755
index 0000000..656b609
--- /dev/null
+++ b/tests/ubifs_repair-tests/lib/common.sh.in
@@ -0,0 +1,347 @@
+#!/bin/sh
+# Copyright (c), 2023-2024, Huawei Technologies Co, Ltd.
+# Author: Zhihao Cheng <[email protected]>
+#
+# Provide basic functions.
+# Notice, all loaded modules(mtdram/nandsim/ubi/ubifs) won't be removed
+# if errors occur, it is useful to debug on problem ubifs image.
+
+UBI_NUM=0
+DEV=/dev/ubi0_0
+MNT=/mnt/test_file_system
+TMP_FILE=/tmp/ubi_test_file
+KEY_FILE=/tmp/key
+nandsim_patt="NAND simulator"
+mtdram_patt="mtdram test device"
+
+function fatal()
+{
+ echo "Error: $1" 1>&2
+ exit 1
+}
+
+function cleanup_handler()
+{
+ local ret="$1"
+
+ # Below is magic to exit with correct exit code
+ if [ "$ret" == "0" ]; then
+ umount $MNT >/dev/null 2>&1 ||:
+ modprobe -r ubifs >/dev/null 2>&1 ||:
+ modprobe -r ubi >/dev/null 2>&1 ||:
+ modprobe -r nandsim >/dev/null 2>&1 ||:
+ modprobe -r mtdram >/dev/null 2>&1 ||:
+ exit 0
+ else
+ exit 1
+ fi
+}
+trap 'cleanup_handler $?' EXIT
+trap 'cleanup_handler 1' HUP PIPE INT QUIT TERM
+
+function find_mtd_device()
+{
+ printf "%s" "$(grep "$1" /proc/mtd | sed -e "s/^mtd\([0-9]\+\):.*$/\1/")"
+}
+
+function powercut()
+{
+ dmesg -c > /dev/null
+ echo 1 > /sys/kernel/debug/ubifs/tst_recovery;
+ while true;
+ do
+ msg=`dmesg -c | grep "Power cut emulated"`;
+ if [[ "$msg" != "" ]];
+ then
+ break;
+ fi
+ done
+ echo 0 > /sys/kernel/debug/ubifs/tst_recovery
+}
+
+# Load mtdram with specified size and PEB size
+# Usage: load_mtdram <flash size> <PEB size>
+# 1. Flash size is specified in MiB
+# 2. PEB size is specified in KiB
+function load_mtdram()
+{
+ local size="$1"; shift
+ local peb_size="$1"; shift
+
+ size="$(($size * 1024))"
+ modprobe mtdram total_size="$size" erase_size="$peb_size"
+}
+
+function check_fsstress()
+{
+ cmd=`fsstress | grep "op_name"`
+ if ! [[ "$cmd" =~ "op_name" ]]; then
+ fatal "fsstress is not found"
+ fi
+}
+
+# Check error messages
+function check_err_msg()
+{
+ msg=`dmesg | grep -E "dump_stack|UBIFS error|switched to read-only mode"`;
+ if [[ "$msg" != "" ]]
+ then
+ dmesg
+ fatal "error message detected!"
+ fi
+ dmesg -c > /dev/null
+}
+
+# Check memleak
+function check_memleak()
+{
+ # CONFIG_DEBUG_KMEMLEAK=y
+ if ! [ -f /sys/kernel/debug/kmemleak ]; then
+ echo "kmemleak is not enabled, skip checking"
+ return;
+ fi
+
+ echo scan > /sys/kernel/debug/kmemleak
+ memleak=`cat /sys/kernel/debug/kmemleak`
+ if [[ "$memleak" != "" ]]; then
+ echo $memleak
+ fatal "kmemleak detected!"
+ fi
+}
+
+# Iterate all files under certain dir
+# $1: dir
+# $2: "md5sum" means that need record md5 for regular file, otherwise don't record md5 for regular file
+function read_dir() {
+ for file in `ls -a $1`
+ do
+ cur_f=$1"/"$file
+ if [ -b $cur_f ]
+ then
+ major=`stat -c %t $cur_f`
+ minor=`stat -c %T $cur_f`
+ echo "block $cur_f $major $minor" >> $TMP_FILE
+ elif [ -c $cur_f ]
+ then
+ major=`stat -c %t $cur_f`
+ minor=`stat -c %T $cur_f`
+ echo "char $cur_f $major $minor" >> $TMP_FILE
+ elif [ -L $cur_f ]
+ then
+ link=`stat -c %N $cur_f`
+ echo "symlink $cur_f $link" >> $TMP_FILE
+ elif [ -S $cur_f ]
+ then
+ echo "sock $cur_f" >> $TMP_FILE
+ elif [ -p $cur_f ]
+ then
+ echo "fifo $cur_f" >> $TMP_FILE
+ elif [ -f $cur_f ]
+ then
+ sz=`stat -c %s $cur_f`
+ if [[ "$2" != "md5sum" ]]; then
+ echo "reg $cur_f $sz" >> $TMP_FILE
+ else
+ md5=`md5sum $cur_f | awk '{print $1}'`
+ echo "reg $cur_f $md5 $sz" >> $TMP_FILE
+ fi
+ elif [ -d $cur_f ]
+ then
+ if [[ $file != '.' && $file != '..' ]]
+ then
+ echo "dir $cur_f" >> $TMP_FILE
+ read_dir $1"/"$file $2
+ fi
+ else
+ fatal "record unknown file type $cur_f"
+ fi
+ done
+}
+
+# Check whether there are files lost after repairing UBIFS
+# $1: "md5sum" means need record md5 for regular file, otherwise don't record md5 for regular file
+function parse_dir()
+{
+ while read line
+ do
+ array=(${line//\ / });
+ f_type=${array[0]};
+ cur_f=${array[1]};
+ cur_info=""
+ if [[ "$f_type" =~ "block" ]]
+ then
+ major=`stat -c %t $cur_f`
+ minor=`stat -c %T $cur_f`
+ cur_info="block $cur_f $major $minor"
+ elif [[ "$f_type" =~ "char" ]]
+ then
+ major=`stat -c %t $cur_f`
+ minor=`stat -c %T $cur_f`
+ cur_info="char $cur_f $major $minor"
+ elif [[ "$f_type" =~ "symlink" ]]
+ then
+ link=`stat -c %N $cur_f`
+ cur_info="symlink $cur_f $link"
+ elif [[ "$f_type" =~ "sock" ]]
+ then
+ cur_info="sock $cur_f"
+ elif [[ "$f_type" =~ "fifo" ]]
+ then
+ cur_info="fifo $cur_f"
+ elif [[ "$f_type" =~ "reg" ]]
+ then
+ sz=`stat -c %s $cur_f`
+ if [[ "$1" != "md5sum" ]]; then
+ cur_info="reg $cur_f $sz"
+ else
+ md5=`md5sum $cur_f | awk '{print $1}'`
+ cur_info="reg $cur_f $md5 $sz"
+ fi
+ elif [[ "$f_type" =~ "dir" ]]
+ then
+ cur_info="dir $cur_f"
+ else
+ fatal "parse unknown file type $cur_f"
+ fi
+ if [[ "$cur_info" != "$line" ]]
+ then
+ fatal "current info $cur_info, but expect $line"
+ fi
+ done < $TMP_FILE
+}
+
+function authentication()
+{
+ keyctl clear @s
+ res=$?
+ if [[ $res != 0 ]]; then
+ fatal "keyctl is not found"
+ fi
+ keyctl add logon ubifs:foo 12345678901234567890123456789012 @s
+}
+
+function encryption_gen_key()
+{
+ # CONFIG_FS_ENCRYPTION=y
+ head -c 64 /dev/urandom > $KEY_FILE
+ cmd=`fscryptctl -h | grep "set_policy"`
+ if ! [[ "$cmd" =~ "set_policy" ]]; then
+ fatal "fscryptctl is not found"
+ fi
+}
+
+function encryption_set_key()
+{
+ mnt=$1
+ # https://github.com/google/fscryptctl
+ key=$(fscryptctl add_key $mnt < $KEY_FILE)
+ fscryptctl set_policy $key $mnt
+ #fscryptctl get_policy $mnt
+ ret=$?
+ if [[ $ret != 0 ]]; then
+ fatal "set encryption policy failed"
+ fi
+}
+
+function mount_ubifs()
+{
+ dev=$1
+ mnt=$2
+ auth=$3
+ if [[ "$auth" == "authentication" ]]; then
+ authentication
+ mount -t ubifs -o auth_key=ubifs:foo,auth_hash_name=sha256 $dev $mnt
+ else
+ mount -t ubifs $dev $mnt
+ fi
+}
+
+function enable_chkfs()
+{
+ echo 1 > /sys/kernel/debug/ubifs/chk_fs
+ echo 1 > /sys/kernel/debug/ubifs/chk_general
+ echo 1 > /sys/kernel/debug/ubifs/chk_index
+ echo 1 > /sys/kernel/debug/ubifs/chk_lprops
+ echo 1 > /sys/kernel/debug/ubifs/chk_orphans
+}
+
+function disable_chkfs()
+{
+ echo 0 > /sys/kernel/debug/ubifs/chk_fs
+ echo 0 > /sys/kernel/debug/ubifs/chk_general
+ echo 0 > /sys/kernel/debug/ubifs/chk_index
+ echo 0 > /sys/kernel/debug/ubifs/chk_lprops
+ echo 0 > /sys/kernel/debug/ubifs/chk_orphans
+}
+
+function inject_mem_err()
+{
+ # CONFIG_FAILSLAB=y
+ # CONFIG_FAIL_PAGE_ALLOC=y
+ local pid=$1;
+
+ if ! [ -f /sys/kernel/debug/failslab/probability ]; then
+ fatal "failslab is not enabled, injection failed"
+ fi
+ if ! [ -f /sys/kernel/debug/fail_page_alloc/probability ]; then
+ fatal "fail_page_alloc is not enabled, injection failed"
+ fi
+
+ echo 1 > /proc/$pid/make-it-fail
+
+ echo Y > /sys/kernel/debug/failslab/task-filter
+ echo 1 > /sys/kernel/debug/failslab/probability # 1% failure
+ echo 10000 > /sys/kernel/debug/failslab/times
+ echo 1 > /sys/kernel/debug/failslab/verbose
+ echo N > /sys/kernel/debug/failslab/ignore-gfp-wait
+
+ echo Y > /sys/kernel/debug/fail_page_alloc/task-filter
+ echo 1 > /sys/kernel/debug/fail_page_alloc/probability
+ echo 10000 > /sys/kernel/debug/fail_page_alloc/times
+ echo 0 > /sys/kernel/debug/fail_page_alloc/verbose
+ echo N > /sys/kernel/debug/fail_page_alloc/ignore-gfp-wait
+}
+
+function cancel_mem_err()
+{
+ echo 0 > /sys/kernel/debug/failslab/probability
+ echo 0 > /sys/kernel/debug/failslab/times
+ echo 0 > /sys/kernel/debug/failslab/verbose
+ echo N > /sys/kernel/debug/failslab/task-filter
+ echo Y > /sys/kernel/debug/failslab/ignore-gfp-wait
+
+ echo 0 > /sys/kernel/debug/fail_page_alloc/probability
+ echo 0 > /sys/kernel/debug/fail_page_alloc/times
+ echo 1 > /sys/kernel/debug/fail_page_alloc/verbose
+ echo N > /sys/kernel/debug/fail_page_alloc/task-filter
+ echo Y > /sys/kernel/debug/fail_page_alloc/ignore-gfp-wait
+}
+
+function inject_io_err()
+{
+ if ! [ -f /sys/kernel/debug/ubi/ubi$UBI_NUM/tst_emulate_io_failures ]; then
+ fatal "tst_emulate_io_failures is not enabled, skip injection"
+ fi
+
+ echo 1 > /sys/kernel/debug/ubi/ubi$UBI_NUM/tst_emulate_io_failures
+}
+
+function cancel_io_err()
+{
+ echo 0 > /sys/kernel/debug/ubi/ubi$UBI_NUM/tst_emulate_io_failures
+}
+
+sysctl -w kernel.panic_on_warn=1
+sysctl -w kernel.panic_on_oops=1
+
+if ! [ -d $MNT ]; then
+ mkdir -p $MNT
+fi
+
+modprobe ubi || fatal "common.sh: cannot load ubi"
+modprobe ubifs || fatal "common.sh: cannot load ubifs"
+if ! [ -f /sys/kernel/debug/ubifs/repair_fs ]; then
+ fatal "common.sh: ubifs_repair is not supported"
+fi
+modprobe -r ubifs
+modprobe -r ubi
--
2.13.6


2023-12-28 01:34:03

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 02/11] tests: ubifs_repair: Add authentication refusing test

Authenticated UBIFS image is not support for UBIFS repair, add testcase
to check that.

Signed-off-by: Zhihao Cheng <[email protected]>
---
.gitignore | 1 +
configure.ac | 3 +-
tests/ubifs_repair-tests/Makemodule.am | 3 +-
.../tests/authentication_refuse.sh.in | 69 ++++++++++++++++++++++
4 files changed, 74 insertions(+), 2 deletions(-)
create mode 100755 tests/ubifs_repair-tests/tests/authentication_refuse.sh.in

diff --git a/.gitignore b/.gitignore
index c811883..7613349 100644
--- a/.gitignore
+++ b/.gitignore
@@ -113,6 +113,7 @@ tests/fs-tests/stress/fs_stress01.sh
tests/ubi-tests/runubitests.sh
tests/ubi-tests/ubi-stress-test.sh
tests/ubifs_repair-tests/lib/common.sh
+tests/ubifs_repair-tests/tests/authentication_refuse.sh

#
# Files generated by autotools
diff --git a/configure.ac b/configure.ac
index d3d3589..a42a55d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -355,6 +355,7 @@ AC_CONFIG_FILES([tests/fs-tests/fs_help_all.sh
tests/fs-tests/stress/fs_stress01.sh
tests/ubi-tests/runubitests.sh
tests/ubi-tests/ubi-stress-test.sh
- tests/ubifs_repair-tests/lib/common.sh])
+ tests/ubifs_repair-tests/lib/common.sh
+ tests/ubifs_repair-tests/tests/authentication_refuse.sh])

AC_OUTPUT([Makefile])
diff --git a/tests/ubifs_repair-tests/Makemodule.am b/tests/ubifs_repair-tests/Makemodule.am
index caa503d..c0a6ea1 100644
--- a/tests/ubifs_repair-tests/Makemodule.am
+++ b/tests/ubifs_repair-tests/Makemodule.am
@@ -1,2 +1,3 @@
test_SCRIPTS += \
- tests/ubifs_repair-tests/lib/common.sh
+ tests/ubifs_repair-tests/lib/common.sh \
+ tests/ubifs_repair-tests/tests/authentication_refuse.sh
diff --git a/tests/ubifs_repair-tests/tests/authentication_refuse.sh.in b/tests/ubifs_repair-tests/tests/authentication_refuse.sh.in
new file mode 100755
index 0000000..b322121
--- /dev/null
+++ b/tests/ubifs_repair-tests/tests/authentication_refuse.sh.in
@@ -0,0 +1,69 @@
+#!/bin/sh
+# Copyright (c), 2023-2024, Huawei Technologies Co, Ltd.
+# Author: Zhihao Cheng <[email protected]>
+#
+# Test Description:
+# Refuse repairing authenticated UBIFS image
+# Running time: 10s
+
+TESTBINDIR=@TESTBINDIR@
+source $TESTBINDIR/common.sh
+
+ID="0xec,0xa1,0x00,0x15" # 128M 128KB 2KB 512-sub-page
+
+function run_test()
+{
+ echo "Do authentication_refused test"
+
+ modprobe nandsim id_bytes=$ID
+ mtdnum="$(find_mtd_device "$nandsim_patt")"
+ flash_eraseall /dev/mtd$mtdnum
+
+ modprobe ubi mtd="$mtdnum,2048,0,0,1" fm_autoconvert || fatal "modprobe ubi fail"
+ ubimkvol -N vol_test -m -n 0 /dev/ubi$UBI_NUM || fatal "mkvol fail"
+ modprobe ubifs || fatal "modprobe ubifs fail"
+
+ mount_ubifs $DEV $MNT "authentication" || fatal "mount ubifs failed"
+ fsstress -d $MNT/fsstress -l0 -p4 -n10000 &
+ sleep $((RANDOM % 5))
+
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ while [ $? -eq 0 ]
+ do
+ killall -9 fsstress > /dev/null 2>&1
+ sleep 1
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ done
+
+ while true
+ do
+ res=`mount | grep "$MNT"`
+ if [[ "$res" == "" ]]
+ then
+ break;
+ fi
+ umount $MNT
+ sleep 0.1
+ done
+
+ echo 'format "UBIFS DBG repair" +pflmt' > /sys/kernel/debug/dynamic_debug/control
+ echo "$DEV" > /sys/kernel/debug/ubifs/repair_fs
+ res=$?
+ if [[ $res == 0 ]]
+ then
+ fatal "repair should not be success!"
+ fi
+
+ check_memleak
+
+ modprobe -r ubifs
+ modprobe -r ubi
+ modprobe -r nandsim
+}
+
+start_t=$(date +%s)
+run_test
+end_t=$(date +%s)
+time_cost=$(( end_t - start_t ))
+echo "Success, cost $time_cost seconds"
+exit 0
--
2.13.6


2023-12-28 01:34:12

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 03/11] tests: ubifs_repair: Add cycle mount+repair test

Do fsstress and repair ubifs image, make sure all files(and their data)
are not lost after repairing. This testcase mainly checks whether
ubifs_repair could corrupt filesystem content in common case.

Signed-off-by: Zhihao Cheng <[email protected]>
---
.gitignore | 1 +
configure.ac | 3 +-
tests/ubifs_repair-tests/Makemodule.am | 3 +-
.../tests/cycle_mount_repair_check.sh.in | 177 +++++++++++++++++++++
4 files changed, 182 insertions(+), 2 deletions(-)
create mode 100755 tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh.in

diff --git a/.gitignore b/.gitignore
index 7613349..1a5fe7e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -114,6 +114,7 @@ tests/ubi-tests/runubitests.sh
tests/ubi-tests/ubi-stress-test.sh
tests/ubifs_repair-tests/lib/common.sh
tests/ubifs_repair-tests/tests/authentication_refuse.sh
+tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh

#
# Files generated by autotools
diff --git a/configure.ac b/configure.ac
index a42a55d..73a3853 100644
--- a/configure.ac
+++ b/configure.ac
@@ -356,6 +356,7 @@ AC_CONFIG_FILES([tests/fs-tests/fs_help_all.sh
tests/ubi-tests/runubitests.sh
tests/ubi-tests/ubi-stress-test.sh
tests/ubifs_repair-tests/lib/common.sh
- tests/ubifs_repair-tests/tests/authentication_refuse.sh])
+ tests/ubifs_repair-tests/tests/authentication_refuse.sh
+ tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh])

AC_OUTPUT([Makefile])
diff --git a/tests/ubifs_repair-tests/Makemodule.am b/tests/ubifs_repair-tests/Makemodule.am
index c0a6ea1..c2556f5 100644
--- a/tests/ubifs_repair-tests/Makemodule.am
+++ b/tests/ubifs_repair-tests/Makemodule.am
@@ -1,3 +1,4 @@
test_SCRIPTS += \
tests/ubifs_repair-tests/lib/common.sh \
- tests/ubifs_repair-tests/tests/authentication_refuse.sh
+ tests/ubifs_repair-tests/tests/authentication_refuse.sh \
+ tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
diff --git a/tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh.in b/tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh.in
new file mode 100755
index 0000000..1f5db3f
--- /dev/null
+++ b/tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh.in
@@ -0,0 +1,177 @@
+#!/bin/sh
+# Copyright (c), 2023-2024, Huawei Technologies Co, Ltd.
+# Author: Zhihao Cheng <[email protected]>
+#
+# Test Description:
+# Do many cycles of mount/fsstress/umount/repair/mount, check whether filesystem
+# content before repairing and after repairing are consistent.
+# Running time: 16h
+
+TESTBINDIR=@TESTBINDIR@
+source $TESTBINDIR/common.sh
+
+# No need to test on large size flash, it will take very long time iterating
+# all files in large filesystem.
+ID="0xec,0xa1,0x00,0x15" # 128M 128KB 2KB 512-sub-page
+
+function run_test()
+{
+ mode=$1
+ encryption=$2
+ modprobe nandsim id_bytes=$ID
+ mtdnum="$(find_mtd_device "$nandsim_patt")"
+ flash_eraseall /dev/mtd$mtdnum
+
+ dmesg -c > /dev/null
+
+ modprobe ubi mtd="$mtdnum,2048,0,0,1" fm_autoconvert || fatal "modprobe ubi fail"
+ ubimkvol -N vol_test -m -n 0 /dev/ubi$UBI_NUM || fatal "mkvol fail"
+ modprobe ubifs || fatal "modprobe ubifs fail"
+
+ echo "Do cycle mount+umount+repair+check_fs_content test ($encryption,$mode)"
+
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_gen_key
+ fi
+
+ round=0
+ while [[ $round -lt 20 ]]
+ do
+ echo "---------------------- ROUND $round ----------------------"
+ let round=$round+1
+
+ mount_ubifs $DEV $MNT || fatal "mount ubifs fail"
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_set_key $MNT
+ fi
+
+ per=`df -Th | grep ubifs | awk '{print $6}'`;
+ if [[ ${per%?} -gt 95 ]]; then
+ # Used > 95%
+ echo "Clean files"
+ rm -rf $MNT/*
+ check_err_msg
+ fi
+
+ # Truncation and writing ops cannot coexist, because ubifs_repair could recover truncated data nodes which leads different md5 results before repairing and after repairing. For example:
+ # 1. write(file, 8K)
+ # 2. truncate(file, 0) # data block 0,1 are truncated
+ # 3. lseek(file, 4K)
+ # 4. write(file, 4K) # data block 1' is created
+ # 5. truncate(file, 8000) # data block 1'' is modified
+ # It is expected that only data block 1'' is found after repairing, but ubifs_repair will try best to recover all nodes(ubifs_repair cannot utilize TNC information), so data block 0 and data block 1'' are found.
+ if [[ "$mode" == "notruncate" ]]
+ then
+ fsstress -d $MNT -l0 -p4 -n10000 -f truncate=0 &
+ elif [[ "$mode" == "nowrite" ]]
+ then
+ fsstress -d $MNT -l0 -p4 -n10000 -f dwrite=0 -f awrite=0 -f write=0 -f writev=0 -f mwrite=0 -f uring_write=0 -f copyrange=0 -f deduperange=0 -f clonerange=0 -f splice=0 &
+ else
+ fsstress -d $MNT -l0 -p4 -n10000 &
+ fi
+
+ sleep $((RANDOM % 30))
+
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ while [ $? -eq 0 ]
+ do
+ killall -9 fsstress > /dev/null 2>&1
+ sleep 1
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ done
+
+ check_err_msg # Make sure new operations are okay after repairing UBIFS
+ sync
+
+ # Record filesystem information
+ rm -f $TMP_FILE 2>/dev/null
+ if [[ "$mode" == "all" ]]
+ then
+ read_dir $MNT "nomd5sum"
+ else
+ read_dir $MNT "md5sum"
+ fi
+
+ while true
+ do
+ res=`mount | grep "$MNT"`
+ if [[ "$res" == "" ]]
+ then
+ break;
+ fi
+ umount $MNT
+ sleep 0.1
+ done
+
+ echo 'format "UBIFS DBG repair" +pflmt' > /sys/kernel/debug/dynamic_debug/control
+ echo "$DEV" > /sys/kernel/debug/ubifs/repair_fs
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "repair fail $res"
+ fi
+
+ # There are no powercut or corruption, error messages won't appear in UBIFS repairing
+ check_err_msg
+
+ check_memleak
+
+ enable_chkfs
+
+ mount_ubifs $DEV $MNT
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "mount fail $res"
+ fi
+
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_set_key $MNT
+ fi
+
+ du -sh $MNT > /dev/null # Make sure all files are accessible
+ ret=$?
+ if [[ $ret != 0 ]]; then
+ fatal "Cannot access all files"
+ fi
+ check_err_msg
+
+ # Check filesystem information
+ if [[ "$mode" == "all" ]]
+ then
+ parse_dir "nomd5sum"
+ else
+ parse_dir "md5sum"
+ fi
+ rm -f $TMP_FILE 2>/dev/null
+
+ umount $MNT
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "unmount fail $res"
+ fi
+
+ check_err_msg
+
+ disable_chkfs
+ done
+
+ modprobe -r ubifs
+ modprobe -r ubi
+ modprobe -r nandsim
+}
+
+check_fsstress
+start_t=$(date +%s)
+for encryption in "encrypted" "noencrypted"; do
+ # This situation is ignored, fsstress (comes from https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git) could invoke open(O_TRUNC), however there is no 'O_TRUNC' passed into open syscall after looking through the code, so we just skip this case for now.
+ #run_test "notruncate" $encryption
+
+ run_test "nowrite" $encryption
+ run_test "all" $encryption
+done
+end_t=$(date +%s)
+time_cost=$(( end_t - start_t ))
+echo "Success, cost $time_cost seconds"
+exit 0
--
2.13.6


2023-12-28 01:35:05

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 05/11] tests: ubifs_repair: Add corrupt+repair+fault_inject test

Inject memory/io fault while repairing corrupted UBIFS images.
This testcase mainly checks whether ubifs_repair has problems (eg.
memleak, UAF, null-ptr-def, etc.) in random error paths. Besides,
it provides a similar way to simulate powercut during repairing,
and checks whether ubifs_repair can fix an UBIFS image after many
repairing rounds interrupted by kinds of errors.

Signed-off-by: Zhihao Cheng <[email protected]>
---
.gitignore | 1 +
configure.ac | 3 +-
tests/ubifs_repair-tests/Makemodule.am | 3 +-
.../cycle_corrupted_repair_fault_inject.sh.in | 233 +++++++++++++++++++++
4 files changed, 238 insertions(+), 2 deletions(-)
create mode 100755 tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh.in

diff --git a/.gitignore b/.gitignore
index d47282c..52396e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -116,6 +116,7 @@ tests/ubifs_repair-tests/lib/common.sh
tests/ubifs_repair-tests/tests/authentication_refuse.sh
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
+tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh

#
# Files generated by autotools
diff --git a/configure.ac b/configure.ac
index 349e4ad..31a7184 100644
--- a/configure.ac
+++ b/configure.ac
@@ -358,6 +358,7 @@ AC_CONFIG_FILES([tests/fs-tests/fs_help_all.sh
tests/ubifs_repair-tests/lib/common.sh
tests/ubifs_repair-tests/tests/authentication_refuse.sh
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
- tests/ubifs_repair-tests/tests/powercut_repair_mount.sh])
+ tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
+ tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh])

AC_OUTPUT([Makefile])
diff --git a/tests/ubifs_repair-tests/Makemodule.am b/tests/ubifs_repair-tests/Makemodule.am
index 92f288a..0a9fb48 100644
--- a/tests/ubifs_repair-tests/Makemodule.am
+++ b/tests/ubifs_repair-tests/Makemodule.am
@@ -2,4 +2,5 @@ test_SCRIPTS += \
tests/ubifs_repair-tests/lib/common.sh \
tests/ubifs_repair-tests/tests/authentication_refuse.sh \
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh \
- tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
+ tests/ubifs_repair-tests/tests/powercut_repair_mount.sh \
+ tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh
diff --git a/tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh.in b/tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh.in
new file mode 100755
index 0000000..9752970
--- /dev/null
+++ b/tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh.in
@@ -0,0 +1,233 @@
+#!/bin/sh
+# Copyright (c), 2023-2024, Huawei Technologies Co, Ltd.
+# Author: Zhihao Cheng <[email protected]>
+#
+# Test Description:
+# For many kinds of flash, do following things
+# 1. mount UBIFS
+# 2. fsstress && unmount
+# 3. inject corruption into UBIFS image randomly
+# 3. repair ubifs && inject kinds of errors(memory, io)
+# 4. check UBIFS mounting result
+# Running time: 10min
+
+TESTBINDIR=@TESTBINDIR@
+source $TESTBINDIR/common.sh
+
+function run_test()
+{
+ local simulator="$1";
+ local size="$2";
+ local peb_size="$3";
+ local page_size="$4";
+ local encryption=$5;
+
+ echo "======================================================================"
+ printf "%s" "$simulator: ${size}MiB PEB size ${peb_size}KiB"
+ if [ "$simulator" = "nandsim" ]; then
+ printf " %s" "page size ${page_size}KiB"
+ fi
+ printf " $encryption\n"
+
+ if [ "$simulator" = "nandsim" ]; then
+ $TESTBINDIR/load_nandsim.sh "$size" "$peb_size" "$page_size" || echo "cannot load nandsim";
+ mtdnum="$(find_mtd_device "$nandsim_patt")"
+ elif [ "$simulator" = "mtdram" ]; then
+ load_mtdram "$size" "$peb_size" || echo "cannot load mtdram"
+ mtdnum="$(find_mtd_device "$mtdram_patt")"
+ else
+ fatal "$simulator is not supported"
+ fi
+
+ flash_eraseall /dev/mtd$mtdnum
+ modprobe ubi mtd="$mtdnum,$page_size,0,0,1" fm_autoconvert || fatal "modprobe ubi fail"
+ ubimkvol -N vol_test -m -n 0 /dev/ubi$UBI_NUM || fatal "mkvol fail"
+ modprobe ubifs || fatal "modprobe ubifs fail"
+ mount_ubifs $DEV $MNT || fatal "mount ubifs fail"
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_gen_key
+ encryption_set_key $MNT
+ fi
+
+ fsstress -d $MNT -l0 -p4 -n10000 &
+
+ sleep $((RANDOM % 20))
+
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ while [ $? -eq 0 ]
+ do
+ killall -9 fsstress > /dev/null 2>&1
+ sleep 1
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ done
+
+ while true
+ do
+ res=`mount | grep "$MNT"`
+ if [[ "$res" == "" ]]
+ then
+ break;
+ fi
+ umount $MNT
+ sleep 0.1
+ done
+
+ # inject corruption
+ times=$((RANDOM % 10))
+ let times=$times+10
+ i=0
+ tot_peb=`cat /sys/class/ubi/ubi$UBI_NUM/total_eraseblocks`;
+
+ modprobe -r ubifs
+ modprobe -r ubi # Stop wear-leveling & erasing worker
+ while [[ $i -lt $times ]]
+ do
+ let i=$i+1;
+ peb=$((RANDOM % $tot_peb));
+ pg=`expr $peb_size \* 1024`;
+ peb_off=`expr $pg \* $peb`
+ pages=`expr $pg / $page_size`;
+ pg=`expr $pages - 2`;
+ pg=$((RANDOM % $pg));
+ pg_off=`expr $pg + 2`;
+ pg_start=`expr $pages \* $peb`;
+ pg=`expr $pg_start + $pg_off`;
+ vid_pg=`expr $pg_start + 1`;
+ dd if=/dev/mtd$mtdnum of=$TMP_FILE bs=$page_size skip=$vid_pg count=1 2>/dev/null;
+ content=`cat $TMP_FILE | grep UBI!`; # vid header magic
+ if [[ "$content" == "" ]]; then
+ # Skip free PEB, otherwise data could be overwritten in ubifs repairing process
+ continue;
+ fi
+ if [[ $((RANDOM % 2)) == 0 ]]; then
+ # Corrupts 1 page
+ dd if=/dev/urandom of=/dev/mtd$mtdnum bs=$page_size seek=$pg count=1;
+ else
+ # Erase 1 LEB, TNC points to an unmapped area
+ flash_erase /dev/mtd$mtdnum $peb_off 1
+ fi
+ done
+ rm -f $TMP_FILE 2>/dev/null
+ sync
+
+ skip=0
+ modprobe ubi mtd="$mtdnum,$page_size,0,0,1" fm_autoconvert
+ ret=$?
+ if [[ $ret != 0 ]]
+ then
+ skip=1
+ echo "UBI layout volume is corrupted, skip"
+ fi
+
+ if [[ $skip == 0 ]]; then
+ modprobe ubifs || fatal "modprobe ubifs2 fail"
+ dmesg -c > /dev/null
+
+ round=0
+ while true;
+ do
+ injected=0
+ inject_mem=0
+ res=0
+ let round=$round+1
+
+ echo 'format "UBIFS DBG repair" +pflmt' > /sys/kernel/debug/dynamic_debug/control
+ if [[ $round -lt 50 ]]; then
+ injected=1
+ echo "$DEV" > /sys/kernel/debug/ubifs/repair_fs &
+ pid=$!
+ if [[ $((RANDOM % 2)) == 0 ]]; then
+ inject_mem_err $pid
+ inject_mem=1
+ fi
+ inject_io_err
+ wait $pid
+ res=$?
+ if [[ $inject_mem == 1 ]]; then
+ cancel_mem_err
+ fi
+ cancel_io_err
+ else
+ echo "$DEV" > /sys/kernel/debug/ubifs/repair_fs
+ res=$?
+ fi
+ if [[ $res != 0 ]]
+ then
+ log=`dmesg | grep "bad node at LEB 0:"`
+ if [[ "$log" != "" ]]
+ then
+ skip=1
+ echo "SB is corrupted, skip repairing & mounting"
+ break
+ else
+ check_memleak
+ # UBI could become ro-mode
+ modprobe -r ubifs
+ modprobe -r ubi
+ modprobe ubi mtd="$mtdnum,$page_size,0,0,1" fm_autoconvert
+ modprobe ubifs || fatal "modprobe ubifs3 fail"
+ if [[ $injected == 0 ]]; then
+ fatal "repair fail $res"
+ fi
+ fi
+ else
+ break
+ fi
+ done
+
+ check_memleak
+
+ dmesg -c > /dev/null # repairing corrupted image could reproduce error messages
+
+ if [[ $skip == 0 ]]; then
+ enable_chkfs
+
+ mount_ubifs $DEV $MNT
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "mount fail $res"
+ fi
+
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_set_key $MNT
+ fi
+
+ du -sh $MNT > /dev/null # Make sure all files are accessible
+ ret=$?
+ if [[ $ret != 0 ]]; then
+ fatal "Cannot access all files"
+ fi
+ # check_err_msg is not suggested in this testcase, because
+ # ubi_io_read(triggered by wear_leveling_worker -> ubi_eba_copy_leb)
+ # could print stack if ecc uncorrectable errors are detected.
+
+ umount $MNT
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "unmount fail $res"
+ fi
+ fi
+
+ modprobe -r ubifs
+ modprobe -r ubi
+ fi
+ modprobe -r $simulator
+
+ echo "----------------------------------------------------------------------"
+}
+
+check_fsstress
+start_t=$(date +%s)
+echo "Do corrruption+cycle_repair_fault_injection test in kinds of flashes"
+for simulator in "mtdram" "nandsim"; do
+ for encryption in "encrypted" "noencrypted"; do
+ run_test "$simulator" "16" "16" "512" $encryption
+ run_test "$simulator" "256" "128" "2048" $encryption
+ done
+done
+end_t=$(date +%s)
+time_cost=$(( end_t - start_t ))
+echo "Success, cost $time_cost seconds"
+exit 0
--
2.13.6


2023-12-28 01:35:14

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 06/11] tests: ubifs_repair: Add cycle_powercut+repair test

Inject powercut while doing fsstress on mounted UBIFS, check the
consistency of UBIFS after repairing.
This testscase mainly makes sure that ubifs_repair can make UBIFS
image be consistent in common stress cases and powercut cases.

Signed-off-by: Zhihao Cheng <[email protected]>
---
.gitignore | 1 +
configure.ac | 3 +-
tests/ubifs_repair-tests/Makemodule.am | 3 +-
.../tests/cycle_powercut_mount_repair.sh.in | 132 +++++++++++++++++++++
4 files changed, 137 insertions(+), 2 deletions(-)
create mode 100755 tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh.in

diff --git a/.gitignore b/.gitignore
index 52396e6..7077b8d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -117,6 +117,7 @@ tests/ubifs_repair-tests/tests/authentication_refuse.sh
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh
+tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh

#
# Files generated by autotools
diff --git a/configure.ac b/configure.ac
index 31a7184..b3dd453 100644
--- a/configure.ac
+++ b/configure.ac
@@ -359,6 +359,7 @@ AC_CONFIG_FILES([tests/fs-tests/fs_help_all.sh
tests/ubifs_repair-tests/tests/authentication_refuse.sh
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
- tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh])
+ tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh
+ tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh])

AC_OUTPUT([Makefile])
diff --git a/tests/ubifs_repair-tests/Makemodule.am b/tests/ubifs_repair-tests/Makemodule.am
index 0a9fb48..4a7f5ed 100644
--- a/tests/ubifs_repair-tests/Makemodule.am
+++ b/tests/ubifs_repair-tests/Makemodule.am
@@ -3,4 +3,5 @@ test_SCRIPTS += \
tests/ubifs_repair-tests/tests/authentication_refuse.sh \
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh \
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh \
- tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh
+ tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh \
+ tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh
diff --git a/tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh.in b/tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh.in
new file mode 100755
index 0000000..792f360
--- /dev/null
+++ b/tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh.in
@@ -0,0 +1,132 @@
+#!/bin/sh
+# Copyright (c), 2023-2024, Huawei Technologies Co, Ltd.
+# Author: Zhihao Cheng <[email protected]>
+#
+# Test Description:
+# Do many cycles of mount/fsstress/powercut/umount/repair/mount, check whether
+# mount is successful.
+# Running time: 9h
+
+TESTBINDIR=@TESTBINDIR@
+source $TESTBINDIR/common.sh
+
+ID="0x20,0xa7,0x00,0x26" # 4G 256KB 4KB 2KB-sub-page
+
+function run_test()
+{
+ local encryption=$1
+
+ echo "Do cycle mount+powercut+repair+umount($encryption) test"
+ modprobe nandsim id_bytes=$ID
+ mtdnum="$(find_mtd_device "$nandsim_patt")"
+ flash_eraseall /dev/mtd$mtdnum
+
+ dmesg -c > /dev/null
+
+ modprobe ubi mtd="$mtdnum,4096,0,0,1" fm_autoconvert || fatal "modprobe ubi fail"
+ ubimkvol -N vol_test -m -n 0 /dev/ubi$UBI_NUM || fatal "mkvol fail"
+ modprobe ubifs || fatal "modprobe ubifs fail"
+
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_gen_key
+ fi
+
+ round=0
+ while [[ $round -lt 60 ]]
+ do
+ echo "---------------------- ROUND $round ----------------------"
+ let round=$round+1
+
+ mount_ubifs $DEV $MNT || fatal "mount ubifs fail"
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_set_key $MNT
+ fi
+
+ if [[ $(($round % 30)) == 0 ]]
+ then
+ echo "Clean files"
+ rm -rf $MNT/*
+ check_err_msg
+ fi
+
+ fsstress -d $MNT -l0 -p4 -n10000 &
+ sleep $((RANDOM % 30))
+ check_err_msg # Make sure new operations are okay after repairing UBIFS
+ powercut
+
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ while [ $? -eq 0 ]
+ do
+ killall -9 fsstress > /dev/null 2>&1
+ sleep 1
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ done
+
+ while true
+ do
+ res=`mount | grep "$MNT"`
+ if [[ "$res" == "" ]]
+ then
+ break;
+ fi
+ umount $MNT
+ sleep 0.1
+ done
+
+ echo 'format "UBIFS DBG repair" +pflmt' > /sys/kernel/debug/dynamic_debug/control
+ echo "$DEV" > /sys/kernel/debug/ubifs/repair_fs
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "repair fail $res"
+ fi
+
+ check_memleak
+
+ dmesg -c > /dev/null # powercut and repairing could reproduce error messages
+
+ enable_chkfs
+
+ mount_ubifs $DEV $MNT
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "mount fail $res"
+ fi
+
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_set_key $MNT
+ fi
+
+ du -sh $MNT > /dev/null # Make sure all files are accessible
+ ret=$?
+ if [[ $ret != 0 ]]; then
+ fatal "Cannot access all files"
+ fi
+ check_err_msg
+
+ umount $MNT
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "unmount fail $res"
+ fi
+
+ check_err_msg
+
+ disable_chkfs
+ done
+
+ modprobe -r ubifs
+ modprobe -r ubi
+ modprobe -r nandsim
+}
+
+check_fsstress
+start_t=$(date +%s)
+run_test "encrypted"
+run_test "noencrypted"
+end_t=$(date +%s)
+time_cost=$(( end_t - start_t ))
+echo "Success, cost $time_cost seconds"
+exit 0
--
2.13.6


2023-12-28 01:35:27

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 07/11] tests: ubifs_repair: Add random_corrupt+repair test

Inject random corruption on UBIFS image by writting random data on
kinds of mtd devices (eg. nand, nor), check the consistency of UBIFS
after repairing.
This testcase simulate random bad UBIFS image caused by hardware
exceptions(eg. ecc uncorrectable, unwritten), and makes sure that
ubifs_repair could make UBIFS be consistent after repairing UBIFS
image.

Signed-off-by: Zhihao Cheng <[email protected]>
---
.gitignore | 1 +
configure.ac | 3 +-
tests/ubifs_repair-tests/Makemodule.am | 3 +-
.../tests/random_corrupted_repair.sh.in | 205 +++++++++++++++++++++
4 files changed, 210 insertions(+), 2 deletions(-)
create mode 100755 tests/ubifs_repair-tests/tests/random_corrupted_repair.sh.in

diff --git a/.gitignore b/.gitignore
index 7077b8d..dbe63b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -118,6 +118,7 @@ tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh
tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh
+tests/ubifs_repair-tests/tests/random_corrupted_repair.sh

#
# Files generated by autotools
diff --git a/configure.ac b/configure.ac
index b3dd453..11d34bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -360,6 +360,7 @@ AC_CONFIG_FILES([tests/fs-tests/fs_help_all.sh
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh
- tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh])
+ tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh
+ tests/ubifs_repair-tests/tests/random_corrupted_repair.sh])

AC_OUTPUT([Makefile])
diff --git a/tests/ubifs_repair-tests/Makemodule.am b/tests/ubifs_repair-tests/Makemodule.am
index 4a7f5ed..323102b 100644
--- a/tests/ubifs_repair-tests/Makemodule.am
+++ b/tests/ubifs_repair-tests/Makemodule.am
@@ -4,4 +4,5 @@ test_SCRIPTS += \
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh \
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh \
tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh \
- tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh
+ tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh \
+ tests/ubifs_repair-tests/tests/random_corrupted_repair.sh
diff --git a/tests/ubifs_repair-tests/tests/random_corrupted_repair.sh.in b/tests/ubifs_repair-tests/tests/random_corrupted_repair.sh.in
new file mode 100755
index 0000000..61ec64e
--- /dev/null
+++ b/tests/ubifs_repair-tests/tests/random_corrupted_repair.sh.in
@@ -0,0 +1,205 @@
+#!/bin/sh
+# Copyright (c), 2023-2024, Huawei Technologies Co, Ltd.
+# Author: Zhihao Cheng <[email protected]>
+#
+# Test Description:
+# For many kinds of flash, do following things
+# 1. mount UBIFS
+# 2. fsstress && unmount
+# 3. inject corruption into UBIFS image randomly
+# 3. repair ubifs
+# 4. check UBIFS mounting result
+# Running time: 10h
+
+TESTBINDIR=@TESTBINDIR@
+source $TESTBINDIR/common.sh
+
+function run_test()
+{
+ local simulator="$1";
+ local size="$2";
+ local peb_size="$3";
+ local page_size="$4";
+ local encryption=$5;
+
+ echo "======================================================================"
+ printf "%s" "$simulator: ${size}MiB PEB size ${peb_size}KiB"
+ if [ "$simulator" = "nandsim" ]; then
+ printf " %s" "page size ${page_size}KiB"
+ fi
+ printf " $encryption\n"
+
+ if [ "$simulator" = "nandsim" ]; then
+ $TESTBINDIR/load_nandsim.sh "$size" "$peb_size" "$page_size" || echo "cannot load nandsim";
+ mtdnum="$(find_mtd_device "$nandsim_patt")"
+ elif [ "$simulator" = "mtdram" ]; then
+ load_mtdram "$size" "$peb_size" || echo "cannot load mtdram"
+ mtdnum="$(find_mtd_device "$mtdram_patt")"
+ else
+ fatal "$simulator is not supported"
+ fi
+
+ flash_eraseall /dev/mtd$mtdnum
+ modprobe ubi mtd="$mtdnum,$page_size,0,0,1" fm_autoconvert || fatal "modprobe ubi fail"
+ ubimkvol -N vol_test -m -n 0 /dev/ubi$UBI_NUM || fatal "mkvol fail"
+ modprobe ubifs || fatal "modprobe ubifs fail"
+ mount_ubifs $DEV $MNT || fatal "mount ubifs fail"
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_gen_key
+ encryption_set_key $MNT
+ fi
+
+ fsstress -d $MNT -l0 -p4 -n10000 &
+
+ while true;
+ do
+ per=`df -Th | grep ubifs | awk '{print $6}'`;
+ if [[ ${per%?} -gt 95 ]]; then
+ # Used > 95%
+ break;
+ fi
+ done
+
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ while [ $? -eq 0 ]
+ do
+ killall -9 fsstress > /dev/null 2>&1
+ sleep 1
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ done
+
+ while true
+ do
+ res=`mount | grep "$MNT"`
+ if [[ "$res" == "" ]]
+ then
+ break;
+ fi
+ umount $MNT
+ sleep 0.1
+ done
+
+ # injection
+ times=$((RANDOM % 10))
+ let times=$times+10
+ i=0
+ tot_peb=`cat /sys/class/ubi/ubi$UBI_NUM/total_eraseblocks`;
+
+ modprobe -r ubifs
+ modprobe -r ubi # Stop wear-leveling & erasing worker
+ while [[ $i -lt $times ]]
+ do
+ let i=$i+1;
+ peb=$((RANDOM % $tot_peb));
+ pg=`expr $peb_size \* 1024`;
+ peb_off=`expr $pg \* $peb`
+ pages=`expr $pg / $page_size`;
+ pg=`expr $pages - 2`;
+ pg=$((RANDOM % $pg));
+ pg_off=`expr $pg + 2`;
+ pg_start=`expr $pages \* $peb`;
+ pg=`expr $pg_start + $pg_off`;
+ vid_pg=`expr $pg_start + 1`;
+ dd if=/dev/mtd$mtdnum of=$TMP_FILE bs=$page_size skip=$vid_pg count=1 2>/dev/null;
+ content=`cat $TMP_FILE | grep UBI!`; # vid header magic
+ if [[ "$content" == "" ]]; then
+ # Skip free PEB, otherwise data could be overwritten in ubifs repairing process
+ continue;
+ fi
+ if [[ $((RANDOM % 2)) == 0 ]]; then
+ # Corrupts 1 page
+ dd if=/dev/urandom of=/dev/mtd$mtdnum bs=$page_size seek=$pg count=1;
+ else
+ # Erase 1 LEB, TNC points to an unmapped area
+ flash_erase /dev/mtd$mtdnum $peb_off 1
+ fi
+ done
+ rm -f $TMP_FILE 2>/dev/null
+ sync
+
+ skip=0
+ modprobe ubi mtd="$mtdnum,$page_size,0,0,1" fm_autoconvert
+ ret=$?
+ if [[ $ret != 0 ]]
+ then
+ skip=1
+ echo "UBI layout volume is corrupted, skip"
+ fi
+
+ if [[ $skip == 0 ]]; then
+ modprobe ubifs || fatal "modprobe ubifs2 fail"
+ dmesg -c > /dev/null
+ echo 'format "UBIFS DBG repair" +pflmt' > /sys/kernel/debug/dynamic_debug/control
+ echo "$DEV" > /sys/kernel/debug/ubifs/repair_fs
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ log=`dmesg | grep "bad node at LEB 0:"`
+ if [[ "$log" != "" ]]
+ then
+ skip=1
+ echo "SB is corrupted, skip repairing & mounting"
+ else
+ fatal "repair fail $res"
+ fi
+ fi
+
+ check_memleak
+
+ if [[ $skip == 0 ]]; then
+ dmesg -c > /dev/null # repairing corrupted image could reproduce error messages
+
+ enable_chkfs
+
+ mount_ubifs $DEV $MNT
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "mount fail $res"
+ fi
+
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_set_key $MNT
+ fi
+
+ du -sh $MNT > /dev/null # Make sure all files are accessible
+ ret=$?
+ if [[ $ret != 0 ]]; then
+ fatal "Cannot access all files"
+ fi
+ # check_err_msg is not suggested in this testcase, because
+ # ubi_io_read(triggered by wear_leveling_worker -> ubi_eba_copy_leb)
+ # could print stack if ecc uncorrectable errors are detected.
+
+ umount $MNT
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "unmount fail $res"
+ fi
+ fi
+ modprobe -r ubifs
+ modprobe -r ubi
+ fi
+ modprobe -r $simulator
+
+ echo "----------------------------------------------------------------------"
+}
+
+check_fsstress
+start_t=$(date +%s)
+echo "Do random_corrruption+repair+mount test in kinds of flashes"
+for simulator in "mtdram" "nandsim"; do
+ for encryption in "encrypted" "noencrypted"; do
+ run_test "$simulator" "16" "16" "512" $encryption
+ run_test "$simulator" "64" "16" "512" $encryption
+ run_test "$simulator" "128" "64" "2048" $encryption
+ run_test "$simulator" "256" "128" "2048" $encryption
+ run_test "$simulator" "512" "128" "2048" $encryption
+ run_test "$simulator" "1024" "512" "2048" $encryption
+ done
+done
+end_t=$(date +%s)
+time_cost=$(( end_t - start_t ))
+echo "Success, cost $time_cost seconds"
+exit 0
--
2.13.6


2023-12-28 01:35:38

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 04/11] tests: ubifs_repair: Add powercut+repair+mount test

Inject powercut while doing fsstress on mounted UBIFS for kinds of
flashes (eg. nand, nor).
This testcase mainly makes sure that ubifs_repair can make UBIFS image
be consistent on different flashes (eg. nand, nor). Because the
min_io_size of nor flash is 1, the UBIFS image on nor flash will be
different from nand flash after doing powercut, so we need make sure
ubifs_repair can handle these two types of flash.

Signed-off-by: Zhihao Cheng <[email protected]>
---
.gitignore | 1 +
configure.ac | 3 +-
tests/ubifs_repair-tests/Makemodule.am | 3 +-
.../tests/powercut_repair_mount.sh.in | 138 +++++++++++++++++++++
4 files changed, 143 insertions(+), 2 deletions(-)
create mode 100755 tests/ubifs_repair-tests/tests/powercut_repair_mount.sh.in

diff --git a/.gitignore b/.gitignore
index 1a5fe7e..d47282c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -115,6 +115,7 @@ tests/ubi-tests/ubi-stress-test.sh
tests/ubifs_repair-tests/lib/common.sh
tests/ubifs_repair-tests/tests/authentication_refuse.sh
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
+tests/ubifs_repair-tests/tests/powercut_repair_mount.sh

#
# Files generated by autotools
diff --git a/configure.ac b/configure.ac
index 73a3853..349e4ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -357,6 +357,7 @@ AC_CONFIG_FILES([tests/fs-tests/fs_help_all.sh
tests/ubi-tests/ubi-stress-test.sh
tests/ubifs_repair-tests/lib/common.sh
tests/ubifs_repair-tests/tests/authentication_refuse.sh
- tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh])
+ tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
+ tests/ubifs_repair-tests/tests/powercut_repair_mount.sh])

AC_OUTPUT([Makefile])
diff --git a/tests/ubifs_repair-tests/Makemodule.am b/tests/ubifs_repair-tests/Makemodule.am
index c2556f5..92f288a 100644
--- a/tests/ubifs_repair-tests/Makemodule.am
+++ b/tests/ubifs_repair-tests/Makemodule.am
@@ -1,4 +1,5 @@
test_SCRIPTS += \
tests/ubifs_repair-tests/lib/common.sh \
tests/ubifs_repair-tests/tests/authentication_refuse.sh \
- tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
+ tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh \
+ tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
diff --git a/tests/ubifs_repair-tests/tests/powercut_repair_mount.sh.in b/tests/ubifs_repair-tests/tests/powercut_repair_mount.sh.in
new file mode 100755
index 0000000..a5c7da6
--- /dev/null
+++ b/tests/ubifs_repair-tests/tests/powercut_repair_mount.sh.in
@@ -0,0 +1,138 @@
+#!/bin/sh
+# Copyright (c), 2023-2024, Huawei Technologies Co, Ltd.
+# Author: Zhihao Cheng <[email protected]>
+#
+# Test Description:
+# For many kinds of flash, do following things
+# 1. mount UBIFS
+# 2. fsstress & powercut & unmount
+# 3. repair ubifs
+# 4. check UBIFS mounting result
+# Running time: 1h
+
+TESTBINDIR=@TESTBINDIR@
+source $TESTBINDIR/common.sh
+
+function run_test()
+{
+ local simulator="$1";
+ local size="$2";
+ local peb_size="$3";
+ local page_size="$4";
+ local encryption=$5;
+
+ echo "======================================================================"
+ printf "%s" "$simulator: ${size}MiB PEB size ${peb_size}KiB"
+ if [ "$simulator" = "nandsim" ]; then
+ printf " %s" "page size ${page_size}KiB"
+ fi
+ printf " $encryption\n"
+
+ if [ "$simulator" = "nandsim" ]; then
+ $TESTBINDIR/load_nandsim.sh "$size" "$peb_size" "$page_size" || echo "cannot load nandsim";
+ mtdnum="$(find_mtd_device "$nandsim_patt")"
+ elif [ "$simulator" = "mtdram" ]; then
+ load_mtdram "$size" "$peb_size" || echo "cannot load mtdram"
+ mtdnum="$(find_mtd_device "$mtdram_patt")"
+ else
+ fatal "$simulator is not supported"
+ fi
+
+ flash_eraseall /dev/mtd$mtdnum
+ modprobe ubi mtd="$mtdnum,$page_size,0,0,1" fm_autoconvert || fatal "modprobe ubi fail"
+ ubimkvol -N vol_test -m -n 0 /dev/ubi$UBI_NUM || fatal "mkvol fail"
+ modprobe ubifs || fatal "modprobe ubifs fail"
+ mount_ubifs $DEV $MNT || fatal "mount ubifs fail"
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_gen_key
+ encryption_set_key $MNT
+ fi
+
+ fsstress -d $MNT -l0 -p4 -n10000 &
+ sleep $((RANDOM % 120))
+ powercut
+
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ while [ $? -eq 0 ]
+ do
+ killall -9 fsstress > /dev/null 2>&1
+ sleep 1
+ ps -e | grep -w fsstress > /dev/null 2>&1
+ done
+
+ while true
+ do
+ res=`mount | grep "$MNT"`
+ if [[ "$res" == "" ]]
+ then
+ break;
+ fi
+ umount $MNT
+ sleep 0.1
+ done
+
+ echo 'format "UBIFS DBG repair" +pflmt' > /sys/kernel/debug/dynamic_debug/control
+ echo "$DEV" > /sys/kernel/debug/ubifs/repair_fs
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "repair fail $res"
+ fi
+
+ check_memleak
+
+ dmesg -c > /dev/null # powercut and repairing could reproduce error messages
+
+ enable_chkfs
+
+ mount_ubifs $DEV $MNT
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "mount fail $res"
+ fi
+
+ if [[ "$encryption" == "encrypted" ]]; then
+ encryption_set_key $MNT
+ fi
+
+ du -sh $MNT > /dev/null # Make sure all files are accessible
+ ret=$?
+ if [[ $ret != 0 ]]; then
+ fatal "Cannot access all files"
+ fi
+ check_err_msg
+
+ umount $MNT
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "unmount fail $res"
+ fi
+
+ check_err_msg
+
+ modprobe -r ubifs
+ modprobe -r ubi
+ modprobe -r $simulator
+
+ echo "----------------------------------------------------------------------"
+}
+
+check_fsstress
+start_t=$(date +%s)
+echo "Do powercut+repair+mount test in kinds of flashes"
+for simulator in "mtdram" "nandsim"; do
+ for encryption in "encrypted" "noencrypted"; do
+ run_test "$simulator" "16" "16" "512" $encryption
+ run_test "$simulator" "64" "16" "512" $encryption
+ run_test "$simulator" "128" "64" "2048" $encryption
+ run_test "$simulator" "256" "128" "2048" $encryption
+ run_test "$simulator" "512" "128" "2048" $encryption
+ run_test "$simulator" "1024" "512" "2048" $encryption
+ done
+done
+end_t=$(date +%s)
+time_cost=$(( end_t - start_t ))
+echo "Success, cost $time_cost seconds"
+exit 0
--
2.13.6


2023-12-28 01:35:41

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 09/11] tests: ubifs_repair: Add bad images repairing test

For kinds of inconsistent UBIFS images(which can simulate corruptions
caused by some potentional UBIFS bug), check repairing result.
This testcase mainly checks whether the behavior is in expected after
repairing specific inconsistent UBIFS image.

Signed-off-by: Zhihao Cheng <[email protected]>
---
.gitignore | 1 +
configure.ac | 3 +-
tests/ubifs_repair-tests/Makemodule.am | 3 +-
.../tests/repair_bad_image.sh.in | 274 +++++++++++++++++++++
4 files changed, 279 insertions(+), 2 deletions(-)
create mode 100755 tests/ubifs_repair-tests/tests/repair_bad_image.sh.in

diff --git a/.gitignore b/.gitignore
index dbe63b7..89bca58 100644
--- a/.gitignore
+++ b/.gitignore
@@ -119,6 +119,7 @@ tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh
tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh
tests/ubifs_repair-tests/tests/random_corrupted_repair.sh
+tests/ubifs_repair-tests/tests/repair_bad_image.sh

#
# Files generated by autotools
diff --git a/configure.ac b/configure.ac
index 11d34bd..1c1c95b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -361,6 +361,7 @@ AC_CONFIG_FILES([tests/fs-tests/fs_help_all.sh
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh
tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh
- tests/ubifs_repair-tests/tests/random_corrupted_repair.sh])
+ tests/ubifs_repair-tests/tests/random_corrupted_repair.sh
+ tests/ubifs_repair-tests/tests/repair_bad_image.sh])

AC_OUTPUT([Makefile])
diff --git a/tests/ubifs_repair-tests/Makemodule.am b/tests/ubifs_repair-tests/Makemodule.am
index 6070b0c..f728823 100644
--- a/tests/ubifs_repair-tests/Makemodule.am
+++ b/tests/ubifs_repair-tests/Makemodule.am
@@ -5,7 +5,8 @@ test_SCRIPTS += \
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh \
tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh \
tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh \
- tests/ubifs_repair-tests/tests/random_corrupted_repair.sh
+ tests/ubifs_repair-tests/tests/random_corrupted_repair.sh \
+ tests/ubifs_repair-tests/tests/repair_bad_image.sh

test_DATA += \
tests/ubifs_repair-tests/images/good.gz \
diff --git a/tests/ubifs_repair-tests/tests/repair_bad_image.sh.in b/tests/ubifs_repair-tests/tests/repair_bad_image.sh.in
new file mode 100755
index 0000000..ce9cb70
--- /dev/null
+++ b/tests/ubifs_repair-tests/tests/repair_bad_image.sh.in
@@ -0,0 +1,274 @@
+#!/bin/sh
+# Copyright (c), 2023-2024, Huawei Technologies Co, Ltd.
+# Author: Zhihao Cheng <[email protected]>
+#
+# Test Description: Tests whether all inconsistent UBIFS images can be fixed
+# as expected.
+# Origin UBIFS image content:
+# /
+# ├── corrupt_file (xattr - user.corrupt:123, 2K data)
+# ├── dir
+# │   ├── block_dev
+# │   ├── char_dev
+# │   ├── dir
+# │   └── file (content: '123')
+# ├── hardl_corrupt_file => corrupt_file
+# └── softl_corrupt_file -> corrupt_file
+#
+# Running time: 2min
+
+TESTBINDIR=@TESTBINDIR@
+source $TESTBINDIR/common.sh
+
+CORRUPT_FILE=corrupt_file
+XATTR_NAME="user.corrupt"
+XATTR_VAL=123
+CORRUPT_FILE_MD5=7d2f953e91033c743ab6a801d5ee6e15
+SOFT_LINK_FILE=softl_corrupt_file
+HARD_LINK_FILE=hardl_corrupt_file
+DIR=dir
+BLOCK_DEV=block_dev
+CHAR_DEV=char_dev
+FILE=file
+FILE_MD5=ba1f2511fc30423bdbb183fe33f3dd0f
+
+function repair_image()
+{
+ local img_type=$1;
+ local img=$2;
+ local repair_failed=$3;
+ local file_exist=$4;
+ local file_nochange=$5
+ local file_xattr_exist=$6;
+ local hard_link_exist=$7;
+ local hard_link_no_change=$8;
+ local hard_link_xattr_exist=$9;
+ local soft_link_exist=${10};
+ local dir_exist=${11};
+
+ echo "======================================================================"
+ echo "repair $img_type, repair_failed:$repair_failed file_exist:$file_exist file_nochange:$file_nochange file_xattr_exist:$file_xattr_exist hard_link_exist:$hard_link_exist hard_link_no_change:$hard_link_no_change:hard_link_xattr_exist $hard_link_xattr_exist:soft_link_exist:$soft_link_exist dir_exist:$dir_exist"
+
+ load_mtdram 1 16 || echo "cannot load mtdram"
+ mtdnum="$(find_mtd_device "$mtdram_patt")"
+
+ gzip -f -k -d $TESTBINDIR/${img}.gz || fatal "gzip failed"
+ flash_eraseall /dev/mtd$mtdnum
+ dd if=$TESTBINDIR/$img of=/dev/mtd$mtdnum bs=1M
+ rm -f $TESTBINDIR/$img
+ modprobe ubi mtd="$mtdnum,0" fm_autoconvert || fatal "modprobe ubi fail"
+ modprobe ubifs || fatal "modprobe ubifs fail"
+
+ echo 'format "UBIFS DBG repair" +pflmt' > /sys/kernel/debug/dynamic_debug/control
+ echo "$DEV" > /sys/kernel/debug/ubifs/repair_fs
+ ret=$?
+ check_memleak
+ if [[ $ret != 0 ]]; then
+ if [[ $repair_failed == 0 ]]; then
+ fatal "repair failed, but expect success"
+ fi
+ echo "repair failed is expected, skip"
+
+ modprobe -r ubifs
+ modprobe -r ubi
+ modprobe -r mtdram
+ echo "----------------------------------------------------------------------"
+
+ return;
+ else
+ if [[ $repair_failed != 0 ]]; then
+ fatal "repair success, but expect failure"
+ fi
+ fi
+
+ dmesg -c > /dev/null # repairing could reproduce error messages
+
+ enable_chkfs
+
+ mount_ubifs $DEV $MNT
+ ret=$?
+ if [[ $ret != 0 ]]; then
+ fatal "mount failed $ret"
+ fi
+
+ du -sh $MNT > /dev/null # Make sure all files are accessible
+ ret=$?
+ if [[ $ret != 0 ]]; then
+ fatal "cannot access all files $ret"
+ fi
+
+ if [[ $file_exist == 1 ]]; then
+ if ! [ -f $MNT/$CORRUPT_FILE ]; then
+ fatal "$MNT/$CORRUPT_FILE is lost"
+ fi
+ else
+ if [ -f $MNT/$CORRUPT_FILE ]; then
+ fatal "$MNT/$CORRUPT_FILE should not exist"
+ fi
+ fi
+
+ md5_after=`md5sum $MNT/$CORRUPT_FILE 2>/dev/null | awk '{print $1}'`
+ if [[ $file_nochange == 1 ]]; then
+ if [[ $CORRUPT_FILE_MD5 != $md5_after ]]; then
+ fatal "content changed for $MNT/$CORRUPT_FILE"
+ fi
+ else
+ if [[ $CORRUPT_FILE_MD5 == $md5_after ]]; then
+ fatal "content not changed for $MNT/$CORRUPT_FILE"
+ fi
+ fi
+
+ xattr=`getfattr -n $XATTR_NAME $MNT/$CORRUPT_FILE 2>/dev/null | grep $XATTR_NAME | awk -F '=' '{ print $2 }'`
+ if [[ $file_xattr_exist == 1 ]]; then
+ if ! [[ "$xattr" =~ "$XATTR_VAL" ]]; then
+ fatal "wrong xattr $xattr for $MNT/$CORRUPT_DENT_NAME"
+ fi
+ else
+ if [[ "$xattr" =~ "$XATTR_VAL" ]]; then
+ fatal "xattr $xattr for $MNT/$CORRUPT_DENT_NAME should not exist"
+ fi
+ fi
+
+ if [[ $hard_link_exist == 1 ]]; then
+ if ! [ -f $MNT/$HARD_LINK_FILE ]; then
+ fatal "$MNT/$HARD_LINK_FILE should is lost"
+ fi
+ else
+ if [ -f $MNT/$HARD_LINK_FILE ]; then
+ fatal "$MNT/$HARD_LINK_FILE should not exist"
+ fi
+ fi
+
+ md5_after=`md5sum $MNT/$HARD_LINK_FILE 2>/dev/null | awk '{print $1}'`
+ if [[ $hard_link_no_change == 1 ]]; then
+ if [[ $CORRUPT_FILE_MD5 != $md5_after ]]; then
+ fatal "content changed for $MNT/$HARD_LINK_FILE"
+ fi
+ else
+ if [[ $CORRUPT_FILE_MD5 == $md5_after ]]; then
+ fatal "content not changed for $MNT/$HARD_LINK_FILE"
+ fi
+ fi
+
+ xattr=`getfattr -n $XATTR_NAME $MNT/$HARD_LINK_FILE 2>/dev/null | grep $XATTR_NAME | awk -F '=' '{ print $2 }'`
+ if [[ $hard_link_xattr_exist == 1 ]]; then
+ if ! [[ "$xattr" =~ "$XATTR_VAL" ]]; then
+ fatal "wrong xattr $xattr for $MNT/$HARD_LINK_FILE"
+ fi
+ else
+ if [[ "$xattr" =~ "$XATTR_VAL" ]]; then
+ fatal "xattr $xattr for $MNT/$HARD_LINK_FILE should not exist"
+ fi
+ fi
+
+ link=`stat -c %N $MNT/$SOFT_LINK_FILE 2>/dev/null | grep $SOFT_LINK_FILE | grep $CORRUPT_FILE`
+ if [[ $soft_link_exist == 1 ]]; then
+ if [[ "$link" == "" ]]; then
+ fatal "$MNT/$SOFT_LINK_FILE is lost"
+ fi
+ else
+ if [[ "$link" != "" ]]; then
+ fatal "$MNT/$SOFT_LINK_FILE should not exist"
+ fi
+ fi
+
+ if [[ $dir_exist == 1 ]]; then
+ if ! [ -d $MNT/$DIR ]; then
+ fatal "$MNT/$DIR is lost"
+ fi
+ if ! [ -d $MNT/$DIR/$DIR ]; then
+ fatal "$MNT/$DIR/$DIR is lost"
+ fi
+ if ! [ -f $MNT/$DIR/$FILE ]; then
+ fatal "$MNT/$DIR/$FILE is lost"
+ fi
+ f_md5=`md5sum $MNT/$DIR/$FILE 2>/dev/null | awk '{print $1}'`
+ if [[ $FILE_MD5 != $f_md5 ]]; then
+ fatal "content changed for $MNT/$DIR/$FILE"
+ fi
+ if ! [ -b $MNT/$DIR/$BLOCK_DEV ]; then
+ fatal "$MNT/$DIR/$BLOCK_DEV is lost"
+ fi
+ major=`stat -c %t $MNT/$DIR/$BLOCK_DEV`
+ minor=`stat -c %T $MNT/$DIR/$BLOCK_DEV`
+ if [[ $major != 1 ]] || [[ $minor != 2 ]]; then
+ echo "major/minor changed for $MNT/$DIR/$BLOCK_DEV"
+ fi
+ if ! [ -c $MNT/$DIR/$CHAR_DEV ]; then
+ fatal "$MNT/$DIR/$CHAR_DEV is lost"
+ fi
+ major=`stat -c %t $MNT/$DIR/$CHAR_DEV`
+ minor=`stat -c %T $MNT/$DIR/$CHAR_DEV`
+ if [[ $major != 0 ]] || [[ $minor != 1 ]]; then
+ echo "major/minor changed for $MNT/$DIR/$CHAR_DEV"
+ fi
+ else
+ if [ -d $MNT/$DIR ]; then
+ fatal "$MNT/$DIR should not exist"
+ fi
+ fi
+
+ umount $MNT
+ res=$?
+ if [[ $res != 0 ]]
+ then
+ fatal "unmount fail $res"
+ fi
+
+ disable_chkfs
+
+ check_err_msg
+
+ modprobe -r ubifs
+ modprobe -r ubi
+ modprobe -r mtdram
+
+ echo "----------------------------------------------------------------------"
+}
+
+start_t=$(date +%s)
+echo "Do inconsistent UBIFS images repairing test"
+repair_image "good image" good 0 1 1 1 1 1 1 1 1
+repair_image "bad sb fanout image" sb_fanout 1 1 1 1 1 1 1 1 1
+repair_image "bad sb fmt_version image" sb_fmt_version 1 1 1 1 1 1 1 1 1
+repair_image "bad sb leb_size image" sb_leb_size 1 1 1 1 1 1 1 1 1
+repair_image "bad sb log_lebs image" sb_log_lebs 1 1 1 1 1 1 1 1 1
+repair_image "bad sb min_io_size image" sb_min_io_size 1 1 1 1 1 1 1 1 1
+repair_image "bad master highest_inum image" master_highest_inum 0 1 1 1 1 1 1 1 1
+repair_image "bad master lpt image" master_lpt 0 1 1 1 1 1 1 1 1
+repair_image "bad master tnc image" master_tnc 0 1 1 1 1 1 1 1 1
+repair_image "bad master total_dead image" master_total_dead 0 1 1 1 1 1 1 1 1
+repair_image "bad master total_dirty image" master_total_dirty 0 1 1 1 1 1 1 1 1
+repair_image "bad master total_free image" master_total_free 0 1 1 1 1 1 1 1 1
+repair_image "bad log image" log 0 1 1 1 1 1 1 1 1
+repair_image "bad lpt dirty image" lpt_dirty 0 1 1 1 1 1 1 1 1
+repair_image "bad lpt lpt_flags image" lpt_flags 0 1 1 1 1 1 1 1 1
+repair_image "bad lpt free image" lpt_free 0 1 1 1 1 1 1 1 1
+repair_image "bad lpt pos image" lpt_pos 0 1 1 1 1 1 1 1 1
+repair_image "bad tnc lv0 key image" tnc_lv0_key 0 1 1 1 1 1 1 1 1
+repair_image "bad tnc lv0 len image" tnc_lv0_len 0 1 1 1 1 1 1 1 1
+repair_image "bad tnc lv0 pos image" tnc_lv0_pos 0 1 1 1 1 1 1 1 1
+repair_image "bad tnc non-leaf key image" tnc_noleaf_key 0 1 1 1 1 1 1 1 1
+repair_image "bad tnc non-leaf len image" tnc_noleaf_len 0 1 1 1 1 1 1 1 1
+repair_image "bad tnc non-leaf pos image" tnc_noleaf_pos 0 1 1 1 1 1 1 1 1
+repair_image "bad inode data image" inode_data 0 1 0 1 1 0 1 1 1
+repair_image "bad inode mode image" inode_mode 0 1 1 1 1 1 1 0 1
+repair_image "bad inode nlink image" inode_nlink 0 1 1 1 1 1 1 1 1
+repair_image "bad inode size image" inode_size 0 1 1 1 1 1 1 1 1
+repair_image "bad inode xattr_cnt image" inode_xcnt 0 1 1 1 1 1 1 1 1
+repair_image "bad softlink data_len image" soft_link_data_len 0 1 1 1 1 1 1 0 1
+repair_image "bad dentry key image" dentry_key 0 0 0 0 1 1 1 1 1
+repair_image "bad dentry nlen image" dentry_nlen 0 0 0 0 1 1 1 1 1
+repair_image "bad dentry type image" dentry_type 0 0 0 0 1 1 1 1 1
+repair_image "bad xattr inode flags image" xinode_flags 0 1 1 0 1 1 0 1 1
+repair_image "bad xattr inode key image" xinode_key 0 1 1 0 1 1 0 1 1
+repair_image "bad xattr inode mode image" xinode_mode 0 1 1 0 1 1 0 1 1
+repair_image "bad xattr dentry key image" xentry_key 0 1 1 0 1 1 0 1 1
+repair_image "bad xattr dentry nlen image" xentry_nlen 0 1 1 0 1 1 0 1 1
+repair_image "bad xattr dentry type image" xentry_type 0 1 1 0 1 1 0 1 1
+repair_image "bad dir image" dir_lost 0 1 1 1 1 1 1 1 0
+repair_image "bad root dir image" root_dir 0 0 0 0 0 0 0 0 0
+end_t=$(date +%s)
+time_cost=$(( end_t - start_t ))
+echo "Success, cost $time_cost seconds"
+exit 0
--
2.13.6


2023-12-28 01:35:58

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 08/11] tests: ubifs_repair: Add corrupted images

This is a preparation for adding repairing testcase. There is no debugfs
tools (for example: debugfs[ext4], xfs_db) for UBIFS, so no way to inject
precise corruption into UBIFS image, we have to prepare inconsistent
UBIFS images in advance like e2fsprogs[1] does. (Goto [2] to see how to
generate inconsistent UBIFS images). Here's a descriptons of the various
test images:

=========================================================================
image | Description | expectancy
-------------------------------------------------------------------------
good | good image contains | repair success, fs content is
| kinds of files. | not changed.
-------------------------------------------------------------------------
sb_fanout | invalid fanout in | repair failed.
| superblock. |
-------------------------------------------------------------------------
sb_fmt_version | invalid fmt_version | repair failed.
| in superblock. |
-------------------------------------------------------------------------
sb_leb_size | invalid leb_size in | repair failed.
| superblock. |
-------------------------------------------------------------------------
sb_log_lebs | invalid log lebs in | repair failed.
| superblock. |
-------------------------------------------------------------------------
sb_min_io_size | invalid min_io_size | repair failed.
| in superblock. |
-------------------------------------------------------------------------
master_highest_inum | invalid highest_inum| repair success, fs content is
| in master nodes. | not changed.
-------------------------------------------------------------------------
master_lpt | bad lpt pos in | repair success, fs content is
| master nodes. | not changed.
-------------------------------------------------------------------------
master_tnc | bad tnc pos in | repair success, fs content is
| master nodes. | not changed.
-------------------------------------------------------------------------
master_total_dead | bad total_dead in | repair success, fs content is
| master nodes. | not changed.
-------------------------------------------------------------------------
master_total_dirty | bad total_dirty in | repair success, fs content is
| master nodes. | not changed.
-------------------------------------------------------------------------
master_total_free | bad total_free in | repair success, fs content is
| master nodes. | not changed.
-------------------------------------------------------------------------
log | corrupted log area. | repair success, fs content is
| | not changed.
-------------------------------------------------------------------------
lpt_dirty | bad dirty in pnode. | repair success, fs content is
| | not changed.
-------------------------------------------------------------------------
lpt_flags | bad flags in pnode | repair success, fs content is
| (eg. index). | not changed.
-------------------------------------------------------------------------
lpt_free | bad free in pnode. | repair success, fs content is
| | not changed.
-------------------------------------------------------------------------
lpt_pos | bad pos in nnode. | repair success, fs content is
| | not changed.
-------------------------------------------------------------------------
tnc_lv0_key | bad key in lv0 | repair success, fs content is
| znode. | not changed.
-------------------------------------------------------------------------
tnc_lv0_len | bad len in lv0 | repair success, fs content is
| znode. | not changed.
-------------------------------------------------------------------------
tnc_lv0_pos | bad pos in lv0 | repair success, fs content is
| znode. | not changed.
-------------------------------------------------------------------------
tnc_noleaf_key | bad key in non-leaf | repair success, fs content is
| znode. | not changed.
-------------------------------------------------------------------------
tnc_noleaf_len | bad len in non-leaf | repair success, fs content is
| znode. | not changed.
-------------------------------------------------------------------------
tnc_noleaf_pos | bad pos in non-leaf | repair success, fs content is
| znode. | not changed.
-------------------------------------------------------------------------
inode_data | bad data node. | repair success, file content
| | is changed, other files are
| | not changed.
-------------------------------------------------------------------------
inode_mode | bad inode mode for | repair success, soft link
| solf link file. | file is dropped, other files
| | are not changed.
-------------------------------------------------------------------------
inode_nlink | wrong nlink for | repair success, nlink is
| file. | corrected, fs content is not
| | changed.
-------------------------------------------------------------------------
inode_size | wrong inode size | repair success, inode size is
| for file. | corrected, fs content is not
| | changed.
-------------------------------------------------------------------------
inode_xcnt | wrong inode | repair success, xattr_cnt is
| xattr_cnt for file. | corrected, fs content is not
| | changed.
-------------------------------------------------------------------------
soft_link_data_len | bad inode data_len | repair success, soft link
| for solt link file. | file is dropped, other files
| | are not changed.
-------------------------------------------------------------------------
dentry_key | bad dentry key for | repair success, dentry is
| file. | removed, other files are
| | not changed.
-------------------------------------------------------------------------
dentry_nlen | inconsistent nlen | repair success, dentry is
| and name in dentry | removed, other files are
| for file. | not changed.
-------------------------------------------------------------------------
dentry_type | inconsistent type | repair success, dentry is
| between dentry and | removed, other files are
| inode for file. | not changed.
-------------------------------------------------------------------------
xinode_flags | lost UBIFS_XATTR_FL | repair success, xattr is
| in xattr inode | removed, other files are
| flags for file. | not changed.
-------------------------------------------------------------------------
xinode_key | bad xattr inode key | repair success, xattr is
| for file. | removed, other files are
| | not changed.
-------------------------------------------------------------------------
xinode_mode | bad xattr inode | repair success, xattr is
| mode for file. | removed, other files are
| | not changed.
-------------------------------------------------------------------------
xentry_key | bad xattr entry key | repair success, xattr is
| for file. | removed, other files are
| | not changed.
-------------------------------------------------------------------------
xentry_nlen | inconsistent nlen | repair success, xattr is
| and name in xattr | removed, other files are
| entry for file. | not changed.
-------------------------------------------------------------------------
xentry_type | inconsistent type | repair success, xattr is
| between xattr entry | removed, other files are
| and xattr inode for | not changed.
| file. |
-------------------------------------------------------------------------
dir_lost | bad dentry for dir. | repair success, dir and files
| | under dir are removed, other
| | files are not changed.
-------------------------------------------------------------------------
root_dir | bad '/'. | repair success, create new
| | root dir('/').
=========================================================================

[1] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/tests/README
[2] https://bugzilla.kernel.org/show_bug.cgi?id=218327

Signed-off-by: Zhihao Cheng <[email protected]>

Signed-off-by: Zhihao Cheng <[email protected]>
---
Makefile.am | 1 +
tests/ubifs_repair-tests/Makemodule.am | 42 +++++++++++++++++++++
tests/ubifs_repair-tests/images/dentry_key.gz | Bin 0 -> 5377 bytes
tests/ubifs_repair-tests/images/dentry_nlen.gz | Bin 0 -> 5386 bytes
tests/ubifs_repair-tests/images/dentry_type.gz | Bin 0 -> 5384 bytes
tests/ubifs_repair-tests/images/dir_lost.gz | Bin 0 -> 5381 bytes
tests/ubifs_repair-tests/images/good.gz | Bin 0 -> 5251 bytes
tests/ubifs_repair-tests/images/inode_data.gz | Bin 0 -> 5297 bytes
tests/ubifs_repair-tests/images/inode_mode.gz | Bin 0 -> 5383 bytes
tests/ubifs_repair-tests/images/inode_nlink.gz | Bin 0 -> 5383 bytes
tests/ubifs_repair-tests/images/inode_size.gz | Bin 0 -> 5384 bytes
tests/ubifs_repair-tests/images/inode_xcnt.gz | Bin 0 -> 5388 bytes
tests/ubifs_repair-tests/images/log.gz | Bin 0 -> 5232 bytes
tests/ubifs_repair-tests/images/lpt_dirty.gz | Bin 0 -> 5360 bytes
tests/ubifs_repair-tests/images/lpt_flags.gz | Bin 0 -> 5361 bytes
tests/ubifs_repair-tests/images/lpt_free.gz | Bin 0 -> 5350 bytes
tests/ubifs_repair-tests/images/lpt_pos.gz | Bin 0 -> 5374 bytes
.../images/master_highest_inum.gz | Bin 0 -> 5034 bytes
tests/ubifs_repair-tests/images/master_lpt.gz | Bin 0 -> 5035 bytes
tests/ubifs_repair-tests/images/master_tnc.gz | Bin 0 -> 5024 bytes
.../ubifs_repair-tests/images/master_total_dead.gz | Bin 0 -> 5033 bytes
.../images/master_total_dirty.gz | Bin 0 -> 5032 bytes
.../ubifs_repair-tests/images/master_total_free.gz | Bin 0 -> 5030 bytes
tests/ubifs_repair-tests/images/root_dir.gz | Bin 0 -> 1298 bytes
tests/ubifs_repair-tests/images/sb_fanout.gz | Bin 0 -> 5322 bytes
tests/ubifs_repair-tests/images/sb_fmt_version.gz | Bin 0 -> 5326 bytes
tests/ubifs_repair-tests/images/sb_leb_size.gz | Bin 0 -> 5324 bytes
tests/ubifs_repair-tests/images/sb_log_lebs.gz | Bin 0 -> 5323 bytes
tests/ubifs_repair-tests/images/sb_min_io_size.gz | Bin 0 -> 5328 bytes
.../images/soft_link_data_len.gz | Bin 0 -> 5389 bytes
tests/ubifs_repair-tests/images/tnc_lv0_key.gz | Bin 0 -> 5414 bytes
tests/ubifs_repair-tests/images/tnc_lv0_len.gz | Bin 0 -> 5420 bytes
tests/ubifs_repair-tests/images/tnc_lv0_pos.gz | Bin 0 -> 5404 bytes
tests/ubifs_repair-tests/images/tnc_noleaf_key.gz | Bin 0 -> 5430 bytes
tests/ubifs_repair-tests/images/tnc_noleaf_len.gz | Bin 0 -> 5437 bytes
tests/ubifs_repair-tests/images/tnc_noleaf_pos.gz | Bin 0 -> 5418 bytes
tests/ubifs_repair-tests/images/xentry_key.gz | Bin 0 -> 5378 bytes
tests/ubifs_repair-tests/images/xentry_nlen.gz | Bin 0 -> 5386 bytes
tests/ubifs_repair-tests/images/xentry_type.gz | Bin 0 -> 5386 bytes
tests/ubifs_repair-tests/images/xinode_flags.gz | Bin 0 -> 5384 bytes
tests/ubifs_repair-tests/images/xinode_key.gz | Bin 0 -> 5383 bytes
tests/ubifs_repair-tests/images/xinode_mode.gz | Bin 0 -> 5386 bytes
42 files changed, 43 insertions(+)
create mode 100644 tests/ubifs_repair-tests/images/dentry_key.gz
create mode 100644 tests/ubifs_repair-tests/images/dentry_nlen.gz
create mode 100644 tests/ubifs_repair-tests/images/dentry_type.gz
create mode 100644 tests/ubifs_repair-tests/images/dir_lost.gz
create mode 100644 tests/ubifs_repair-tests/images/good.gz
create mode 100644 tests/ubifs_repair-tests/images/inode_data.gz
create mode 100644 tests/ubifs_repair-tests/images/inode_mode.gz
create mode 100644 tests/ubifs_repair-tests/images/inode_nlink.gz
create mode 100644 tests/ubifs_repair-tests/images/inode_size.gz
create mode 100644 tests/ubifs_repair-tests/images/inode_xcnt.gz
create mode 100644 tests/ubifs_repair-tests/images/log.gz
create mode 100644 tests/ubifs_repair-tests/images/lpt_dirty.gz
create mode 100644 tests/ubifs_repair-tests/images/lpt_flags.gz
create mode 100644 tests/ubifs_repair-tests/images/lpt_free.gz
create mode 100644 tests/ubifs_repair-tests/images/lpt_pos.gz
create mode 100644 tests/ubifs_repair-tests/images/master_highest_inum.gz
create mode 100644 tests/ubifs_repair-tests/images/master_lpt.gz
create mode 100644 tests/ubifs_repair-tests/images/master_tnc.gz
create mode 100644 tests/ubifs_repair-tests/images/master_total_dead.gz
create mode 100644 tests/ubifs_repair-tests/images/master_total_dirty.gz
create mode 100644 tests/ubifs_repair-tests/images/master_total_free.gz
create mode 100644 tests/ubifs_repair-tests/images/root_dir.gz
create mode 100644 tests/ubifs_repair-tests/images/sb_fanout.gz
create mode 100644 tests/ubifs_repair-tests/images/sb_fmt_version.gz
create mode 100644 tests/ubifs_repair-tests/images/sb_leb_size.gz
create mode 100644 tests/ubifs_repair-tests/images/sb_log_lebs.gz
create mode 100644 tests/ubifs_repair-tests/images/sb_min_io_size.gz
create mode 100644 tests/ubifs_repair-tests/images/soft_link_data_len.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_lv0_key.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_lv0_len.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_lv0_pos.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_noleaf_key.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_noleaf_len.gz
create mode 100644 tests/ubifs_repair-tests/images/tnc_noleaf_pos.gz
create mode 100644 tests/ubifs_repair-tests/images/xentry_key.gz
create mode 100644 tests/ubifs_repair-tests/images/xentry_nlen.gz
create mode 100644 tests/ubifs_repair-tests/images/xentry_type.gz
create mode 100644 tests/ubifs_repair-tests/images/xinode_flags.gz
create mode 100644 tests/ubifs_repair-tests/images/xinode_key.gz
create mode 100644 tests/ubifs_repair-tests/images/xinode_mode.gz

diff --git a/Makefile.am b/Makefile.am
index 1454233..b190424 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,6 +39,7 @@ dist_man8_MANS =
testdir = @TESTBINDIR@
test_PROGRAMS =
test_SCRIPTS =
+test_DATA =

TESTS =
EXTRA_DIST = COPYING CHANGELOG.md README.txt
diff --git a/tests/ubifs_repair-tests/Makemodule.am b/tests/ubifs_repair-tests/Makemodule.am
index 323102b..6070b0c 100644
--- a/tests/ubifs_repair-tests/Makemodule.am
+++ b/tests/ubifs_repair-tests/Makemodule.am
@@ -6,3 +6,45 @@ test_SCRIPTS += \
tests/ubifs_repair-tests/tests/cycle_corrupted_repair_fault_inject.sh \
tests/ubifs_repair-tests/tests/cycle_powercut_mount_repair.sh \
tests/ubifs_repair-tests/tests/random_corrupted_repair.sh
+
+test_DATA += \
+ tests/ubifs_repair-tests/images/good.gz \
+ tests/ubifs_repair-tests/images/sb_fanout.gz \
+ tests/ubifs_repair-tests/images/sb_fmt_version.gz \
+ tests/ubifs_repair-tests/images/sb_leb_size.gz \
+ tests/ubifs_repair-tests/images/sb_log_lebs.gz \
+ tests/ubifs_repair-tests/images/sb_min_io_size.gz \
+ tests/ubifs_repair-tests/images/master_highest_inum.gz \
+ tests/ubifs_repair-tests/images/master_lpt.gz \
+ tests/ubifs_repair-tests/images/master_tnc.gz \
+ tests/ubifs_repair-tests/images/master_total_dead.gz \
+ tests/ubifs_repair-tests/images/master_total_dirty.gz \
+ tests/ubifs_repair-tests/images/master_total_free.gz \
+ tests/ubifs_repair-tests/images/log.gz \
+ tests/ubifs_repair-tests/images/lpt_dirty.gz \
+ tests/ubifs_repair-tests/images/lpt_flags.gz \
+ tests/ubifs_repair-tests/images/lpt_free.gz \
+ tests/ubifs_repair-tests/images/lpt_pos.gz \
+ tests/ubifs_repair-tests/images/tnc_lv0_key.gz \
+ tests/ubifs_repair-tests/images/tnc_lv0_len.gz \
+ tests/ubifs_repair-tests/images/tnc_lv0_pos.gz \
+ tests/ubifs_repair-tests/images/tnc_noleaf_key.gz \
+ tests/ubifs_repair-tests/images/tnc_noleaf_len.gz \
+ tests/ubifs_repair-tests/images/tnc_noleaf_pos.gz \
+ tests/ubifs_repair-tests/images/inode_data.gz \
+ tests/ubifs_repair-tests/images/inode_mode.gz \
+ tests/ubifs_repair-tests/images/inode_nlink.gz \
+ tests/ubifs_repair-tests/images/inode_size.gz \
+ tests/ubifs_repair-tests/images/inode_xcnt.gz \
+ tests/ubifs_repair-tests/images/soft_link_data_len.gz \
+ tests/ubifs_repair-tests/images/dentry_key.gz \
+ tests/ubifs_repair-tests/images/dentry_nlen.gz \
+ tests/ubifs_repair-tests/images/dentry_type.gz \
+ tests/ubifs_repair-tests/images/xinode_flags.gz \
+ tests/ubifs_repair-tests/images/xinode_key.gz \
+ tests/ubifs_repair-tests/images/xinode_mode.gz \
+ tests/ubifs_repair-tests/images/xentry_key.gz \
+ tests/ubifs_repair-tests/images/xentry_nlen.gz \
+ tests/ubifs_repair-tests/images/xentry_type.gz \
+ tests/ubifs_repair-tests/images/dir_lost.gz \
+ tests/ubifs_repair-tests/images/root_dir.gz
diff --git a/tests/ubifs_repair-tests/images/dentry_key.gz b/tests/ubifs_repair-tests/images/dentry_key.gz
new file mode 100644
index 0000000000000000000000000000000000000000..aceaae006b352c35e4892b3a5f8263bbfcb29e49
GIT binary patch
literal 5377
zcmc&&c~sNMlXr#@MMl621cW%Ff^sT13PeOf<r2A%5K$m<Mg{_6fT#?hBB0#J5xH+7
zM>ql@3UWpg<rFzG0wIAAB7_h^NWSa-_U(K7ocZmayZu*pS5;TNPgQqU6)17<-k)cl
z`Ro$$_6ZLABN7_m6S-?;M$E&S2lTBWRn=7*tkSRz)~>`?CDvV14GuA`W|vf6y;N84
zKOcK_QvTPMvhKQP7?&p}tYS-KiN{X}&idpExpWVRKqv}?2nF#I>@@?DF`6$Z;G58p
zMC#g>1FA2WLv6?!J)DcbEshOS*Li_|S6`Cr*R$)N$6s)UEdc&!+AeCH6+qa5Yy+U(
zeXSW0G5?0m<d+RV<ezCbgmhrfKa*bX2xf$+o+$ga9jdI#6C~2dtFPsex<i@6jYze2
zKP^v1oOU>F1y{TBuwJdDA@EkV+GS~fE<y2%PCD_@n2(#1Rt~1+i<$aYS=V}A@3+U+
znu^=!U99X;<8^hn!^%1X9j4w?&Cz8hc=yuXVr1IR*2SpuFLfKM2Ogdu=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5wtC@5&!&@i24Bf3ZyzoSIS9dplS9`;XL0vR`9
zvBlb8lpxd=xF0%Axa0tCJ!9f&3YcpPK~Xy&O3tit60$)F7H7e8Aqv(}Fr{c5-0d`M
z9-Ry|5+<%+3`i3m+2hnZ4=~#xWXeGa?w_OuPHg4c+QM)$P?_fLOp${U%64`POdfA(
zjBkMgO>{yZoGxc*$pd02tnrI6V#M-tS|cAC*-YKpA7mZi?mSHbm1hM9?xS{Y6iemH
zOlRt*alA^nO!-7AZuok4|Cg)tE73qfj`pQCWx>(kK_gXf6c-hzC{Y%t%L!;7-shQ(
zk*b>6Sl*SsleQX>p`>l=Tz5Tlv1?OHtIN3CzNcZlezJJ5<kT~EeO*J;=wZ>hl`q@@
znZ_<MQsbB!Iz`>Fzi&8%xXt>Ny6AlzB!DxA;CB+)+RLf)Xj|i>6f_iq^X5T9fPEo?
zqRG;FXcqzX%9ApAPWiiI*I1aYEf$>)&victZCk6pujp(LGbRN8&l=E!WX|6~VdsBn
zzC9#9qW#!*dcAD~Nd9ow$7sAC%eo2^@{e7<i=0Ry=m*Iv7HH*<%i6nkiSGIjO<<Qx

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/dentry_nlen.gz b/tests/ubifs_repair-tests/images/dentry_nlen.gz
new file mode 100644
index 0000000000000000000000000000000000000000..9acd3ecc4e1c1416a91ab0896331f33e6fbab2c6
GIT binary patch
literal 5386
zcmc&&cU05aw&o5as3@qYNHdNF3j!)2oyaIMDn&#=YNUw}iV%7rQ2|k^AOWcnkq)5-
zq((tNdQC8a5CKD|2_%M)gyeT;)?06_ckg)LpYNT&&f4F%&e?14z0TSD1I6#$NuG{#
z7ZG)H_YDjPgZO&8`--fRcR84Gfu0SxvdXzy)7OQAm)%vMsh4+M{c>l!_IdP~tP~ZM
zFS=2G*g`K{d+6<Xhw!qtDpM?9w*S}(!G%+%06Y+bK_H_5Z2-}^!VOiR<qZoE!;xrK
z8<iOvQC0=ZXbvFW@`@X@tckH}kvZ~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2#;u&v5gwYElsZJ~+7dcdGul?Ja(f;8A^LTK_0)Q&i!;xsr`!6|F^+gVfq17`
zZ?_<_ZSHHz^U&4|PvqwnzmxL@%}byA<ma};h#(jX)uojxr~%jv^8_iXHb@+KpA~4w
zNLhWix2bUwYgpqc$Qq<FH@Zk&#Y)l3jMz`^Yf<u@7X{NtHVuhZXC^bO<vOmQtK###
zvLmdtDIuN-R8}2!H#f6cKx)puHK*LtzH%<!@8k-9s$j3ZQVdhHX^s~b^y7W(Sh&QP
z7MC<#Z*i3Jl`x9JLIg|+-1O08H4t9PH-6aWLVL;pV1jPf_78{<7!i7Aohy<<olFi;
zh%eEMEV;g=?b9roVW8vu2+08$Gw7e=0>Tc04Si=ZzvDqI?^D`V1ifzvD19w&Gc60j
z6>amh|H{ndHt0>r<L>&~=9})i!2B>4oJHuLNhs^jr3e;oRm$K->_{Z|9Ksy!=`?wy
zkDr<mF`@cFc}+>N^D(Z`PbJL+Wi9tR$>acSMhcX3(ID+lh7t23b~oR7sD{j<@1lO^
z)M<dG<dBYe1o-)u#l>lu8DqeS+|(ZAnD**DdL}Oq`Y<{mE4jk)afr5cPVzkzwLl4y
zQ0Fn3U-j@gn&YTzYY37rdzHLU6VGStrG_=R81g9Ol*mMtKD&fIMIfN>=@viC12&$@
zpWC3$^LEtTbj3YG0vheuLf2pg$}tuN62oQC7yZyy2Ov${@=!$^Z6sa@{-3j;!{GIB
z0EwL!|JPUKN%>R$ziW1HdDDQ@ztTkTe@>A9W-2k{{JW%gh28Ww4Y7;?xw<m^LPSJN
F<e%zptI7ZX

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/dentry_type.gz b/tests/ubifs_repair-tests/images/dentry_type.gz
new file mode 100644
index 0000000000000000000000000000000000000000..883d11ac10e27dc24f39038fb1739c6af0b214b1
GIT binary patch
literal 5384
zcmcgwX*k>I`tBU3)mG6?TXbV)OskekQEQ077_FkzzNVOH?X`pwq^h-6Y3*XE+Sk+?
zTavbfmZBvROGv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kcv{|92Yws`;m

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/dir_lost.gz b/tests/ubifs_repair-tests/images/dir_lost.gz
new file mode 100644
index 0000000000000000000000000000000000000000..70c4e8d22b364be1a9b9bc8c7105dc4196bed4d5
GIT binary patch
literal 5381
zcmcgwXH?T^vv=2BJD?&UHLhNiA|PE_P|;OE#7OTVO}asP2vHG15LgiiC4ho-Lhm6&
zsX_>mmQWL=n*ad<gpl&TzW1JU&wF<LbU(b$r#UmvbLMwu=9x3|10@_f^m;DdecygJ
zuRv$tfG0uwR%Q-6n6iQ14Va>mLhYTm=x!}{C7%?n!$zO)b8BC|kjr|br1V)g`qqTx
zF<TGcu@4o(?#}80DIOQ2U(;gcUG}I2PlC5OlH6W4OVWwhJ9n8CxyFL6aZn5;Wbd3g
z57kO~i+8$j?kgCt)YXsvcxC6ng_Hipr}ppr>3NDngLuGCP5btxV$^uRX6SbSA$4li
ziNgNn=l6Dxe*uJkZo0xQ06;%CJ>6u5asUw~VSW?oS#oAgIyJ_TdO*WE^ZwO^nw7@y
zzlDEZ%Mh>44yiRdU%S#@`|N$~1KT(r5OIofMfoTM>6O{<)=u$Gu7Ba_)-9Udv8jy<
zTc$tKapc+ByLK-J!6!<z-dlDLsZ=tD<Qk?216>@j>4Lw%<YY}L^c2$Y{ug3MR?-K5
z4(>{Lm>~}ckYJ}2(LQyzI}bFeseQR)aPn(u(M5?=!C_JD_dd9?3b&&=_cl>k&3)ab
z_IFgcPk#wcBVTqq3%*=ai+vyAUuMo)EA69f;1Bfefg|XnCl!>H8NdCH$6Hlx0Pv5T
zJViYJ5%Fs#*yt4{4q*0Q(|6?=+@B-d7kQ|E3&2wg0RVch9`mq0vu*3Q$$*T_ekPh@
zS5fl=Z-tG|+tQadbr!z5506XNh@O)<`eLJze)L>ox2rQ0^|G0f&!&Y*L!&O#kk;?H
zvBc&SKD*6yO@2DY0AEvrVCzXNx~oh-8DIMN3+cMPb6nWqky(DyZbZ^7v$dc8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5Sr@Twx!{|P4>7=OyouJx_TDnUM_NL
zsepyeVf*<)DEZ1d{Dsu$4PH1or5nGN&}$t>7b7Sn@{aI%BfC3zzq+~I1DOCtVE`aC
zQb;<o8)@0NcrrAGX}t=#{@btpIOh9-2w3Yy{hRJzVzWdT|L?3^8Ik#S8t@)G7x)`L
g_LRot{(axG$Xf#b#tgpO<Nt0KX(PLD-+_Jq4Oa2EumAu6

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/good.gz b/tests/ubifs_repair-tests/images/good.gz
new file mode 100644
index 0000000000000000000000000000000000000000..0611528fce68959068509fda7ccf420e757652ae
GIT binary patch
literal 5251
zcmc&&cU05KztwdGSH;F6A_7*BE+D-`ML;PA1VoC2A|POhv_uFH6%`>AMFpu5BorZZ
z2%#jalu*PVEf7kiB}xdPg%BY5zTZ3Vuif?i``-LD=id3uz2|dg&bc#k=skP(l_&V@
z*yRU<-QBS;A?olaRhGOwx_kHUe`=f>`E;~$CtU3G$@<$GN=NoRc~pGW_Vmc^g^o7M
zvpSV$hufZuv~Sv0roT94=WxU-@%SqR5yO;VKaaDYOs3B9W4=23awZJ5NCX7@GKFu7
zpu!!sugF3dTlIN|7r*C1<&DUBIHx0_JAOU>3S`|7fPT&GFe|?#ATfOA0ZwAlqTL{W
z=dagoD7+WS{hE4|Z}GqH&IxA$p*;NXy_IBJYnnlij5KL~mHom^>t(kFFKq{Lq9Q!|
zLD%&Wd*^HF=hl)Bb?lo`71nAK8qN1m#rK!}eyR_W<#UpFdUhm6B7?BfHE>CCOC$22
zv{ScCj+fH@dw+VWCB=l~IPa>Jf?k|%_{hzvQH77_Gm@<|CCcxo6u&<q`fJyh>>g@y
z0g7}+QA2g`$1(DNj7o2U0(;+2>|4X$6;Ub6gH-`^w?5;~h@b8QmIss8F1+bSlRPeg
zgOiQlVin?!Hv8qJznZ1xncjQ?q(wwO4RTh`b}`e}H_Q1SL9PTBK>bU539<B?1tjIx
zpdVLP1>1L@s}cg0anZ?cHFB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66C8O=61bsN?GL~{k8bePONS^Q@*W5oW4FV5Zu!WfpPA@n1g5wXuu
ziX}j}mX2mb?GlI{O|E&xZ4d3`JKotobouhsW(k_B?$sWhNBFqyk_`b%GmZ;iUlDi&
zDAnZ^5amgcrHtIr&FzH+&U|bP=x<*B^9GU=Y6Eg%z(3#%a-G1gzhjq{W`TcX+mjDh
l{#kg)h>!Yv-HtuE+y7Mk9sI8^xF@__i^&+T9XmvJ{1<}Xgiinf

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/inode_data.gz b/tests/ubifs_repair-tests/images/inode_data.gz
new file mode 100644
index 0000000000000000000000000000000000000000..5d3e5ad3b617a5d3f9434f09c9c6165014753441
GIT binary patch
literal 5297
zcmcgwXH?Vq(sq}t*nm|Q5l|2d7C>Z?AT3c*P(i8~X^9l26KM%8;0h|zQMy2crAP@#
z?+HB=Nu-7lNEQSF1PCnz5|aOW?|Hwx@4EZ-{yxo_XU@!=IWy<?oJTJD;6V~G>e)Ua
zS1*LqGq{tzpZ&h&Dd9)ILg|Ec%KrRwZnwXLD?i<@cxC9$$P?8o(jK4ATskHpQSmd<
z(c!{z!`Ana7rI~RcX2<B+jJ&ek`7U-xI25-@m*hkz1p?+PcdtE@EG4Wlwb}mo&Ggz
zKRXkGL?SHjpPL<;_bAh}i3lg#9hue?^=iya6503n4`$=M1pM^(*d@Q+B|u%p0tj<9
zGD>YHiv4|9EA=He?C+s{hvnG7KS00Y$XI}sj`(A6RyHTH8kMX)h8DNBQO%E>sd+&O
z`l8@~o_sQ$TlJ;nRRYXtLH2Tt_*q*)t$I<Ee&jdtqow=hZ`=%~-V8D5spWyL`0jp4
zZS&gxgDneE!l-F=87+{{R7PCq_WILS3kO_sju9-2nL%V98_&W_@80L_bJ)aZ$>0B>
zwM$141p*-OoUeo>$QUWDHPF_V>#~t;Du<nPP1NWyo#-s)AAjW)J)RS6qUb5@s+Keq
zjemO6#5>MTB2QA7p;0l?e-DWmR?t*^`h8ONb|F<I)A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$<eD>CuBi(4+
zLOS)DsrK@Npp7aB_QpEDB5y;=*-^Uo5kcL+tstdF<bZLt%2Htd_4zq5nN*e2Ep<4M
z;O2a4;i}g=WumOqDbC8w7QI7RV^f2lQVrZ*ntX4^o{pIg--Ow+o%%+0*GKnLG4+aU
z^U<E|8A8~p4`lVw$Hd}x|F*vBg3k6N<=1U^&TX1-75Ki~#D2B6`i2W~!PDD0GHHoO
z1_gg7*!lknZ>{)sI1g|E{wlKp!avAskzhXLFD&y8M(|f6muvDvuE9d!FD&-u0#E#@
M*J|3neFyga4<MR?b^rhX

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/inode_mode.gz b/tests/ubifs_repair-tests/images/inode_mode.gz
new file mode 100644
index 0000000000000000000000000000000000000000..e82fed94e6a84f8f8149d872e6fad8704b1cdf5c
GIT binary patch
literal 5383
zcmcgwXIRtO(&y?`R#`<?0R;pL*dYoCNQ;QV(mO~fks4Znh!8>oSr9})L8Ti)?+Ly4
zMFa!{q$Ltc=q*5KA%ukdU-$jA&t31=J0H$7XXZTT%rkT5ocWD-)GxodjYT^19Cq{a
zc5;Toe+)dU6US`ySwQC|`j*tqa=lo|cz8F2Bmw{J<-44%9^v0IT{WvKFVcR!>|E4(
zD!D92+v-|(vx~4qZ+h9=owhjmJ~hkNkHHq<bh4NtcKw~RicHKp6TQw(p-Uxp&YB*i
z)RSU+>`Y8OPew`&cNcwouzR%g!`5Krzj%I1e^N;?T<lL(JUrdD$y_X}VFv&ok4Av#
zod2>6^UD&z`*U47X8_>;x#|In-EaUzvRt0AdSuN`F;8}X+Vwt+Bj^>RZ#_wXDcOnD
zU-7D6t;eta@%na6x#xqV+m8g@ffljHa_@Q`jyOYdWs=ikC>m1J=dH@xUv7lH1&Qt7
zhZvY*N!8H~&vTnSop7avGfP5bmQOY$7*=<u*iJX%VVi0%Twr#P;f%UrUuE9;U)*9O
zHfaa|IL+qlf<T{Uy3jW9&98Dp{6_){ZbTi;c~RM}zeFjyd293`GhQ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;Wvh6X#97<`&xIvGl&cN
zn8jStQRORf6`O{gATdA^m0qO{-EO!wy9sbVMJIamMW8icTl=j$djZc-odDAmXGs-<
zw&Zd+ig!czI@~$@(kgOjm+N^n84*AmTLX?8=|Qfn#BQ@E1IidPCyH{4nv~W0(_o26
z`S7ifovc$;eC5zcTDjVro#r6lG8;>X+qu#EgNjTnhPrB%F^&uV^?l5F^C$e<F?8zy
z*!8@YG-uZL(Vd<`;$$1^ai?UzG#WNpe?r7sIV&uCad~;Y+1>v-jP+&g2r>-b&U#{P
zrRIM8Fv6d%${9)7*q+qo?OAj*71%1nd>RTuhHrgxx+oq*U+eRB)ZG^J>v|2!6MsYR
zM<;-+5y<hDhc+#)UT&+2oAk8Ynrh_Ns96yQ4!iIUcT8!YvY7bU(u;F5wNoG(S_Q=X
zJ!>t?2h;%Q+TPz~KQeeqXNvWoJ->Xle&9b4+5-lPEB+Tm`x_PZZv%gu{>2&vrT%C8
S?~fI>kmYM1KOUZ=JpTurzoe1?

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/inode_nlink.gz b/tests/ubifs_repair-tests/images/inode_nlink.gz
new file mode 100644
index 0000000000000000000000000000000000000000..64d20e8c1af03976b021cffcad1e58542875d5b5
GIT binary patch
literal 5383
zcmcgwXIRt8)^}fCK}E=V5fG8!6&0jqkzTXPstXcOK`^02lwt@S=^<GQf)pdtdy^U<
z0)|c^BE5-}AT59tAtVSPganfR>)ucAbM=0`^XWY2cb++C=FFTq^OKJ~bSSec#`S;@
z%G<}q73uAX@<tz6pE>LR;{siq;VNp%H5Q4a8W_AU<2CI4uQfJUxasBN1KlZ7f23V{
zy$<h8k+IK63M^Ph7hn2x^yE}2Hs#O=0L~^5XtX)#AcgiV%mm!kxDr621<+P7K8;4;
z+%@_{QI*3^Ovb%hJI{ZnR2>wqsn^SSnRx4e5Bz)x>d4!G(9f|O%jRsLk5&QzH*dt*
z!&gLpZZ>!ScL4fx=zuF;fcp<n?<|c0*!Als_aU?Mv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L*b&%bb#~DE};cJG3f7hroG&
z9d24|Wy7qzKQ{!S8!?zh@6E=;`MfA+-_X6eV&8rfUEx-%9mzgYQ8I6MYK8vTJ%jEe
zzG6s>tHxl1Y)(V1s6)oS*Ud1lR8HxmF5O#u+-8ZuDaFXGCuT#u(1`8VQMF;Ltyo({
zYbfqsKmgi)7CS(I@cpkDkuTdo8;nh$?>6H{_i?<AJ_-64I;Yy?h1k7_4=jVMU3Cki
zCU<iscUJBo(g<L&ekUX{i}q4FSU`J`9C1d*GWc2BBKt|tCU<dd5NOoQw40VhQp)#v
zdfL&uS3Lxv0sUz`?WB>2^Z{TOhXD7jE%|s{Jtxf}v&=`9Aa9cg)EItHTsHD8`JYLg
z5=dmJqi^syOy^k}lQk8yl<~=&-_85;%Q|m2zY~=|olf3Pz+aG@0M%MDvjcpTN+`Lm
z+=<WM=vx)DU$|GUDMC~+xaABn+05~4ht2j@ANWwJG?HpDi;TzN@BO;DcZ}a+Y$U@L
zJZS-o^ws&5Y&*-8p|0X1i}!~oI%YVLTUoCa<!9vAdnuh#i)tRPtdTI2<2dMs(_7yj
z{^srxKYoEsQ8luIf;%}oGi#vvf{5pCRK45xK{LG5Z~p_?$d%nP059y{<^d=EU$yX6
zlV$RO<QM;bk*f|efq&!j{^||*fy1-O*#rLVTbZ{t{R3;2yz&FZSK0y`D2;q-d*FcZ
Gf&T+qKc8g)

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/inode_size.gz b/tests/ubifs_repair-tests/images/inode_size.gz
new file mode 100644
index 0000000000000000000000000000000000000000..ecd7f78e0c9e5ffe18905a903acd50bd5d8d42f0
GIT binary patch
literal 5384
zcmcgwc|6o>7q9CrZ&#&mp=^`urVuJyk{PYaUiLj9jcLffo4VFWDr7eygc-7pWrhhc
znPG&ngfYdn4(6IM#;m`$`~LNQ-rM`{`}}o2&-Xm%IiGW$&w0-GfYSc?&!dD?pIu^5
z{{U|vk6>t&&#pD<K35AaK-i2{*HCLP&pb)g^U;94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guYq>>6clZ%|U$$bu3+0p-
zx!ABdG#Iwj^x_!`DIVs!bJ8V+-~EO+E#-zx*D^e)Eh&Rd8)`WAfGj@P^DK`W0Rc^P
zXip~?t(Xl0Soe{6<hNL%b)b7HgTduPT9vYpraVrscEI*RbSGps$(!7{KpID{JX~?K
zYd1_4#$uV1FOwp04i69?=>fmZ8?|#kuFB2t?EL}?{yDo>|CMlaQw~yi3`7hB9~4ox
zL+lyDg3<&1Sb70+23G<%Ym13#_Fu`{SHes7d=$z5TJdNAte@0jwJl9zmuDxP{k%l)
z?$t=wPi7hA5FEjf>6#bFK8(#$fa=q_86Mcp!6`=BiADp#C-qdbK<2!OAz0Zdqr$NQ
zWQQt6#Rea7&&Dj;cQ$TaT}u>Ya;fu*Eu_^5?9sJz<2-<j<&J#p+u_BdGCDm`84>O#
zztGyACWl+?TX-lM<)$qmE-OBOk6<4%m=Pibu2nc@*t1f6HWwFn)&PujrE(#`L8C<M
z9DO3o14KwZOv}y(#DXO)k+Q^<&VfaQ0D{i&VKenZ%U(%D&&IWJM`Wg|Uys+eBJpHR
zC)!aWe>CR`MYGkAt|Hg-2;UN*{+e#8en5$?oE}U&C24__CK|1fPH=PYBnr>+CyU!S
zNkKfm)9VZc3q1PMs!_2=NC;C<%DInTpZtsio8FwV3U`<Y9ldHmGMUwEJtePBCgc;D
zw{4a)8eyE0fcptZjw{#+43evPk#W*1XM0wL7@R4J+3Lh=1F|l;E$_^pBaFDl0wE68
zU%IrBL2yW+%M6}L7pjSbqg!Omwo_nC`~V_AY7qg84xq2S+93{l^wL|qxi#Csx&J6C
zU!C<v_&|*U<UjWQ5?v)`{x-22TM{AuOYI$)^WQTnV|Lr$271-sS>}J8w2lRSnpaU>
K*tKi#u73f_9;hz>

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/inode_xcnt.gz b/tests/ubifs_repair-tests/images/inode_xcnt.gz
new file mode 100644
index 0000000000000000000000000000000000000000..3b31f03866104dab73ba1c97b1e7065734fb35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#ICNbHv&J_3r{-i#BFxvzI_Mw{S(e5wa@?n

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/log.gz b/tests/ubifs_repair-tests/images/log.gz
new file mode 100644
index 0000000000000000000000000000000000000000..6e6c8a8338af294b7c4575eff355e1f871f41406
GIT binary patch
literal 5232
zcmc&&XIRt8x5jl*RK$Xaf)J4vq!}sFiwzYi5tJT8Vd*8(Yse}BD~PB_4FPEaLW1<3
zfRq4{-U&&l2@nDT2@pc~-M#zmzwZC*z4K|F^PZXWKIfTt=F9=b@$p^4#yasF^n|(a
ztdNda37LcN>vh6sPCjhAHPs>nZLz!kYny_lk-qQElP8mYz1(8gOp>?!0DU>^+aq+m
zou%IbH{gHtxZBQf-n<o+vfkT#e@1uRnbNljrDpo|ecz*IobSw}oghIcEe82CDks1N
zE0(EEwx82}{Bl^;-lX#vo_`;(5>XcL?-0+KT5T4PZdnB2w4}a--J~7<cfV=78(h7A
zhj@4sb`k#tI!Z>40xoMX^uYXu?01y`AGAghqR@L~h7#>zGvy;EjmM)?%f9K~duGWi
zfllq0gPxOqbsZp#=E;gk7(uRmJ^hMDk0Ew&T~LCs)$r#VCkW+`Ix&7UY`8FdYw`C-
z*@)KXes0VmdgG8il58XSw)k<M%#eevSj>vg>(Ad7&@)a+bN_|f6+T$OKA<n@cg8~1
z#GmV*-jr`W)27p+Q{`J=y?XKX(q#(<@>sp)xB$t;W-0&ulW4Qhbz%NRnclMEmrQE&
z-U)f;prGAk4dl%>QKhD)pVezvU}0)uaZ~#5h&SN8T;S)F?MMd`SioKIc>9eBE1U#7
z#|l97ldc+KCK614H65I1Lt#BC6x^h&o6s5}Xn#}DK00-6d;AqkKQGX5y;g)&_GLBJ
z6P)1JJJEV4H9+6C*nYY{yY;0miz#|?S`I`T<`OvZNn_cjs|Aj!1ze@EqDD;q4BNio
zi7wX{3m2+~yXSl_=s}2Ku(z-^RRXPXp-g$%s`h~XMCw}CsW|M0dP;_l(W^@}YkR8l
z<3X-oZ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pUfQ0C4CZ%f6@Y|Ff!mS@1Kd
ZCEy>_F9!eASK}iG<#Z3H^6(tu`5)K1gBt(<

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/lpt_dirty.gz b/tests/ubifs_repair-tests/images/lpt_dirty.gz
new file mode 100644
index 0000000000000000000000000000000000000000..1d020b718953ef13ca800b503b17d154c2e1a237
GIT binary patch
literal 5360
zcmcgwcTm&W_IKA6*Mis(0Ra`IC<f_BfQX1FMMR2plp=;IVCYF)6$=nhs(=usC@n#1
zD1nHSKoHPS0)!;=7(x#uCJ?^w?QiGJytlh==J(gTe|_ehbI<wQd(WLY^O1}H_16YM
zocFfv{`ViadqG1UL~fg>?Q#&elOwLwOB~*Rzvbjui@5FKF|ErN$8K4egc|MNpZ3e?
z7S~TSm0QU!KW7}w2r)Je7Tv)+t!8G;f>~Nln;2Wpc;hwB->kF3kMKD98THID4GqEt
zACXEX-&iao%ue$XD4@4nnJMnOlx}x3BGK5n{FK-BZGXESQidK2kbmpiwr#g-vjExC
zJpeFd<VLDKa{fz>W$m|Ha(|!V;b&7J<nLYEVwYfSAe4(E-wR2)ad}j)OGcWoyQFlu
z@cCrZ{q~SLg$Fikzf2_OfBcaA(*DwSX$6bJmz+1f{d~1h`%4s$I_!Q#DCZ{r_T$CN
z01hmoqeL-Cn6uEqGVpg%^LbENe7?x~b*84E3r3eLunfvSK(s4fO7(8e#~Sz6UACDZ
zaX+q-f|W}@2f4x3L0)fc?3-w-y6BWUgK1O$g>Xa)-9iX(uFRe(@qaV7wPFz+pKNl7
zw`2VqDd#jtMAA&PLW*JWwdqng%dp=}6}6_GN{%PozGxMkXpmN*^Xy1d5H=(CJGsKs
z1HY8ML-=Gd+)cM8uCi(m_^1CXId^s*0RDjgM&T2rMH&m}MD>D1NF5!PT^Vfxpmi~9
zB%}vXee!v-0)rXF=w0KNVv_Awwse>fIgZJ5J|f<7*ulaVcQC2+n@p)7_j%%~E_2Ml
z;z|9jn%eE#uOu9m{8902={8c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(TBH)V9OG=RX9Pi^#PuKv8tgbPM3lNMMW@e-^q#e&+vK
zKKs=Ty@@P>@By)k?XMz`*S}MKGTtI5uWZbk%?aTX)|p)a%HQ7SwN<@XF+)+t+nRa8
ze4Rn>_=6ktZc)@NGkoCP&AMgu8rK~Zl-XQo1$>OK+b3LUeJm3l6@}1_fh><rU3;PR
zed$kn+$Uhdodf*;DCTbdS(f|7>MtVRBSk>$Pm^d%3b6A(O%KQ6+rM9JG~TvNWZORg
D4=A_J

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/lpt_flags.gz b/tests/ubifs_repair-tests/images/lpt_flags.gz
new file mode 100644
index 0000000000000000000000000000000000000000..546e9326b5039a65429f5fa45e8b1f0e3efdbfdc
GIT binary patch
literal 5361
zcmcgwdpOhm`>$UIl_;eov8RNmgj6VDNh%~c%VB#WXEU0$jM-BvHH9LR(~4N-6f?7#
zQDF`_pBd7eGBeDu&Gz|zf8XC<&(rhA@2~IsulstvUhnIEUGMjOU)O!zp!jXuOlxtz
z8#aZ6ML_*RZuuiN%#Cb!+vf~oE>e{gcZYqx#QMC?^Rt)5<~mHh(;21B8||%b>|t&3
z)Ngrp6#pC96Jco)F1LkcpnuK&82*~g(KC1_NW=L}>W{>A85nRo;&oJ;>1loj!tb}J
zZ18eKDAZDYqQkG|5D9wtZZRrewmm#xxOeTuhJQW_LudzJ*FSR??zcDsC6TX1!1=vL
zqV`3^{IhJs=++)!(?4@J7TyCg|4hC4UL7jIu1H-D+O{d|u=2P<_36gn7bsRKI?$Dh
z-4i+<h9qSF?s<3jip!oZ+;+*uM^+cFw$#9E3-T2%E^ppsW4^%e95vhxRwxT$>}YWl
zP81Q6x%aB$Y>)dTUN_vg)kxkT`7)T=HXKX-2{ZUnd0g%gFP&HDPcYT}>{LlpFJJFw
ze+ljBz_G1w`z6M|Vwz@6I=BZQ-}=o%{@L;ddbW`x0MK8Y+o7#OL`R?PZp*nh{!nrs
zL%!p`$TEN2WmDK-v^Sz8X@u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xcDh6@L<WX)DhjJfY7?2B$*DqL)Qp$;-Olb-oy7Dq!>JLg(D#XX
zUULKIU@!!#GLM{tkfcxa66N7TCq)sh^UEYY4+4q|bQ9)`KVqx7?2mq5wS2A&fc3rh
zr?$ALmVC&-_jr|+1<kJo`u;4PjGMYW!C)EF$<Zsx`gz>Fsfw<a1+tV00!Tp>3euU&
zQnF6ep}Hg;koD7ioLY~WdUW`yK_;Gn*3z9hC;OM#OO$IT1qa>$F98(2ngBVG^e^m&
z4JUUu{(b#*VL>zjSV)=x>=V@|bz;QD8u<fD_|#`(My?J#o@`?CwNRU<hWj+KZJ)UY
z(YI=?RP#X9A9OuZ238@V0d$8S$kS}*Bj6ncxD(m3T#pgO)fe2ENd&3Q4Rm+&N#o-C
z(`t6sh2~h$-@Hh70qMZ5|DVMPVB=qJ|8{Q)_$#tuw~6rY>!@wn>)^ksHuF>j_hmFT
IY}mTtU)`Oms{jB1

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/lpt_free.gz b/tests/ubifs_repair-tests/images/lpt_free.gz
new file mode 100644
index 0000000000000000000000000000000000000000..31c46a0f6277f96a0b04c362c1fb84442333f5e7
GIT binary patch
literal 5350
zcmcgwXH=8h($>pSP()Nf6a<c_pwbisq((%V5kXK;LOFmm=`|#j94sIpSSXPeq=Qsx
zA)!P-YJkur5(trA5{Q%#LP*}vd%r(-9sPaxuURv*_I{pOd)D6bNX7H<@qLbS*~jDM
z7v$g?;Nr56Mn3dV<bhPzI!09Zn4jLc$yNpPdw#@Y`~4lRiu51QyK(<S@*mLs&>CBl
zfM=s8khVkSwhqFR$S)TS3T!QfU_-VRu+#J-uY}ixe0Mq81eY}pW?!H0Kw1<H#vSZ0
zFm*|Iqo2VE=#6|qY9uQtYIn6NAcd;;{eFG+q#ANSzmM%ZplHUyEx4=z^j8Tq`$5+J
z-{*yjn*)Ns58Y_Z<4XNL^!HOHmH~{jAs*K>j4qz{&YDXUp#1UGie_QFZr|XgabE~~
z6`tugbn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S%4>iWt8B0UTQ>y!26<o^f%*T8lhe4z*N8(Z*
zT?D|kcf{)X6;!633ido!ow&F76?*u}VMw(5i`00_a9u{wZq`U3d}UHwonnc;I+{JH
zeQYz>j#Feg!F!OPX!Fow@E$4Pu{Ski4d0&AfPHNZFI{^sj#P_i&|dUjX%^2=%e1Y+
z$#Wd<-7^U`fI8#xZF?1@WPQ980c5SK%ECvzXFe*SW<P*#*A>xvmtwtj#Zd4%1ZBos
zqCIDzB5qNu*BOlh-Kz^6dlAhOiyYH#(8*KCk$1D%o|H{_q;Kk-9iP|)#_TxtbSk)s
zrCXVuQT%3GbJ^S9!zpxRJ;elUPfr_rP(QOwYny_>SgIY2@kSL$k!X>G!hj@M^sw0?
zxi_xj06rHCUV9(m7_cSQ+x?0j%Lga?>%Tu=f3KfP0<y0=o?!uOqJ8iIoqsB2d;D|2
zKUA?lL!CE(tFt|T;EUHH2D^)0d!em!pxX1C@CHd>$<N(2zzb^Y&)!{X-ZJhmdSbDq
zz1!ql)pAW1E-B%2JAXzxSbdrO8K**Wm<X)Vgx*2i%)eX|4otUBJv(;}w<5U9{%?do
z?H`Dpi9N*N=0B#d&$t`ENN-PNe-W5klYoB+UVne@0sgVqjUT_EN!j;&G)8*gzJvSz
E53u@|q5uE@

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/lpt_pos.gz b/tests/ubifs_repair-tests/images/lpt_pos.gz
new file mode 100644
index 0000000000000000000000000000000000000000..39c2fb10902958e2d6581c2dedd3dd70b89d3fe2
GIT binary patch
literal 5374
zcmcgwXH=8f)^>(b9Hl78pn^t0nv{r0C!i<@iXb9HFc4AcCA5T2t}=j9MU<#C5h0=k
zR0yF*rG(xg^w2{HBoYXbwD+5Pzh85m@9%eh?X{o1&UyA;d#|(C14`MuH~mYp$1V~7
zpfGq4B6Qc<^zXN196_XwTG>Mff-Wddebu~fA4ERzOE6qprf2ts^EaiQ{TBX9cqPm_
zBz{;50~@#wgCCm0w5VDX!yKd|2VgfMk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^^T1OC#}U)d>7a&{@R=tf4ic*MrHoWvw=EESd39_
zUEZ)-h||i_QEK%eM4-nuHX6r#bxULK+F034rc93!GKZUm64pHytj^HiP~|uL=qH0u
z(p6$^plh6GS@e`E9yj+=Oj|s^H#tGm{PfibXUiio4q0H0z-bOYz5sm;$Q0}V_)tWl
zVOy~L7mBu@=!AF2c=oeX4U^q2rv|EB)LY%;vOhaJEq;93{nY!Anv<m}RZ8|0)>Tty
z&Ri`idq397>ghq3&0e>Gz$%zYE7gHGBkbE0=Et$8_<>D!E<+z`5TOLL>1X~({epBG
z2JGz?bBCE5ikRp{C1&ZNjVMjqmI8)a8mKQl%6NYCdBUbd#-vkbFjz{h0v9+LJ8R)%
zO)uGUt(81$cT>WKH*tV-5^?G4&_woS=n(n-w6*sH)a?7W1zgtqSH{hnxRE|5CuI%e
zNbmLcb6Av~n2`>T!7h|_IK5Alnh{r{P*Jook7=Lb(69w|`NXZU-Zp1}k*vo197E5+
z`3vm*lD$@W{HTT5(PWyPWp;IjrdFx?WIpjEZ|ccsZC)p<o|7<G)JkUE^}Ar}@1wSg
z2e**onw`fx!rwfcsr=ja^%@+t1n?5LPXJ;p&BL#MQ{->(t}n#%KWSSJ$?5=zjNzj%
z3xrlxW;zVA$UM;hl*^k7VF@5}?moW<SbISC-zA@Y^IRS${1nO&C=DqbN%+eMdOUC?
zd9-IZ|AF6ozl)A$SkOm*S4VF_O96=?OrKIjS~PMU-ryBJQR78#qr#9QWxW-zxEBqc
zWs#-!$#D2)E1dr(2+ScifeU^At<3?y?x6pk%C5cn{QnjKf3y2JJC&bwzOPw;=-==9
R*KDllRmIA)yLRo_^*<xUq|E>T

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/master_highest_inum.gz b/tests/ubifs_repair-tests/images/master_highest_inum.gz
new file mode 100644
index 0000000000000000000000000000000000000000..8912bbe3adc56135a16ee4a26718f8c53c7cb870
GIT binary patch
literal 5034
zcmc&&X*e5Nx7PM_qN>zTRC7wJidI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#gOHUfJ8)kTX
z>OJ8025-dks#OvoJ@JIS?+P8#nEkl_l*X%}RZ^vUyeT9~6&2mp@<cGq8s1J|8&292
zj$+eW7Fpz%_G!zFO9%AS>Qt@xUv^SVBC^4@3$RktbFqh8im@k1UfGdr_;@%r8R5E6
z_i3nKvaRbyXIpIg*8VGMB|`mFVOa@%=G}*gzJGtu|D~n4ps?VC!K=q&_GrDnoqzo|
zi{GV=sgAg+J&+eWW+o(5J$Sw2dbQ|_Ukg5d6Gb;aOT0HR4pDfKn0T*KE+|U<_tVM=
z3t^XfdD)qSBja1y|CVP1NtIm0X`(TYzr^LqZ?S*ssr*n|!1HOGZobi)R#`W<n@iev
z0B(LhSdvx@%%0|lJ77hMJU@jUH<9f-Du1Yr)?_@tJdQpZuW}Zu1j+cY_`>Ko6+m3|
z4s>A{r(o<&ah_`*N7!DGbjrcM%EM>;=~xE8WoG9C@@tPZOnHtWn+6BBM${ztNTm9r
z(>yjvG=U@T7u>gjDe+8a_}!}|eyMO3*`3-HSA%zhY_yLQA+;88B)gXlAFYBV2o1%L
z$8?50j;o5_<?Z{cFRr9f4qq)?!ysh4cft*-KF8nACd@~_Irojv2UJsjY7jl6%rvq1
tW6M7WjJwJM{B>V}nN<GIRy%Y2pD6wH3hO5i0<YF2Vr+1C1OyHU{1<?e%WnVx

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/master_lpt.gz b/tests/ubifs_repair-tests/images/master_lpt.gz
new file mode 100644
index 0000000000000000000000000000000000000000..156a2741d2b352933e7eb5d6f4b49d03aaf45ba8
GIT binary patch
literal 5035
zcmc&&S5%YRwnp9R7B(UXA|S98#R7_eNEgwgNReJdN>qBU2|ZB}QIH}CNJ-eB^Z-gp
z=uto-C4jU5Aw*h22|)-Ur2c2$bH;tR?tNbF!@cWijWy>O-<;oEbF6Po`Q%@Jb!biU
z5ZD*+Ff8076yzTqE<hz7v=zsbdNzss_x~bpC8~Sxv!K20`*V+Oec3B!`^z2~!K6pG
zlG?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$u9BD&D}JlE8qF
zM&7<8Svhf|gNYdxhfld6Z|)a;c375u_RV1_muJ>GkTrWrQD<j=qZmp|#_k`7Dmq_6
zuLZYp+Gkv7U!5>2{}yVm-emx_UT%v3hM9WUdPDvv`9^zc!pB@S=L7z{F6+0zhY8Rh
zs*g-!J}k#^r&0h)Ya5ES91^u*=xwu<{A=+ps|UitX4a+V`z2hJnns&{oO?LWC2}vr
z?&liFPMcKiBG6703XoUGX8ttB`3`NG;{xScP_GZW^iZFxWICl4gHd*!MS3}^J0qC=
zLMe4$sQk5IM_dx~mu|L0IqA(l3y=hS!QKj1Q!qd3iUFV}`xQIEXO(J{_AShBdq(|{
zE1EbDltB4EVFf133<CJX-_mN3xrK`=kN7Ye5zq75r}Pyd$yXHqG%9*bm~UYLW1NHk
plbXk^*ZDuQHIfPZ?6tiJ{Dl6yKI<n0fjb*2kF#A@1q2QV{1f#0(;@%>

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/master_tnc.gz b/tests/ubifs_repair-tests/images/master_tnc.gz
new file mode 100644
index 0000000000000000000000000000000000000000..f62ef22feaf880ee83d795d29a9b7d3fca61506a
GIT binary patch
literal 5024
zcmc&&XH*l|wniOwgh2)b5fB+g5fw$6p#?-nk)o7PL`qZ$RX_rvLsUeRA_xLf5-un`
zfC?n^C{;=V(gK7KYC;Jhgap#xynEOCaUJiU_v5|u>#Vc)TKn7IK6{<-Y=y*Me+_R=
zfC%mLyB`z`fr5km-GpeQgSL_ca@Qtl|NdVjt;O~3d=a*{eXsoBdgopV+h6v`2`4<b
zp3u^<_tc#)5|OBTzoU%4xSmSbFXg5x{_+^Dxk^t&PQnfGXbX<b56UEEH-u6ecJOVz
zI)=2-Mq{nA(<wAkJB6e;KBZ=2xh38mLNe{$FZA;Tu9Rj7er^(yY~0Hb3=NbC;75-w
z+K#jK{M>IBe3fVTbCXb93LE|(Ou}Tsm;k#PpprpB6ukKU@ZHo$-a)~E^DYUc&6!hb
zvL{8S#WhT!eP+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&
zW{WlKaje)6@=#!$P8Trdb~{(T(5GltU#X!xmbfG=sh<j6GX<~=qDFJ-QaNDLOPN8-
zk$bOY3Up<vAx9LXhZ38v=^B*jbZ#0=V&aTFc&=kv6_mIwChcl8>~QB!XUvZ|#Uv_G
z1$3~5m;uVMQT0|l7rxOx#Qk$rcuOEKp-~n79oP(J*PCzn6Jk;Y2mjsk@$Q1)2m1an
bVEs65dSS``A%f6c<em>sFUy654ha1hL1fAU

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/master_total_dead.gz b/tests/ubifs_repair-tests/images/master_total_dead.gz
new file mode 100644
index 0000000000000000000000000000000000000000..90a2ba266562d58b7e29f52d907095d3c2b2cb43
GIT binary patch
literal 5033
zcmc&&c{mhm+gF`Z9EnI-a!v}B5}L-E<Vcq6OR`L|6SB<MO(hhG2w7&lWH%_xjC~53
z3^R6P8<Q{-hKVtl#msxY_r1P9zRr37`TqF6=db6w@8`OH_x-z{`+Dx@C!c!waBgdg
zm%xEQ_porUP*8Yqxcftpr<c2@0F5MQCqX3lZjcTh{6)fAOy}+=AqTrs<p)Ne_lw*8
zvQI`R<$+O3N6-E<cRz{8AnqSS7<_U&lX6hfLsjg>Nm_fIj<Afl2kg-%6jKzIL&|H3
zptS4|x^P<hwDDF$K-JlF8mXH?Qka}oGq&6m!$L?VxPt<Jzd*H8O#a`y1SDGbGx;Nf
zReb1)lS_7!tbKofZWnZ8Pyg>-0*UEt=znktk%<$0%xbVoHU(Dv{Kvz0vmf>Z`G+pJ
zrc}1)%&JNME;1*kVG`PJ8v2ivv+tgjT0TE}Tm0c3+IiIf_PI~~;vxz!da%wpwZH41
z=>xdR<RjPj%;cRLU-;J-*vAvK?H$$M`#tX*V()1-3gXmfOqSNF0S$d>lcOIuUE4fe
z`(V#9QmWVfLvYH!lFNB~k4p>*dy*zGY)mE0u%o0end|C>gGIB_t|lh8`-4Cwk-yMw
zWwVZmR{a=~80qJKe4LL19JLd3lXV^$xp7IO1xzLMy_gF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NeVbqJY35fqw#GBF_x~

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/master_total_dirty.gz b/tests/ubifs_repair-tests/images/master_total_dirty.gz
new file mode 100644
index 0000000000000000000000000000000000000000..2286669f87a908dbd409fdb988ae2ddceb6ad03a
GIT binary patch
literal 5032
zcmc&&X*e5Nx7PNwPC2TSQmRf%RZFX;#;n8Fs-ZPgHKeUE6cu77Z51sw7d0e4Y8F(H
zm?EtyHN;F1ktz~HM2R4S<evL|&;4<F&iCj3xOe~B&tB`<@7ina_3U@QvWdU`+SQWa
z&UeW7abS=;7#QRq^!O>z4FnDf<D(M!ZN%`To=xK6!@r1Gis(N0B4B4ztoY=1_d!vc
zUk*qMBs{sDfbKeY?!gz)2*jh~h#OyA&LtcccU2L2BS~$m(G`>yb%j0Kf?^5+vxqs(
zA>`)W!Hzy{L+V7!EzJt~6e_WkOq83NRW&l-62S%&jr$Js{rvz|OE7qUZ{ibcImqCR
z4ps1=Cnc9`rkDr*-fs_hec$l!O?<H_Ea-nQ36SuUJj|NEawZv8`1;4w53_aq{JbNV
zoD<61vSwAK&I-+ms2hX(O~C(5kpJ+i*!;EpUD2oeD917HyXU`niweoT>B2f@Ri8CH
z*Q@C)o!dy;H<fj)f8$-7XB&;zv9(wG2zuQ<%-Ywg=kHS^7%#0?YJTcfof`YR<=pD#
z+zWe^nozm^AA(c-ja16zxn8D=*%Gzzf#b@7x6nns@f>IOK3F(2Nh3DC%^L_T3jJln
z`gF!o;ff!_Vx#@M&(CxFG>_ScxSVzz9ld^8y%|Co?0qvAAjmce_ke=EMV81XgAe`-
zvdex7^Vht8!+ev*^L(O;6XRBUc4R70iwqtXh6876vQ;nLurU@qZBJ0^U)zA&_S(4c
zJlOcaXo0YH(vu9N#0ey!Z%D~Dzl!|g^<ZBxGE6^6UXa$eD)d7}8{9xr1Z;dUaOtBv
zMFvpHk*iw8mHT2Ef={7+TDI6mg~iSV8}{dD_jWnk@T5^o+y(XzomuwVNRqcq&&iO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;xlRKCyetE5Mdr~cWkjdBb`m2yJ6dS<akR6_7JNIC
zxScOq8<Aq4H~wrT=Ua;w0*8!`2Vhk30xVZ{iAe8@K<QVW{xy5$oRLt9Uw_rT6`yyj
zi;LekqC#ok3Fy=53R&>6?U$Rm2Xw+!%8a2XMSo}~?{g-xWM2w?Nvc`V!jr=2h3KD{
zdoO!;i#y?Y-7-ZsD@oGMZ=DKi$$L6<M(y<&jZov3Xab5+hR0&j&jcc@!aH#+{aHKQ
zF;o_Mg-Lv6m$}xmdPGO1QQ4CBWiQ=0D$m_!8B$?#A^s@33?)hM%8TCUOAJS)LS2>{
zKaCBY?7+V4>4?wTIc%U(E;vLMk`~ux+<y!m{P*|#UtEd<j0m9$JeI^B;Lzmbiw2Hx
z54d+F!z63mG$h^58J~1`CuV#E`m)#XQQC-tU}E=^wA--V=G_UHQi#lI8ar}zB@DWu
zKNL7LhF;s%|2I8*XqnAZS$z1F2L$T5^vwONn{fCcOkSiClb4NKXm;a1Yj3%3lyNbt
zvAcU^-FwfF)Xjj6)KTXwM#Dczi2O27uSU1$Z6c24DJfLzg6#KK;-rt#g-wJ@-n1~$
z#*UXtN%d&QD^N|tosC0(ria%f_Lex%daY=v@1~9+Ky-^4<8OW;Llz*|>|{TB&%Qq)
z84*k6nt<!_O-Uz?ud<6>`i~f>6icW}`)AT&c-VL9)pgy@v-Q!2YuVmCv5?kJhlDh=
z#Yhs&P5wVa?Wsp=^MGDg_4XP(Rw^{4w|Goi>xYV5@kJiNXb~&>XYX%Admygi4)-Uq
q>6>9H@27pA?=A9v^7`F?`Lo>g+MN3n0^j!t{scE*5g*?XzW)MRs>mGx

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/master_total_free.gz b/tests/ubifs_repair-tests/images/master_total_free.gz
new file mode 100644
index 0000000000000000000000000000000000000000..0394a76baa38bf36eb64df3ff4b725977208d7fe
GIT binary patch
literal 5030
zcmc&&c{mho*H=B|DUU>?Nb?k-QZn+4HEENj>?F%nj5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LrD!Ilz+0;8u4HZvl4LlHK9oa$T7);p{58|?0
z7ub|%_E}3!i~DrdF=|%APdgbVG5HYNd02(1O5*<3GTc$JSAOhTPjVzK4emOR`7k_i
zq@D1zt35G$Ywu<Ca<KurxV(%W>&^ps|G(Pvf7Vhwa8%fUn9(7^uJE<%h@6H_m2YCV
zUe6;XewQYx$|w~XJ@LAJ?fNMz)sTCmGWSwcVY+hZ<u?=`5Nfn@0(F!W^(}z8+%;k!
zaSqF0`Ip|oqy!#Z!~3KV?%J%A()#z=$c~uYhA`fKL%4m8o4LSy(oWv(ce`|ROcoQ@
z8~@`nb%B;rIK#UKpKRI?mHcIfi>aPYPH#Dwf3Boj)6bLksH0#%Gpvd<`Za+~@y<U3
z!Pm91H#fiX#)T4ps}6-75)5Jf=k;FJ=Z=xN`(GG<74@x`t*&ayCdQK~_$>9wjUykp
z%!R}WrKmes%4>%r&j1>l_&d-Vvb8+`g!mq)zC`Xg$&6K5^IYtTUr=B_;p81ps!fjO
z?)j@Jo}3{<s2&T{565}1YIG$xget*V#n!l|JfTpMy(Rir=^d@Md|~QOh?x`qZT$56
jW%l3cdu|~B{8gRE_e|m6EIi&p?Rrd;x+o&DPvpM<sqf8&

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/root_dir.gz b/tests/ubifs_repair-tests/images/root_dir.gz
new file mode 100644
index 0000000000000000000000000000000000000000..ed846363fb4229ce01951c8bc60c067da0a52310
GIT binary patch
literal 1298
zcmb2|=HPhwv@4Z?xhOxsBt9jxh~e!W`;0lIGRHqY*E>6ZS@Xi?EgdGVtfd=XUTD(D
z6_6>>;LvpvT;d^{<$A=Pm36iPN7<_85G^OMr59Xpuk*U-7*Zfu_#((9R%FSFW@pRy
zhUZPECseOIdpuq^UjN6_ca`tz%HQ7+He%U#^ZNzm@-3^hZ{0P$8*8lo-sWSF>4ATz
z=i16Lpn?Z&Z;k)+qlz&c)t&i2Klc2e{|D!87Wewjj4FK~D&e0zsu05|OhcaDeetKh
z{QtGE*Qd03%(q|OD=feF|DkRBbPv~lUp-%Ke*W1xGppDBN(?Wp^Dg~3?N#T^R~e?8
zf6MpZ+p#+IEKlg-$)Tk`UVeMO_^Wd0%YJkxh8;O|=0AVcGg0Ng?DyZ)e!TI`S6Erv
zZvWq_W$&LHIW+m$tWf@6`D>nCKcoJ+f9ve4S=S<h<Nr4|F5LIsV*k>epP!y&x08t~
z|8vt{{_npd8`sy>{Ox{!PItG}ip!d@AkS4U{r`^<$(O4SPWt)3YDwL$sAqrvgF<rY
zZ)9np$^_jAqyP7J&HMSk**aan<a>Uu?w$iT8g#qm?r;1)@B6m=SrU@_-!`8tJ-c(|
zyQupuYx2*XH9fxd(tL3wYd}nuHD~_RXaC4}e*N4b<=yY!-K{S8_OJi<HlDBV|Npup
z|8-vP-jDy@O@BCjzV)9cjgI*-2j=s~+r;il+^Ki>*G=Q4($l=N+ph7fm5egpl9qAy
z!mNd+&eRoHv+Y_a(64*0gg*a&{p<Vr6>kompZfE^==NK6+q}(nrqk5&jI%p_KL0QN
zcK@`mf7$!zSAO39cD9<ES^n*!lpW=pVnY}E9tm>3YkKX@{8#HfKC4(2SwFvi>E4X<
zcP3q*QC<CSTiyQZ*|%RlD|5g98JJ4you%1pg8x*1{c6AI=ar`u?{%(@`Txsm$G>d<
zSKp;jV`hz;w$1<h`;J}Cehf@?^J>3`*#6&}opnCA`Pu&LXZx?u`}Iry*VDP)i}wmY
z`~N@O>;FI0tkW?2B-i=>{Jb|dE&TuB%S~tYS3lnu=ie>gWB%VZQum)a<5GL{jP*nR
z4lo<NtV4AOLj?Dk|EOj&I8;9SkCq}A*nIwvrZHgN&w4Z=jq`u((S)X?6P3ef{%1$k
U*zgI9v+5cB8vpw<Ft9NI0As%&^8f$<

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/sb_fanout.gz b/tests/ubifs_repair-tests/images/sb_fanout.gz
new file mode 100644
index 0000000000000000000000000000000000000000..0b267f64b3555c689e2ba06baf23970d089f96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`Fe0OyE(~Uwc<E0rr2o{TaG1cUSMv@joQSod4Ir
ckMe(`<>pfVO5#2J&fAklkpH}AkKmqv1KnSd@Bjb+

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/sb_fmt_version.gz b/tests/ubifs_repair-tests/images/sb_fmt_version.gz
new file mode 100644
index 0000000000000000000000000000000000000000..31070a12e2f63f9c0f90ec8bd0790783e18f0ba3
GIT binary patch
literal 5326
zcmcgwXH?T!^LCe2Y>0?7ML=0)Ex^*Hs~|{|P9PvCRZ0jXgdTzmiWN|VAXVud5lH9(
z0Yi_35+EdzW`GEYA(XV=|K0zmJ-hpUeeb6^GtW75XU?5_pZmx@J9yCS{ZpTP0&q_c
zUr3loxDO2O4-MY;jdI9Y%uyD<*(`DLxQ(&VY?oq)fZOQtpF%BcRrdGqzkbc(#Oq(Q
zPKIa=DxSc~HM$K73H53?%%Y7|ZWg<#YP=i|q5HI{g%pS6N7ir9qm<x;W<TFJ_{dRX
z0u#Niv{qS}sJA+cwqL(Y9MLBmM<(-5D=X0V{rie1P3E#u{~p`-)a?NqH8D62(4IVI
z{kF>eFR(VDGC=U(V{eyj0pWiST^o&|uz^{gqGLsy{K+)TZ5V#0)(FxNezAn*-V~%_
zEY_?P_dI0OcFNYV@3-??PfvV0{8ACXXw;RMKOPs^y7J4}->xBDt+~d1b^HrDfh%d)
z>m!&#gp6kOD_xxl=VjWj0}iKni#pI9kRQhJ$wGxz*nlS4b0JkXIHfKm3hr=zE%e{F
zw(sP_pIN{vx*VY4HeoPZ`hThJ3&iFv--D&f0wT_N>ce)h4ok9~U$k47{k0}*EZXn;
z1>14sOCib0;}W%E#@Q8}bRC)%3uvv@Y@FoKa)Ia}iL+lh`e&mchsr5ny&7|P6<F6(
zXJ8?Rx&8YIUw%amNjY-)^S!gOF@i@A{y?X|SE)<LM>C{%M5?tB?i%N2jXkF&!&odX
zSLfl@;NG^=8o%ykxB+605wdjtM|(L!(w$i8XI8FQlaQ>AN)gUxrQ@3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|M
zc8qHYxI&bz<~5OLuw#I(86Hs@mu2nzJsU7bSOi4vcbV0k8q1|#tHmB%z!<+Daoqst
zIrw#UrfISvBvZx-WMyX;lJ>U6eQ3BiF<sgzx`};P8g;NM#P+IW>zzBPY(y9c$y;V(
zx=vS{3DG1tv8e8k3V(`aoj*ia8-Jy#-<5YMT+}$@Z!%Q;(l!2HVSo0lK;a*H+i2R~
k)w%fPe&BCaUE5j&e)?<E_wAF5HvCD#$8c%iz61OI4@qvBC;$Ke

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/sb_leb_size.gz b/tests/ubifs_repair-tests/images/sb_leb_size.gz
new file mode 100644
index 0000000000000000000000000000000000000000..9688ccde7201ed5eebddce87d1d21490c9a9ce1e
GIT binary patch
literal 5324
zcmcgwXIRt8w|19REC@D06hUPb6@jHjx(b4VG!Y10=`FMvdJ+{B5hW;6qy+>-dMEUN
zfOH}O5+IOBGeCd{A;cskzq|kYY47g-zux(Do^#%LX3qP}nR(|(C+y$<qw=N49s#JU
zi@%4f3)CmlW6#>`0kEjGbnj-9_=zJH2KqCd@<9TQqep%THnCLN+rRh5_4~)({RTP_
z1R9h-hB;gBIC%JQkJ|m2Gy|nug^tQ<Z^nbD9<3@tg+b`>S~@jC0g7w#@<c#KgbZ+u
zv<-#z($ZM%)tNM_4LSUX4#^-qk#|~Amb&NP$73QPn}huK*q)b;PdLbl!Et~R|AKjG
zb@#u(S`U8$1phsjyKD)F{Cnv7Xw)nRnBmD=m$b^9NNz9->7B0Bht!2${>XH0^j9(v
zZBjtI3L3SXw6yNKbYc7Du`dVT$O8>()gO&tj33>;`rEln*WnK4y9RyL{EM1?E6JD}
zBMtd5DfRNVTACB!Wy<dZ_fPQ_H3M0;UJcgq3nidO1L`E#g(R&2RCQ1U^!|nQ;D6uR
zo)gc0Wdf^d#Q+7n84_Yi{V&;lgIMJ9U6{&DAnd%WP6!Kge@VLIn?}pB4~S4<(&p_I
zaBuf<5hO8jT)a}$AhV={s!1_r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O+PzyV29ynEbPf1~%!N(*M
zUYgu9`taG=>zBWZua2ADOMuLQLw$e<3nlVg=kMJru+aP#5Pzs2Ft2kee!Wv^n#F!x
z5Mi(E>9WmAltS^)bbj*st<z751Oqv>$rooYsv|fzzhu^Y(^PMI=PjQ=7#vzT02r5H
zOA%%5+7){8_QRLQSQ=3XU*8IT7549XkuQS02uPzpqkZ5%eCe}x0`F@n^$bHdqpN7-
zqU#{@rCoV{r;oA4!up%owPht6uN+g<t*6F9S1zRU@Udvnxs!b&X3r~AsTbiA)ArVC
z+jYhCd-^w-7<LXlFg=R;pWMOPpZUDM{?7P&v6+BK6#uWh{ApL6>;wJ^`_py(=OXZb
m=-adBZ1fiJw~0q|*?*^TKYCa1Z>U(hpxCK_Kihu$_WTd!RFDt=

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/sb_log_lebs.gz b/tests/ubifs_repair-tests/images/sb_log_lebs.gz
new file mode 100644
index 0000000000000000000000000000000000000000..4f74796ef32f96d688bb3b8dbb988682a1122fe7
GIT binary patch
literal 5323
zcmcgwXI#_C)^?Xw?1&18BA~2dp)57hMVe9sgg_{QQbbB<G4v1=6c7{yAqW9fdKZC&
z9uP1TAreY}Kq5^_2rUFiLh`?R-%sz|-TU><r}I0{nK?7(H)rOYM<U_i!SYWp-S_dq
zT%3LUJe+;pU10lGrVc@bz!Lb429eVzEcEpz+hzUv90yPQ5@2Gfu)k-&?oI2HZ+`=w
z_6POJp2SMlIrbep)}>-SiPBdvC~#C%c{A+4;NGm{U*Mk`QnR)YDhDGpcsz=P4II@c
zFi@*<^s=%T&E-jy)#`QPfEHOl<Tdx4y!67pe;!e!(QG#IpRs)}9iOt1BYndFH9n4c
zWqI$vm^B|O2KfIOd%tK22>dg2b1;004NP)n!KKYor&BR^1Mw48deGXStA$LbdLIRS
zp$56gME^m{F-vgwl}lSMPkuf8Mi#)RR2Le@4GV6`{C45WO@xE_o_=>V@3Ol0QYuz=
z0Fwt7SFK3VP#=LTQh)E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@#T~%CZ=i?39DXT{QhKP{dQlIt5J#obx9*s
zbIsS*gU!t*7{U07nZfR9RpI0Isv}D46(2Yz11&oS;R2M^<q}hLC7Ftm!hO2hf}r-(
z-x){{++QjCA(}8eux@`2=BvrPhp~hk=;w}VI)3yB6YG_ezQ6C8Z2L#|;K{Iu2L3W~
zSIx5H4u@y&|BvF!L=Xj-C(2v^bhLLL{=UNcOWV>Gc;ZhSV$4I9a>Mj$k$PVy&;2e-
zOi=*bKCO+Ei~%fhb+TQvYzP!ldoTLcK^GSi!MP{IQXGxHj5=8X9t=xY)0lRSX9k1J
zRKcChB7-s&_idP*W6nFfVx1N0U&x;*pd+^jz!$AA*vFP?L(#z(V7&YMo8mk8O;(m6
z2w9aw$`m_l^=!E~QU9}4&B%tE@5lIdg$woast{3D=&5JZ&mQ~{nRgMi#DIXI^s&73
zr)B+b8mkfzINZbO?0<WEz&glb{eQQ6M<PLh#P;4V{}Gpc57d(XO1wp__W*y1&&}OA
h;4c#;BQ}BmTx#D5ZPs6Dz=Ko)<E)hj`}Q5!_b)h^j&cA1

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/sb_min_io_size.gz b/tests/ubifs_repair-tests/images/sb_min_io_size.gz
new file mode 100644
index 0000000000000000000000000000000000000000..8871841ebec45687923045e93fbec1e1fe79fef7
GIT binary patch
literal 5328
zcmcgwXI#_C)^?W_6j1~PM4Dw43uUR1u8V>o2uKM{Sm`YUh@pq5pr|OI2tf!Sy@N;z
zp(7%lNPq+gB+?8JdI%v2$^YGZKi#{#_v<^K&hI(T{GK!A%$ymyghPjhs$Y5@;Dfoj
zLVN>VeW9)}-$>5`t22k~#cbtzwy+W>k6Yd}obFT%;&UE3{!{QBE0u$N2X9=r5q<Xy
z=wuLRKv5KPrrvqr=+SNsn`zWdm0N|*sv2*`f~cM?YC(lTIpMV%)CeUQ4(sg|0~;2)
ziKC;|mDbA3<8)W1QP%5M@xywgo8gIEDP?);fq!m~h=eRQ@}GSNUOGQ!B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cc(6~$I_`(d
z%6gh^(`wyCc}3KYnkv@7iV@ERrkXR8OFmx`>c~$^FUosv`G(-~OMUNGQ@`BQ22*p<
z%WM&egWLdi%FB+Qee)k!1&RvhnI9Jvi}SeMc--&AT%Ll@NRc?!=d5Oz^EZC8f~B{5
z!qPv;Smq%5fu<ba2B_TsqJ^-z?&WJ%`e`w>8282bus@%)x>-t6rvo`bt3mACD1>}c
zbrWU$JvWF$Lp|klsH~3|sfUuT7Dw{8f#68R@XeZs8;^Na*(+nq&$v{Kcxs(T*lKg_
z1<Vc|+cHZq-yo_dN)XqyDA5{`MRQg$Fe@lbz0Jj^#fh1xYA+seNL*1Tg>YoxNzbS4
zmxDFwABhhCReOCrWx@i+de3bG`LQ|Ay0ZUTz@<GY*hlueZ3EUam<%^A&DzWL4CHYd
z8Y>@*m@l3Ks8O2%-jhGRW8pRZLYn8EC%CqU>ru_suO$hiM9Rf#B2zO@?SbdGGm0sS
zwkBMM8b93a7Tlu0ni~DjCE)&7EC&v3BKOo-z`{vhfIrZX-%NGx&58o^p0c;X_1j^2
zaPSbCu=D-5?9u9(Q&L6Rq0nEgP}%ZTh5V_aHb%d3w|jA!$A!cM1oAQEf}?G(R!geo
zA_$s6`5O35NG^^E8f>TkOHe`P0l@p|Kcs;tlp!Eq&)`3xfAbD*1Al>z>$8x5fez*D
f|FvVB1yAlTtk3d)`>LDe{4}4_8FJtN|AGGlC>xWY

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/soft_link_data_len.gz b/tests/ubifs_repair-tests/images/soft_link_data_len.gz
new file mode 100644
index 0000000000000000000000000000000000000000..4fa20cf01fcaa5f0145bf4b2639d89ca0b9184ce
GIT binary patch
literal 5389
zcmcgwXH=6}w|2$>R20-vs=%lNs3=GcAdpc;96DI&kdZ1~q=t}W90U}k2+|2bkY*^-
zYlwn^(jo*BN(fRyXbA)eA&vK&xxen6a({m3*IxVC>+HSOKIb`SKMF~Q4&_fKdL1|z
z8tfeg3GfZ_hj`u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*Kk-3ymuy4DyNfFn5l>))L8mG|r6qj=u@yef(@
zG%4P5C$|9?xDr6mkw|~R3Z2~z1$&EzK%~Zg>L^~TXL|MBUz&@tW;#m54sp_;IqI4U
z8$KSe2=Dy2Ab2GQNivV-pYIHAy;~qT&+~u3&#o1x_GLVVGsjYT2I`{^GIf+f+0_pF
z>r*LN$r$s<TXncvdpYo^R4QA8o*E@c_UycM&AO)TY)bG`fqILLW6b$U1qJLr{d35x
zGqi<w>^1b@s$l`7Q61`IyzPOauXXfOJw~cLf>XrD!G~f8rbR&U9=mPo>+t%PdZySe
zr+x2PmMJK18!Or8U<96ilZL){t)?2+_G4H5T1Qv?o=JUIs$3vhU;X8VwJ;HnDN!=Y
z8Fx;@UK~@p14f30nmga3AZ7;C_+c=Et{Zp3tyhd7@AphJ05pO*|HPEZN^np}NT@TK
zhsv48_$Z&5GE{uoz_F&O6#{Y4q9)VXEv(8s2Vn4<?HPy4VLiWYao;cQ#XRz&0qi^Z
z_A}BDTp6FMtNwgXmBeS`uU&=vT`1>i<O3nd7S;Y$YVhi6MktIDUCHT|oLbEyGFs7K
z{N<T1r}}w>>>FdMttx9uvON!REx}i^*348~ZxC<E(7I9;a*VFLgb}jOZmE|Z;oTo*
z8g4TVQ+L=6mldY-5pKETupe>D6^m_(8^dlbby%qJ%d|#xA%o#xmhdPmwbS)sq^?~-
zYEve)r0nW(A2uTvGIR*MfsLw<G19qrR>8c_fDjpc0dFq6HNvJ0^Zf%tD8;IJOzPtP
z9uG<yRUGjCxS;ZZmE@h(ix2|#eWPLi)9bojXP0obN49aL)wSVPrZLo|+WByoIsQE!
z@V{lghuX3$0$@DluQF4OFypU^-*2m-0QfIFa~I76zWKktA}$&DD=UoC{wDrabRoaV
N5c~befdj$^{sX?+t&RWy

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/tnc_lv0_key.gz b/tests/ubifs_repair-tests/images/tnc_lv0_key.gz
new file mode 100644
index 0000000000000000000000000000000000000000..9a45f26074ea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RDq(()mh=WbxRn}1ujBj
zZD1^hzV2B0JRw<HkRqh(8}ZyzaF_EFr(KKKndC+cuzs5Dy@+_p{TcRt2w(aq>sNCB
gF|hic2>k5p&n{r!-wm&=;eLr0yvp9Q=ir|I0RZaLWB>pF

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/tnc_lv0_len.gz b/tests/ubifs_repair-tests/images/tnc_lv0_len.gz
new file mode 100644
index 0000000000000000000000000000000000000000..1cf0d794741448ae77eab6e047db3d3e315408d5
GIT binary patch
literal 5420
zcmcgwS6Gu-*VVxhY+wUKgeXdrrqZO3A|M?>K`DuJ5C|Pf2xJtI4l>e9g3@cGOU)>~
zB_Kk85Hi#VF+^%0?fswsyZaokzjL*pwe~)H-JG-cvp|V_eDLlB_d`4(P*;d=*bRuU
zJM_?Z(y_;aE8_i|8ocMNta>EoJ_$PB8CAIV$DBd$Llxm8haVVQot^vL(YnFWIEW|f
zY*vuIe&DI!=TvW+jelz^l?s}4v~ErEJZgB{P72E8XyXHMEY$N=wg)%(G90BB@*HYs
zaCLdiL+?@p=v^4}xp@rb_J<YgyF!P4eZu`nYXI-Bxx%rPHGt4z1^@+tX*$QX^nRUo
z$p1GcaQN4p3}Of1`88#=4{ibUB9L;)QWQRe;+i7ux&>+>Ji#eJ26ZA!KGyrLx?!rY
z;%&ZmxnpaRF}lv5k6dZ&C8v}=oZx#0fBB;1@;>XCzi1qW?}-}um1iwt>nnLMta`q?
zPq4wRESrx<G$zNm3Y|}(y_ii>yBO${aWv)mXbYhM56<$EaGVvg1-B}Oy6^7}TTYqd
zk9XRrdKTa}KdcXh{#x&$^TjXM0Ob78C4-FUb0pmysHd~NN}#`$e~q?xZu@{0JdU*Q
z@p9u#n++q^7VcFX`z{^K{+$P&z?gP2h6g?U#JdU?iN}d)N%gUyD1zO$FjkCBm5f}~
zhjahwSlIQM3xNLBoGp4j0Kkq1huyT|SMxP%y}Sp2LRv=uir6a>ypyg10~1)#Hayuc
zqcMSk)#B`CE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
zrt4aFPbClA+hz7E>4v(Q8vqmSm2h-UAOlW5G3egvJrfO5z%#8P7lOyT)YqEueS-3u
zbyaXUBL%jtZZUkJq42r;=0b(+5*T{lM?P=M?Wyzjo0$Vq(=ay-+KNzi%@t`J<_3|`
z)@9k-hA3oTaI)WW*^5Dq`*^Wm6>B-)p+EVr-D^zb<^ixl(o6%ek(&mtW7|KOV1L+M
z27cbwJ|zwU{h?9-@NVnrgOA9^b9CVywyEh5I@Z)!VDB}vq)%Nk({V6<Ui4yZalmdI
z>M9<hZLh7S4o^9mb-K1EfMj-{@k0Q6(d8afZ{A@?N~u&&!*Tdr6!*u|VVpntVvwO?
zvZE_2nydR?S`Qs!gSe^yXovk1JSI5svw8Q&kL91OzRTfTz)yvzwGWU#L3}9o&-URF
Py4Dea#D|9t9X<4as?)~M

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/tnc_lv0_pos.gz b/tests/ubifs_repair-tests/images/tnc_lv0_pos.gz
new file mode 100644
index 0000000000000000000000000000000000000000..9ba36f97775edd4660122fd6d2b25a3849738df5
GIT binary patch
literal 5404
zcmc&&XH=8hw$+P@dPMYa02P5FUO+%Vq=^usC}4wtU{FdTC`}-dP(l(QHV#rPGz9`8
zCA1KF36LB?igZE=5{fhfgdQL!A^F}Jcf3ER+`sSbUwh2C_g-_Yz4sV%EXA1p`(e$|
z?z_YS5f9+L!RO$Qkpa7w#t+<;o>ORBHxmEF#^$q<v(4kZ4v!f}cKgG1q`UWCzGVM%
z;vV#FbcOSE)PdVKol)jj{3Z5|>FeC;pQq%hpoXs6)x~=5vpC3&N(%$`2BdSSEP@g3
zJ#g}621^p;JbGt%e_f@KBr)AGzmW;Dn=(3#XiR@CvFo1)%t?|D?EYu&OdyXB=xYxE
zcy#E)-liVOe_r-G^N9%m&(yAiibCMOP`^+a%RukfNyqFjAhV<1?0-XicP{3axTPpX
zvzpwCrc(Q?`lVjP#5ZL`n_;hKA>W;|-S4-al3j2|-z-1l{(a^BBI>B|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Qr919sJ-uYjYHk6yE?I7HNwDL18Q-G`&R9(
z5A3Y&RK#ryA9t;OGc&EMq<{+%oM*|hkagZ584s`)fK`Xyw8^y93h=6x=(|Rdg%(mB
z(R()b&;@`0j^giys^T}k*MuQ34F!5*$xaLf{`o5Y%qQh#a(wJDQ}p&+bYp#9dU(J6
z<WcL%&8b_RsqC`Urcv~k7;L*9<KNRI)?5ueOm%{pqL=A;sg00M4?RQ|Q)gx3b#_cS
z3hWRuA+wdX?d5lco!c;!jU)~&$Ga2!n72!Rpe$>%{1;}VW9TvpOqz%L<P5W@9AZrk
zAaU!uI;Jz;JmscHH<Cfzf=~v#K?-7#q;;X8G59tk{wv4eR+n~udwlm-!&9DvoGp-?
zMjLnuK78JbA1l$n*iO+Q;><Z{%hOSqtfjuqBJ(e0_kB@bYS-V(QdAjh^E$_CW}anK
z{K=nv(7n9@xYP$K0eJRKMe7HF_@C%qPw-E7z<-8z?a@{S6c=xafG}SOW@qPh->aV}
zz|^&#-n5^NcN;f{p$1av*(rI-nG*3177Y|-ZWNb9F4Txl5L^uaO(!Xk<%}lfM1;>g
zOrxc*#&x62<79Ub6<GTwJE>)|b>9mm!591`<Qo15a|hoi6#Fy&JMEI_uTJurD)85~
k-=_rNuW5bz0{rEyOKY=#Z7cp70^fbEac5`Ou6?`y2a(L9m;e9(

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/tnc_noleaf_key.gz b/tests/ubifs_repair-tests/images/tnc_noleaf_key.gz
new file mode 100644
index 0000000000000000000000000000000000000000..b9dcd3799a6b0f982c30a9c9d8da8011929c2154
GIT binary patch
literal 5430
zcmc&&XH?VKx7A@3J1QX3#TJ#O0wN;Bkr4|*Kzd6Aln59QLklgAh#*y@OA`T+7NiCe
zk|;>;2!s$If<UMV5|WUF<o9OYxBtw%wce-q?x(xX-s_%yZdv!NtsJ{+SIpO#hug&b
zyxm~lK93)|xWl|2qPDF}id#w1<=TEycI=Rnx^Q^q{tneKo#<y{s>V0memi(Db=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dQQuh>aa<Xh{&=^osBB<f({DY$duGS5_8<r<0Poe8Iu+5jr$x<rv4(0ts
z5r6%SiKkC9RGi(zH7N0)w%ql<&$I7T0n>ToQ#aQ328-~&m#m@qB^!9VA~B7QGg#Wo
z;(FTa*1%BUX#wR&0}wzVy8-@~9}T~y-{ycH8q%{7n?G7s#|=2hANG7Ce;@n<^o!Mj
T%n#5L_Q_lU`M5)eem(SGOET8b

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/tnc_noleaf_pos.gz b/tests/ubifs_repair-tests/images/tnc_noleaf_pos.gz
new file mode 100644
index 0000000000000000000000000000000000000000..60cbe7a71b18b647e1efeee448172853887de9ff
GIT binary patch
literal 5418
zcmc&&XH?VKx3xTVlo3WnK|o>|x`1@SBq#_Lnt&7$5&>yaqVyJ`ASxhDdS{RTLIA0O
z2t=g^0VyW55Fr#p2t5fTB){i+-~Nv8>wEXpS!<uQ_P+P7bMCnt6!*s;UG1?hd-nVL
zIKzDqUM`NV@W%+hJ<H@ncZC<ly4J@J91s>(IUo4`0OkSd>^`Sz(Ub89u3f!zUiR4X
zKGqxCn2zJGvR_Hn{By15;DKc^6;T8IDvd|itHg}%Dp3bM-i$<kj_0EmF?AFy<qK48
z_2To~O+BH-Kr3}UL2p*O3isHf#Zc1S;Dr76m82f--SgY^lthf;qkaqR*>l7`pO5PA
z+X5)3MaJt2H~0TOZ%wlh0R0|%8hHcI{XMkjz-j;&sAFS?-F*}8+?>!MoDgplEUy?t
zC(SlL?)A--_IKV2o{5Zl|KUv%%>IYCwDDhh_jeiYw>9GbDwh$pJrapeWHmn9j!kme
zGznfH$e8i+yt<blUiK<s0kJWc%FHvf>N&k3(~`yg?r)Egtlq5#lfuIsxXS@C(x1`Z
zj`L}B3!4{k{O&{YYs}XxR(`|~kWfXH{h{9r{+P4n$^i<nsy7_xzh7sYxsKh-JY_m1
zK6*pJEPFvoHC56{t1YWA?D@)QYe|}<7|l@@ErR;=G=CNnX!9mt!glLfGt98auR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{VWN
z!=jgSShCcu*k`?YCu>&g48Mdm(z;SS<;116y3auGLf4$=RfiSCae7)}HoEW+=Y4jv
zmg4Cz3Mw(8{t+zReSKxA^o2hMB$-VY>CWHK$_9rhC8Lcd1bAR=?IY`gs>sg!ZY3tR
zs%7CrHK%W-z<f?m+3N6UJ)hHuHbuM?r&C%(Zu636>-9Uw$y~jem>sRU^PZnZdxqbL
zHz;q#+3Tm2{;mG<K&#t-xNBF<uFnJ9j;*r*YSlN)`RlK~*;T|@K<JmL?o%8A=w|&5
z05!We&6{*Du-F0|9$Jbv*q-+M<srTHH`MIexa$76DI*~py(W&~0C{i{q+F1BLOV!E
z>#Y6y3@&BM?>i_$<2r3+6->&_5dT&nT2;GO7Zv>8c@>LLL2#>gpTr;EV*iKKJ$t?b
zYt=hI;o>j8)6?mz{9ir2NSS}jPWjcadiuQ=_~nClb!`s#h4pMOW$##$@Wh@y2lxCp
D5d-{u

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/xentry_key.gz b/tests/ubifs_repair-tests/images/xentry_key.gz
new file mode 100644
index 0000000000000000000000000000000000000000..d2ff24989fda6ee8b181dfa403403fac332cd19a
GIT binary patch
literal 5378
zcmcgwXH=6}w|0h4m=OUhsFaMNqErz9sSz6@AfQMnLM#-ikrG;fjM9|q009kzfJi4G
zVCW$#9VE2SLWvMVsEH6lLLhnX-23aU`TXwBdw%V;_F3oIYp-*j^Xvzd_}gy*a|v#H
zL_*#Cf&#*z-fm%gR%d>HV7U!+ts_*_lxr-~3;T84)V$Mle!tdzcef@k<{bJjHMMU2
z=vxln7hK;~7n(UJ^|rd7INfjGsZ$0jidjOYl14{aupb}>6&7j)N~KM+8>y^DR$y!W
z1BFy84xD)xqK+`LtkzSmv-alxDl#c6XVrpo+`s4NOIX*s35fhWXU**01p26j0O0>D
z$ux{1_VaDuu3Z7ZKTqwUrwWn(A=OKzt^ts*x><eD-24{}A-2-N5wa5&ZnyWMx@w%<
zY4m&pT2Y_hM4u$OH$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4bR;Q5}=n*EmvF8T%Mwy0N}n1kGi54H#OfR(a_~ek(K!JgP6q
zeAdDZ0GTs9O!sbR1&-sj>!mv&0a4=_e`73g>$_I!ti<W@X`i>*ly=WlS5Bt8LF2OP
zn1_{*-`b*b4v~qHLAGi!q3UIz>4PAR0_2n9fR!=Qb9s};Z~K~BQ1Aw{-jH&pm3=RD
z6?43Il2=TVNd;=I=8c*GWrA|rIv|`+fw1<)Bd&Su<3t}{U;o~l0!)r%k59`(iDjF+
zm-P~Oo!+}*((-66m5dSi+hibvIHl0Hd^Gqh`LxUyffLYIDC-#L?G!Ri!ZOf0<oEz6
z|F1-nII{=c!@oe;*;?D)h?&2w*iE@bGko@APOtV_qpslCS&){>2L<VziTcG>>pMtr
z-$r$<FpE(Wo+_iRuNjuVKC``|6I|!>@=#jc$jD4&e~vY2!{)L^gRV~>sf)6)VS|!Q
zsztEosutp~To+?|eNeXY>(rti6+TOfexv81F`qi++>orMk)wH1Z=0U<oF{B4F7>C2
z_yYm{f|jt3YUpPoa+x|is|ikly;)~fed57Z7GX}-N1&zaDhP!vy(p9rEc(9&u?PK~
z{9R-r?H``qpXJXPz&~gwZ^IDyC&{1~+yC_KN(=}7X%t?ehY9~_Vkxtr$h3UrJ$pp=
F{1@wnu+abj

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/xentry_nlen.gz b/tests/ubifs_repair-tests/images/xentry_nlen.gz
new file mode 100644
index 0000000000000000000000000000000000000000..96215b7663446b9b1934f56a08fa5a765dfde49d
GIT binary patch
literal 5386
zcmc&&XHb({x7MSGg>pP9D5z0U5fD%yAkC;KNEemfRHQ~i2{i$7{FI^yi1a2PNa(${
zNDUGoQj!1xA~o~~Aqfd2@8`KQcjnGHet+(dd-tzBYwg+VnYGre@_-@_9yFSM>$qoM
zfFsPuJJ25X!V$J-b@GsnAsfJMAZ28wD-GgmDh<b^p&yhFY4tqZtqgnpSV`i%Y{a!!
z_s7HqVozD8#`}I+h34IM=~n2u4>1_a12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8mYn}l7Dz7&mHM|Vo=!<Th
zcWrqYumXp(N^B}Z+>yg!gs!HXZxm9I(dnWXEHZ_u)6COWoSHp@CQh8hs&w*_)8yq_
z2UlZaD7)(;+Yh4YUW?(0=wU>RlV}OPg-qOjj_pnyc*x%N=2li6yTcIf_+H6uGn`Hi
zfxQdJT$PPqc`GC6P>v_v(@(ujIX%F#5p!7DeNl8PByYXGmYMizTd$NhzBwb_&*3ox
zxJ2FT-6yao+~%83LmjRyd`oFTzOZqs@e7!nJAS+j$>_?YMPQR+mig<jRNP65%K|Vg
zZ<l&QwUzh#N{+|=6^W0e!A}2>nb^rkTB;eqbKVTwKAF!dW5u?@-%$gg*pD*DGp2ov
zPa2p(lK;rW+m5jzNCdsGX=cSd!44#;^E+ie71&1?>Q5Hw{n~0kMeS1hV?Hw~Rlqe3
zJWUVGM8L)oci%^F^9g(=HL(`_dXqPI2~=}r-Ka?ydu@oeMm{{BI-}Qdf9L+p1naAo
zVqUnn@utGvn|WqWAbqM8&QmSf>AN9`3l7K*c|4kN7B8oEnbkhSaw;R2S5(OA-5)ac
zHz$D=@2K|c5asG6PvZu#<C~i%38087C~G=Lu>+5k%ea~mV|bzmJLH8!(2mRpHoOel
zYQ-q-h*`(i<bTcBb?be(y%R_p>cY`te!6Q#v`;#kdzi-^{xLu#j(G)X^`SiY7Et<7
z4|@8~5cJ!Rt<?9ii?)FON%ehqQy$*|WX}AZYO)cW_y_BkK;@zSR*>>FSis*%ja%~#
az~47MY5YG3zz2cAZx=l!Lig-Bu;<@2Ldw7Z

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/xentry_type.gz b/tests/ubifs_repair-tests/images/xentry_type.gz
new file mode 100644
index 0000000000000000000000000000000000000000..71ef8d9d66b102504bd02c76a271d1f8034ea24a
GIT binary patch
literal 5386
zcmcgwcU05cvi4k`D58|37!?6MD!oZ>Au2~v6i|8zM0yDw5`+Lz5joOwRZxM1hzOzA
zK&Xj@B1Srd-a7#T1Og-^zw3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ifs_repair-tests/images/xinode_flags.gz b/tests/ubifs_repair-tests/images/xinode_flags.gz
new file mode 100644
index 0000000000000000000000000000000000000000..83e2a10e270f67698d7cb5c3d5c8971a0789d30c
GIT binary patch
literal 5384
zcmc&&XHb({x5i^Z&r!gmfQk?+AXPdFBnk%+q$?$066p{iG(+eS5m2fPfdD~8K#Fvb
z9+jq{w}hG~ks2UULP$dLUcc|oo%!Y*@85g(uQhwE+3T5S?OA(23zWEj|0p%VO<;G3
z7s}7o4dL$N<PjvWJbmD{85`(Y3zt`vt1^9dKFybC3w>5&tolG94MBP=VyIS?zZdEu
zav?nCw5m&qv|ElW7w08{t30SWB>W7`q2>jlnOupTE;dU7-rq&jW<{*B!dJQ348`;=
z+Reyp9rCkoxb;n+lmx}8iM-EOw)PoWqg;>f7Wn15M|da91Agfe5P06C$^+Ihivaf6
ziFqi6z3bO;+ad#i@ULB0*m(fx*RFf(EDRSA-RS+kp6>DX)T(4!tS@z+W3g$`%XRzU
zw!5Xe5#c+x#x=sn!AGEQHz;90G(%zP8&)p?c`7}&q`St{tx5n=E9me^t;#u(`6N~X
zu6xkG3ip~{Y9`sS;1fCigLK%YV^Fzl<D-A=ee*!4+bv=#hH*^_D@SRnOgF8eGsu#Z
z|Am&9y3M(KKr1=I_$KqK4?}s*UgEf?yVU+ItD9nnOa#3Wvj%DrHnvr<j0>UWW>ep1
z3KR>(qdwegBziBa9R{6*lKL!LP7ODBlY8zGzIX84T0qTc<N;Cfbj)x6rsItr1pxlR
z=Lg8uOg{EiKE-P51rPXF-JWBjeodbMc#j(gm}LwBz(w`Gn<`XOc-U_%TBf11Y}*z^
zTZf-`ZA)t@w+u?57c?bR9;VnQil^@V6w;)T>b&%@YuAkSp#Vk!dnrURAj+tc<c}~V
zi__#jyTaNhC?^SUeMOs=8WNXo04I{W%PYuzf9WFXL;8N7;TLR&na^xA66pg`P&Luc
z%#t)$5hNCW@#MLY`$ubQ6I!ZGNZK8bwB)xWZ<Uen+;M6x3Rymra`Wb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W{9-+d#5`m>O
z-2Jl7omrcm;e=KvxDf7R0rlpFT9@FHRFMrTBAQJd8l-9#%C=f>*lk@_3gXN0um}I6
zTh!x{x7dJ5*WZV8cDwt5zs)MH%!cy+KB$xH-vIvOw11hFp?KhL{pcQXW9RP@@D>GP
Nt?2w(KwzK1e*t!Xu6F<c

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/xinode_key.gz b/tests/ubifs_repair-tests/images/xinode_key.gz
new file mode 100644
index 0000000000000000000000000000000000000000..ff0a04f0df22bc0817e3cca97b53824e3796ec19
GIT binary patch
literal 5383
zcmcgwXH?VK_I1YhP)8BV2uht9RHTV09YX|cC{5`#qJ&5b0)`ffigYngP>>EHJrGJl
zhbUF4(h>=Th=BwM5Fms!lHY&c|I@5_zOV0oI_vIx*4^uzyY{;KD5UJ)??y?6?%5mW
z4G-{yLVTg&dsfK@TrGG&|0YsZU8UZ<KGT1|-YFexcGBeG=AiVkyJIi>yp0K`t`5xI
zOC0(-{vLfC3b`bn=B4&PW@<DI!KV}lBiI6&-F_ZN#(lJ(s>g|3=OEVwxlHxUeyR=p
zr5j@qiYZstLH0^|EjvH_4VhAGraPXz=f~><g?1eP{}|f?t+560yHR{VA-<<I6A}Gi
zjv0w<1ABjrS???X`+f`+t_sPbnBK_aExS{v29l6SsK-pGF-^s0pyF}{`GUNv#EiVI
zUC6L~Bfdth=^Z+zS<P0`i-VWHrt^BRYZB_*cQLB~McS)Af6D3AG(Yi~xP}5>-_iU|
z%v|Hk`;SXI{jTP0418b8B=YV(cXo%hT&Rh@EimaO({z#pm-+QF%JVqe{-1tK&RWvQ
z8~|pncfPBLcvQp83|31$q%|QS7G9y8B6cPg+iS5z!l<dvb?r!k%g(}s0w*LV4ubDp
zaa+{hA)Zi>btBAKgEYu>NY1uxL0-zfPkf^=`s6Vc6&1!m{{P0C7&P#oMSBwS?5+?n
zx!uvRDklI?XUR8J8M{AbxF_<^EjBPnDFXnHo9MRtok{Hr{~!fqZIM{jg6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fBZ8
zv$h8Bdf9kEOO#6;s1!SKq+WkqPa<;n8#=3qoNjdJE^66MPl9E+?(!($VHsdFxUzYj
zs!`Ptjam#a&<Texw*?aeNVDylDmM+RLLG?O4JL+FH;m3VD_wSQMIqiy6_<WdfDz{u
zA)|-E%$CTyNKm6~k^Eqv2D3v0D|K4PUWy6`6=^n}R?s}F&z{1XZqix#(Ay5P3V)VM
zAT_L<D*QzRlx?obtp!uLVot!E3OWXc3}CdUaR;g)y@KX0cGV6=^DlDo%|~Zk0948S
zeZc1`J`4O^R;K8pn7^d{J1jTi{C!4sh1~-D-N;pr3W2|6T1NptLtoo%@7W`^=l=l9
CEWC;U

literal 0
HcmV?d00001

diff --git a/tests/ubifs_repair-tests/images/xinode_mode.gz b/tests/ubifs_repair-tests/images/xinode_mode.gz
new file mode 100644
index 0000000000000000000000000000000000000000..c86f69c7e3a716864035d1763ae533079727b8b2
GIT binary patch
literal 5386
zcmcgwXIRt8*4N#;pdw-gMFA@ak)re(%ep94h0sZ)Mp}?AB}4^8L5PY-C!iDqgx-Xd
zrAhB4QnP>%FeDK|2qEQvz3->@?)84X^I@LzJZEOkdCtu5%sD@~#65c&DG46CetqPH
z@OSrs`Tdx7t<COrGUo!F>yaR3rE0U33#ooRHufpCw~t?cw~(fJ{`cXRv9+gL_n-B^
zwS0m5dfls+?;(0h$9i6JJ2@_K#AS!_At;2+JIU|la!x`AI~R30Q4CHbgO|-zPU~E>
zLgqA&rSwAYS@|X>DECbfhOTaj7^fhLq<-D?)A5*uQxyO|RqfjKw)u(x*a%w%P)83_
z@6K^||9su{!6886=c=pR4}jdyRgX6~VLad%tN-gp8vNsFhD>T4og(5;VusDzunQdx
z#vAw=w`xp=L{9ELVvq2ceEiV<<E6fNlwpGJ>9ja(Z>^cf6|h`gyhE#cwQFL?q2FjQ
zgUz7o%o1UlxlG5(CFEq+#5|;9Shburf2$5}5$NJXkW7wy7I}$&bn(ijhqhI#PigXh
z2}_;<9wP*_lcH{0vHx<ys4m-`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FscfbHPng*j3zo??=C|>
zf{GrYd>W1qOOjaf6^?Qfsi;ud2Yw@U4+q~r5~3O_+2i_cO9N`@_-Hj1Vy@F97aZh0
z`=)t;Q=v#Qve<u`*sBT5svoe(JlL~J>{~{Cr6{94*&8WmLb|!L`dXUK_<UtQ#OiY%
zm$in6B<15(k&3_5pElPZsxR-~BqANF3<_%Rfvb&1bU4xczY1RD&twocU!&I{UnEA8
znYjV}7mG<45ALIy^|TIqLg$9IOeS89Gm8b;RCqZYyKtTkH#P3mOu4SxYdojYsBj82
z(7DmGao1|)MU5Ldzd|7%69#RvGm`TueT5EhqlV2&^{BtejS40-7?P6uyB+u6wusU!
z*C&FR+1g<(g7xiv0fP66g;lT?5=xpfH>0JQT!H2?OIrE<zBKO)o5QeA+|oxfwmPVB
zA^88Z5KjFfJU*&!QS{%LiN~c+sKDRwowsA~A2i-Lm5ciKox4674gQ_Dy2=h0{+;D3
QVZvU0uJPWrOJvtS0f#f8%m4rY

literal 0
HcmV?d00001

--
2.13.6


2023-12-28 01:36:14

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 10/11] tests: ubifs_repair: Add run_all script

Add run_all script to run all UBIFS repair testcases.

Signed-off-by: Zhihao Cheng <[email protected]>
---
.gitignore | 1 +
configure.ac | 1 +
tests/ubifs_repair-tests/Makemodule.am | 1 +
.../ubifs_repair-tests/ubifs_repair_run_all.sh.in | 59 ++++++++++++++++++++++
4 files changed, 62 insertions(+)
create mode 100755 tests/ubifs_repair-tests/ubifs_repair_run_all.sh.in

diff --git a/.gitignore b/.gitignore
index 89bca58..0d9be34 100644
--- a/.gitignore
+++ b/.gitignore
@@ -113,6 +113,7 @@ tests/fs-tests/stress/fs_stress01.sh
tests/ubi-tests/runubitests.sh
tests/ubi-tests/ubi-stress-test.sh
tests/ubifs_repair-tests/lib/common.sh
+tests/ubifs_repair-tests/ubifs_repair_run_all.sh
tests/ubifs_repair-tests/tests/authentication_refuse.sh
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
diff --git a/configure.ac b/configure.ac
index 1c1c95b..94b60c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -356,6 +356,7 @@ AC_CONFIG_FILES([tests/fs-tests/fs_help_all.sh
tests/ubi-tests/runubitests.sh
tests/ubi-tests/ubi-stress-test.sh
tests/ubifs_repair-tests/lib/common.sh
+ tests/ubifs_repair-tests/ubifs_repair_run_all.sh
tests/ubifs_repair-tests/tests/authentication_refuse.sh
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh
diff --git a/tests/ubifs_repair-tests/Makemodule.am b/tests/ubifs_repair-tests/Makemodule.am
index f728823..6030a1f 100644
--- a/tests/ubifs_repair-tests/Makemodule.am
+++ b/tests/ubifs_repair-tests/Makemodule.am
@@ -1,5 +1,6 @@
test_SCRIPTS += \
tests/ubifs_repair-tests/lib/common.sh \
+ tests/ubifs_repair-tests/ubifs_repair_run_all.sh \
tests/ubifs_repair-tests/tests/authentication_refuse.sh \
tests/ubifs_repair-tests/tests/cycle_mount_repair_check.sh \
tests/ubifs_repair-tests/tests/powercut_repair_mount.sh \
diff --git a/tests/ubifs_repair-tests/ubifs_repair_run_all.sh.in b/tests/ubifs_repair-tests/ubifs_repair_run_all.sh.in
new file mode 100755
index 0000000..bb95369
--- /dev/null
+++ b/tests/ubifs_repair-tests/ubifs_repair_run_all.sh.in
@@ -0,0 +1,59 @@
+#!/bin/sh
+# Copyright (c), 2023-2024, Huawei Technologies Co, Ltd.
+# Author: Zhihao Cheng <[email protected]>
+#
+# Test Description:
+# Run all testcases under 'tests' directory
+
+function print_line()
+{
+ echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
+ echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
+}
+
+TESTBINDIR=@TESTBINDIR@
+
+print_line
+$TESTBINDIR/authentication_refuse.sh
+if [[ $? != 0 ]]; then
+ echo "authentication_refuse failed"
+ exit 1
+fi
+print_line
+$TESTBINDIR/powercut_repair_mount.sh
+if [[ $? != 0 ]]; then
+ echo "powercut_repair_mount failed"
+ exit 1
+fi
+print_line
+$TESTBINDIR/cycle_corrupted_repair_fault_inject.sh
+if [[ $? != 0 ]]; then
+ echo "cycle_corrupted_repair_fault_inject failed"
+ exit 1
+fi
+print_line
+$TESTBINDIR/repair_bad_image.sh
+if [[ $? != 0 ]]; then
+ echo "repair_bad_image failed"
+ exit 1
+fi
+print_line
+$TESTBINDIR/random_corrupted_repair.sh
+if [[ $? != 0 ]]; then
+ echo "random_corrupted_repair failed"
+ exit 1
+fi
+print_line
+$TESTBINDIR/cycle_powercut_mount_repair.sh
+if [[ $? != 0 ]]; then
+ echo "cycle_powercut_mount_repair failed"
+ exit 1
+fi
+print_line
+$TESTBINDIR/cycle_mount_repair_check.sh
+if [[ $? != 0 ]]; then
+ echo "cycle_mount_repair_check failed"
+ exit 1
+fi
+
+exit 0
--
2.13.6


2023-12-28 01:36:27

by Zhihao Cheng

[permalink] [raw]
Subject: [PATCH mtd-utils 11/11] tests: ubifs_repair: Add README

Add document for ubifs_repair testcases, explain all testcases and how
to run them.

Signed-off-by: Zhihao Cheng <[email protected]>
---
tests/ubifs_repair-tests/README.txt | 233 ++++++++++++++++++++++++++++++++++++
1 file changed, 233 insertions(+)
create mode 100644 tests/ubifs_repair-tests/README.txt

diff --git a/tests/ubifs_repair-tests/README.txt b/tests/ubifs_repair-tests/README.txt
new file mode 100644
index 0000000..cb1ce98
--- /dev/null
+++ b/tests/ubifs_repair-tests/README.txt
@@ -0,0 +1,233 @@
+
+ ubifs_repair tests
+ ==================
+
+ There are seven testcases for ubifs_repair on encryption/non-encryption
+ situations:
+ 1) authentication_refuse: Currently authenticated UBIFS image is not
+ supported for repairing, check whether ubifs_repair can refuse
+ authenticated UBIFS image.
+ 2) random_corrupted_repair: Inject random corruption on UBIFS image
+ by writting random data on kinds of mtd devices (eg. nand, nor),
+ check the consistency of UBIFS after repairing.
+ This testcase simulate random bad UBIFS image caused by hardware
+ exceptions(eg. ecc uncorrectable, unwritten), and makes sure that
+ ubifs_repair could make UBIFS be consistent after repairing UBIFS
+ image.
+ 3) cycle_corrupted_repair_fault_inject: Inject memory/io fault while
+ repairing corrupted UBIFS images.
+ This testcase mainly checks whether ubifs_repair has problems (eg.
+ memleak, UAF, null-ptr-def, etc.) in random error paths. Besides,
+ it provides a similar way to simulate powercut during repairing,
+ and checks whether ubifs_repair can fix an UBIFS image after many
+ repairing rounds interrupted by kinds of errors.
+ 4) cycle_powercut_mount_repair: Inject powercut while doing fsstress
+ on mounted UBIFS, check the consistency of UBIFS after repairing.
+ This testscase mainly makes sure that ubifs_repair can make UBIFS
+ image be consistent in common stress cases and powercut cases.
+ 5) powercut_repair_mount: Inject powercut while doing fsstress on
+ mounted UBIFS for kinds of flashes (eg. nand, nor).
+ This testcase mainly makes sure that ubifs_repair can make UBIFS
+ image be consistent on different flashes (eg. nand, nor). Because
+ the min_io_size of nor flash is 1, the UBIFS image on nor flash
+ will be different from nand flash after doing powercut, so we need
+ make sure ubifs_repair can handle these two types of flash.
+ 6) cycle_mount_repair_check: Do fsstress and repair ubifs image, make
+ sure all files(and their data) are not lost after repairing.
+ This testcase mainly checks whether ubifs_repair could corrupt
+ filesystem content in common case.
+ 7) repair_bad_image: For kinds of inconsistent UBIFS images(which
+ can simulate corruptions caused by some potentional UBIFS bug), check
+ repairing result.
+ This testcase mainly checks whether the behavior is in expected after
+ repairing specific inconsistent UBIFS image. There is no debugfs tools
+ (for example: debugfs[ext4], xfs_db) for UBIFS, so no way to inject
+ precise corruption into UBIFS image, we have to prepare inconsistent
+ UBIFS images in advance like e2fsprogs[1] does. (Goto [2] to see how to
+ generate inconsistent UBIFS images). Here's a descriptons of the various
+ test images:
+
+ =========================================================================
+ image | Description | expectancy
+ -------------------------------------------------------------------------
+ good | good image contains | repair success, fs content is
+ | kinds of files. | not changed.
+ -------------------------------------------------------------------------
+ sb_fanout | invalid fanout in | repair failed.
+ | superblock. |
+ -------------------------------------------------------------------------
+ sb_fmt_version | invalid fmt_version | repair failed.
+ | in superblock. |
+ -------------------------------------------------------------------------
+ sb_leb_size | invalid leb_size in | repair failed.
+ | superblock. |
+ -------------------------------------------------------------------------
+ sb_log_lebs | invalid log lebs in | repair failed.
+ | superblock. |
+ -------------------------------------------------------------------------
+ sb_min_io_size | invalid min_io_size | repair failed.
+ | in superblock. |
+ -------------------------------------------------------------------------
+ master_highest_inum | invalid highest_inum| repair success, fs content is
+ | in master nodes. | not changed.
+ -------------------------------------------------------------------------
+ master_lpt | bad lpt pos in | repair success, fs content is
+ | master nodes. | not changed.
+ -------------------------------------------------------------------------
+ master_tnc | bad tnc pos in | repair success, fs content is
+ | master nodes. | not changed.
+ -------------------------------------------------------------------------
+ master_total_dead | bad total_dead in | repair success, fs content is
+ | master nodes. | not changed.
+ -------------------------------------------------------------------------
+ master_total_dirty | bad total_dirty in | repair success, fs content is
+ | master nodes. | not changed.
+ -------------------------------------------------------------------------
+ master_total_free | bad total_free in | repair success, fs content is
+ | master nodes. | not changed.
+ -------------------------------------------------------------------------
+ log | corrupted log area. | repair success, fs content is
+ | | not changed.
+ -------------------------------------------------------------------------
+ lpt_dirty | bad dirty in pnode. | repair success, fs content is
+ | | not changed.
+ -------------------------------------------------------------------------
+ lpt_flags | bad flags in pnode | repair success, fs content is
+ | (eg. index). | not changed.
+ -------------------------------------------------------------------------
+ lpt_free | bad free in pnode. | repair success, fs content is
+ | | not changed.
+ -------------------------------------------------------------------------
+ lpt_pos | bad pos in nnode. | repair success, fs content is
+ | | not changed.
+ -------------------------------------------------------------------------
+ tnc_lv0_key | bad key in lv0 | repair success, fs content is
+ | znode. | not changed.
+ -------------------------------------------------------------------------
+ tnc_lv0_len | bad len in lv0 | repair success, fs content is
+ | znode. | not changed.
+ -------------------------------------------------------------------------
+ tnc_lv0_pos | bad pos in lv0 | repair success, fs content is
+ | znode. | not changed.
+ -------------------------------------------------------------------------
+ tnc_noleaf_key | bad key in non-leaf | repair success, fs content is
+ | znode. | not changed.
+ -------------------------------------------------------------------------
+ tnc_noleaf_len | bad len in non-leaf | repair success, fs content is
+ | znode. | not changed.
+ -------------------------------------------------------------------------
+ tnc_noleaf_pos | bad pos in non-leaf | repair success, fs content is
+ | znode. | not changed.
+ -------------------------------------------------------------------------
+ inode_data | bad data node. | repair success, file content
+ | | is changed, other files are
+ | | not changed.
+ -------------------------------------------------------------------------
+ inode_mode | bad inode mode for | repair success, soft link
+ | solf link file. | file is dropped, other files
+ | | are not changed.
+ -------------------------------------------------------------------------
+ inode_nlink | wrong nlink for | repair success, nlink is
+ | file. | corrected, fs content is not
+ | | changed.
+ -------------------------------------------------------------------------
+ inode_size | wrong inode size | repair success, inode size is
+ | for file. | corrected, fs content is not
+ | | changed.
+ -------------------------------------------------------------------------
+ inode_xcnt | wrong inode | repair success, xattr_cnt is
+ | xattr_cnt for file. | corrected, fs content is not
+ | | changed.
+ -------------------------------------------------------------------------
+ soft_link_data_len | bad inode data_len | repair success, soft link
+ | for solt link file. | file is dropped, other files
+ | | are not changed.
+ -------------------------------------------------------------------------
+ dentry_key | bad dentry key for | repair success, dentry is
+ | file. | removed, other files are
+ | | not changed.
+ -------------------------------------------------------------------------
+ dentry_nlen | inconsistent nlen | repair success, dentry is
+ | and name in dentry | removed, other files are
+ | for file. | not changed.
+ -------------------------------------------------------------------------
+ dentry_type | inconsistent type | repair success, dentry is
+ | between dentry and | removed, other files are
+ | inode for file. | not changed.
+ -------------------------------------------------------------------------
+ xinode_flags | lost UBIFS_XATTR_FL | repair success, xattr is
+ | in xattr inode | removed, other files are
+ | flags for file. | not changed.
+ -------------------------------------------------------------------------
+ xinode_key | bad xattr inode key | repair success, xattr is
+ | for file. | removed, other files are
+ | | not changed.
+ -------------------------------------------------------------------------
+ xinode_mode | bad xattr inode | repair success, xattr is
+ | mode for file. | removed, other files are
+ | | not changed.
+ -------------------------------------------------------------------------
+ xentry_key | bad xattr entry key | repair success, xattr is
+ | for file. | removed, other files are
+ | | not changed.
+ -------------------------------------------------------------------------
+ xentry_nlen | inconsistent nlen | repair success, xattr is
+ | and name in xattr | removed, other files are
+ | entry for file. | not changed.
+ -------------------------------------------------------------------------
+ xentry_type | inconsistent type | repair success, xattr is
+ | between xattr entry | removed, other files are
+ | and xattr inode for | not changed.
+ | file. |
+ -------------------------------------------------------------------------
+ dir_lost | bad dentry for dir. | repair success, dir and files
+ | | under dir are removed, other
+ | | files are not changed.
+ -------------------------------------------------------------------------
+ root_dir | bad '/'. | repair success, create new
+ | | root dir('/').
+ =========================================================================
+
+ Dependence
+ ----------
+ kernel configs:
+ CONFIG_MTD_NAND_NANDSIM=m
+ CONFIG_MTD_MTDRAM=m
+ CONFIG_MTD_UBI=m
+ CONFIG_MTD_UBI_FASTMAP=y
+ CONFIG_UBIFS_FS=m
+ CONFIG_UBIFS_FS_XATTR=y
+ CONFIG_UBIFS_FS_AUTHENTICATION=y
+ CONFIG_FS_ENCRYPTION=y
+ CONFIG_FAILSLAB=y
+ CONFIG_FAIL_PAGE_ALLOC=y
+
+ CONFIG_DEBUG_KMEMLEAK=y // optional
+
+ tools:
+ fsstress [3][4]
+ keyctl [5]
+ fscryptctl [6]
+ setfattr/getfattr [7]
+
+ Running
+ -------
+
+ Please build and install mtd-utils first.
+ Run single case:
+ cd $INSTALL_DIR/libexec/mtd-utils
+ ./powercut_repair_mount.sh
+ ./random_corrupted_repair.sh
+ ./cycle_mount_repair_check.sh
+ Run all cases: sh $INSTALL_DIR/libexec/mtd-utils/ubifs_repair_run_all.sh
+
+ References
+ ----------
+
+ [1] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/tests/README
+ [2] https://bugzilla.kernel.org/show_bug.cgi?id=218327
+ [3] https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/ltp/fsstress.c
+ [4] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/fs/fsstress/fsstress.c
+ [5] https://github.com/torvalds/linux/blob/master/security/keys/keyctl.c
+ [6] https://github.com/google/fscryptctl
+ [7] https://github.com/philips/attr/tree/master
--
2.13.6


2023-12-29 06:36:04

by Zhihao Cheng

[permalink] [raw]
Subject: Re: [PATCH mtd-utils 08/11] tests: ubifs_repair: Add corrupted images

在 2023/12/28 9:36, Zhihao Cheng 写道:
> diff --git a/tests/ubifs_repair-tests/images/xinode_mode.gz b/tests/ubifs_repair-tests/images/xinode_mode.gz
> new file mode 100644
> index 0000000000000000000000000000000000000000..c86f69c7e3a716864035d1763ae533079727b8b2
> GIT binary patch
> literal 5386
> zcmcgwXIRt8*4N#;pdw-gMFA@ak)re(%ep94h0sZ)Mp}?AB}4^8L5PY-C!iDqgx-Xd
> zrAhB4QnP>%FeDK|2qEQvz3->@?)84X^I@LzJZEOkdCtu5%sD@~#65c&DG46CetqPH
> z@OSrs`Tdx7t<COrGUo!F>yaR3rE0U33#ooRHufpCw~t?cw~(fJ{`cXRv9+gL_n-B^
> zwS0m5dfls+?;(0h$9i6JJ2@_K#AS!_At;2+JIU|la!x`AI~R30Q4CHbgO|-zPU~E>
> zLgqA&rSwAYS@|X>DECbfhOTaj7^fhLq<-D?)A5*uQxyO|RqfjKw)u(x*a%w%P)83_
> z@6K^||9su{!6886=c=pR4}jdyRgX6~VLad%tN-gp8vNsFhD>T4og(5;VusDzunQdx
> z#vAw=w`xp=L{9ELVvq2ceEiV<<E6fNlwpGJ>9ja(Z>^cf6|h`gyhE#cwQFL?q2FjQ
> zgUz7o%o1UlxlG5(CFEq+#5|;9Shburf2$5}5$NJXkW7wy7I}$&bn(ijhqhI#PigXh
> z2}_;<9wP*_lcH{0vHx<ys4m-`Jn_Ku)c(zTR+8c-qF#wvLv=8SO?4a{6mDTY^L3#}
> zxkxJd&&N$YKBv?U$(?eZ7`S7o+V;t@;iWakIZ?D{#~_L}c34S8h53*F3&*VrJOKQM
> z@yDpAKO%nJl<;9qnF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4+q~r5~3O_+2i_cO9N`@_-Hj1Vy@F97aZh0
> z`=)t;Q=v#Qve<u`*sBT5svoe(JlL~J>{~{Cr6{94*&8WmLb|!L`dXUK_<UtQ#OiY%
> zm$in6B<15(k&3_5pElPZsxR-~BqANF3<_%Rfvb&1bU4xczY1RD&twocU!&I{UnEA8
> znYjV}7mG<45ALIy^|TIqLg$9IOeS89Gm8b;RCqZYyKtTkH#P3mOu4SxYdojYsBj82
> z(7DmGao1|)MU5Ldzd|7%69#RvGm`TueT5EhqlV2&^{BtejS40-7?P6uyB+u6wusU!
> z*C&FR+1g<(g7xiv0fP66g;lT?5=xpfH>0JQT!H2?OIrE<zBKO)o5QeA+|oxfwmPVB
> zA^88Z5KjFfJU*&!QS{%LiN~c+sKDRwowsA~A2i-Lm5ciKox4674gQ_Dy2=h0{+;D3
> QVZvU0uJPWrOJvtS0f#f8%m4rY
>
> literal 0
> HcmV?d00001
>
Hi, I find that  xinode_mode.gz is not displayed in patchwork
https://patchwork.ozlabs.org/project/linux-mtd/patch/[email protected]/,
maybe it is a bug in patchwork. You can download it from this mail or
https://lore.kernel.org/linux-mtd/[email protected]/