summaryrefslogtreecommitdiffstats
path: root/tests/ts/minix
diff options
context:
space:
mode:
authorRuediger Meier2016-03-02 20:14:26 +0100
committerRuediger Meier2016-03-03 09:20:10 +0100
commit84e324ae657ac2edeb9c76c3afff47dcd68f7cef (patch)
tree8ee4cfa3fdb084333b2fe47e0cfc905f919cb6f4 /tests/ts/minix
parenttests: minix, use hexdump instead of md5sum (diff)
downloadkernel-qcow2-util-linux-84e324ae657ac2edeb9c76c3afff47dcd68f7cef.tar.gz
kernel-qcow2-util-linux-84e324ae657ac2edeb9c76c3afff47dcd68f7cef.tar.xz
kernel-qcow2-util-linux-84e324ae657ac2edeb9c76c3afff47dcd68f7cef.zip
tests: minix, some corrections and cleanup
- move generic "check_minix_fs_type" tests to the top - add some todos/notes about potential issues - add "real" badblocks test (-l) - don't check sed's but fsck's return value - to see debian bug 773892 we would need "-f" - add some more hexdumps CC: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/minix')
-rwxr-xr-xtests/ts/minix/fsck-images29
1 files changed, 18 insertions, 11 deletions
diff --git a/tests/ts/minix/fsck-images b/tests/ts/minix/fsck-images
index 22486028b..4cde57e88 100755
--- a/tests/ts/minix/fsck-images
+++ b/tests/ts/minix/fsck-images
@@ -19,6 +19,7 @@ TS_DESC="fsck images"
ts_init "$*"
# inode contains UID and GID, use always UID=0 to get the same checksum
+# TODO any mkfs should use UID=0 per default (custom uid optionally) like mk2fs
ts_skip_nonroot
ts_check_test_command "$TS_CMD_FSCKMINIX"
@@ -46,28 +47,34 @@ check_minix_fs_type 'v2c14' '-2 -n 14'
check_minix_fs_type 'v2c30' '-2 -n 30'
check_minix_fs_type 'v3c60' '-3 -n 60'
+bad="$TS_OUTDIR/${TS_TESTNAME}.badlist"
+# TODO seems that mkfs produces non-sense if badblocks are greater than device.
+echo -e "8\n9" > $bad
+
+# NOTE, -c with -l ignores -l.
+check_minix_fs_type 'check-blocks' "-l $bad -c"
+check_minix_fs_type 'badblocks' "-l $bad"
+
+rm -f $bad
+
+# NOTE this seems odd: a 2nd fsck run would again modify the FS
ts_init_subtest "auto-fix"
img=${TS_OUTPUT}.img
cp "$TS_SELF/broken-root" $img
-"$TS_CMD_FSCKMINIX" -sav $img |
- sed 's/Filesystem on .* is dirty/Filesystem auto-fix is dirty/' > $TS_OUTPUT 2>&1
-echo $? >> $TS_OUTPUT
+$TS_CMD_FSCKMINIX -sav $img >> $TS_OUTPUT 2>&1
+echo "fsck reports changed and uncorrected: $?" >> $TS_OUTPUT
$TS_CMD_HEXDUMP -C $img >> $TS_OUTPUT 2>&1
+sed -i 's/Filesystem on .* is dirty/Filesystem auto-fix is dirty/' $TS_OUTPUT
ts_finalize_subtest
ts_init_subtest "bug.773892"
-"$TS_CMD_FSCKMINIX" "$TS_SELF/debian.bug.773892" > $TS_OUTPUT 2>&1
-echo $? >> $TS_OUTPUT
+"$TS_CMD_FSCKMINIX" -f "$TS_SELF/debian.bug.773892" >>$TS_OUTPUT 2>&1 >/dev/null
+echo "fsck reports uncorrected: $?" >> $TS_OUTPUT
ts_finalize_subtest
ts_init_subtest "broken-root"
"$TS_CMD_FSCKMINIX" "$TS_SELF/broken-root" > $TS_OUTPUT 2>&1
-echo $? >> $TS_OUTPUT
+echo "fsck reports uncorrected: $?" >> $TS_OUTPUT
ts_finalize_subtest
-img="$TS_OUTDIR/${TS_TESTNAME}.badlist"
-echo "42" > $img
-check_minix_fs_type 'check-blocks' "-l $img -c"
-rm -f $img
-
ts_finalize