From 464df1d5e5ab1322e2dd0a7796939fff1aeefa9a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:49:25 +0200 Subject: Adding upstream version 1.47.0. Signed-off-by: Daniel Baumann --- tests/f_uninit_cat/expect | Bin 0 -> 3623 bytes tests/f_uninit_cat/image.gz | Bin 0 -> 1553 bytes tests/f_uninit_cat/name | 1 + tests/f_uninit_cat/script | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 tests/f_uninit_cat/expect create mode 100644 tests/f_uninit_cat/image.gz create mode 100644 tests/f_uninit_cat/name create mode 100755 tests/f_uninit_cat/script (limited to 'tests/f_uninit_cat') diff --git a/tests/f_uninit_cat/expect b/tests/f_uninit_cat/expect new file mode 100644 index 0000000..0c0a5cf Binary files /dev/null and b/tests/f_uninit_cat/expect differ diff --git a/tests/f_uninit_cat/image.gz b/tests/f_uninit_cat/image.gz new file mode 100644 index 0000000..d2ae66c Binary files /dev/null and b/tests/f_uninit_cat/image.gz differ diff --git a/tests/f_uninit_cat/name b/tests/f_uninit_cat/name new file mode 100644 index 0000000..f6b5674 --- /dev/null +++ b/tests/f_uninit_cat/name @@ -0,0 +1 @@ +cat a file with uninit blocks diff --git a/tests/f_uninit_cat/script b/tests/f_uninit_cat/script new file mode 100755 index 0000000..31a1988 --- /dev/null +++ b/tests/f_uninit_cat/script @@ -0,0 +1,36 @@ +#!/bin/bash + +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi +FSCK_OPT=-fy +IMAGE=$test_dir/image.gz + +gzip -d < $IMAGE > $TMPFILE +#e2label $TMPFILE test_filesys + +# Run fsck to fix things? +EXP=$test_dir/expect +OUT=$test_name.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 +echo "Exit status is $?" >> $OUT.new + +echo "debugfs cat uninit file" >> $OUT.new +echo "ex /a" > $TMPFILE.cmd +echo "cat /a" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +echo >> $OUT.new +sed -f $cmd_dir/filter.sed < $OUT.new > $OUT +rm -f $OUT.new $TMPFILE $TMPFILE.cmd + +# Figure out what happened +if cmp -s $EXP $OUT; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP $OUT >> $test_name.failed +fi +unset EXP OUT FSCK_OPT IMAGE -- cgit v1.2.3