[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171116135546.9991-4-artem.blagodarenko@gmail.com>
Date: Thu, 16 Nov 2017 16:55:45 +0300
From: Artem Blagodarenko <artem.blagodarenko@...il.com>
To: linux-ext4@...r.kernel.org
Cc: adilger.kernel@...ger.ca,
Artem Blagodarenko <artem.blagodarenko@...gate.com>
Subject: [PATCH v2 3/4] tests: add test for e2image -b option
From: Artem Blagodarenko <artem.blagodarenko@...gate.com>
The test makes raw image from partition with broken super block
and executes e2fsck.
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@...il.com>
---
tests/i_zero_super/expect | 22 ++++++++++++++++++++++
tests/i_zero_super/image.gz | Bin 0 -> 13262 bytes
tests/i_zero_super/script | 33 +++++++++++++++++++++++++++++++++
3 files changed, 55 insertions(+)
diff --git a/tests/i_zero_super/expect b/tests/i_zero_super/expect
new file mode 100644
index 00000000..863d6920
--- /dev/null
+++ b/tests/i_zero_super/expect
@@ -0,0 +1,22 @@
+test.img was not cleanly unmounted, check forced.
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+Free blocks count wrong for group #0 (7987, counted=7982).
+Fix? no
+
+Free blocks count wrong (11602, counted=11597).
+Fix? no
+
+Free inodes count wrong for group #0 (1493, counted=1488).
+Fix? no
+
+Free inodes count wrong (2997, counted=2992).
+Fix? no
+
+
+test.img: ********** WARNING: Filesystem still has errors **********
+
+test.img: 11/3008 files (0.0% non-contiguous), 398/12000 blocks
diff --git a/tests/i_zero_super/image.gz b/tests/i_zero_super/image.gz
new file mode 100644
index 0000000000000000000000000000000000000000..eea9140194f4dd9ec9dc8bb7b9e2215b950587d2
GIT binary patch
literal 13262
zcmeI&{WsHl902f@...#ASFE<IL%5VllFHLfbsepcr#yxVS=!QEX3V<Xij3TH)g@2m
zDS0T_=4nglT7;E{xfz>0G_ld9Vc5R+bpL^V>zwZ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@...kA3j_q<0a%gT$(DtpQ;?ZCRc%)YpelMq?#?(f$b
z_UamTFN+X&iEQDYQcs_9B*mswP5Tz!>I$Qi8V+~~sMW&Avh1qk{jsdUms4q%_I~j9
zAP1wBH!x%p{*lPf%!OjFcUM;S-X3L~(Ph>1KAIhBU*6R=9GDzLN>@M4QqZpW;86in
zU6u2kydgWZ5!3%Mj+USKnvbny#tWU>-s*8m*m3AEb(yr<){ZABVq)XGI#2cz42~T&
zGiMA2h%d5h8S#Z$(EIzA$Y}eQPcMd3koG%AZ~YY0O4M39@<xLdrBh?hKWLtF{hBCP
zKSKVfKI(kvuk_4HnqI|OAvLr|+>qm%pxYt5T=-)((!SH_-N)wOT5EJu-k$_?OS4By
z`-cNru4=m6(i&s&<}6`1-*Pu6zm4e05s8Xx>Q+>QMg+NP$urt|PT#~`t~3AhF_nSY
zvBHEWF`>oD!xz}9ttUu?ntrBkM$M-%!q|)=)_Y)mo((>q^l>hC-8VW!K-)k72mk>f
z00e*l5C8%|00;m9AOHk_01yBIKmZ5;0U!VbfB+Bx0zd!=00AKIbp=K!;yw%P>JwUP
zN8Z$BYH3yUJBnz@...acMGN|;r>&TdDbac%hz*WE#2d70bXsDzshu_)m6AW|wjzkT
zcBy>bZol}OTTD6WMU0ljJ&icy#4Kr$Hr@9)dvDXkMN4wZxwi50$>mD+G8Nh><%Z8z
z-r_hsyIZ&rI57ThUe6tC!j|bV27G0o?8J#?hL{KkW#FoUb?d|b>Kwkeb>zx!KDuCK
v`J3J9`63;-00e*l5C8%|00;m9AOHk_01yBI{~LklvK5${_ikI*<wn@...-lK
literal 0
HcmV?d00001
diff --git a/tests/i_zero_super/script b/tests/i_zero_super/script
new file mode 100644
index 00000000..bb7fc4d1
--- /dev/null
+++ b/tests/i_zero_super/script
@@ -0,0 +1,33 @@
+if test -x $E2IMAGE_EXE; then
+
+IMAGE=$test_dir/image.gz
+FSCK_OPT=-fy
+OUT=$test_name.log
+EXP=$test_dir/expect
+
+> $OUT
+
+gzip -d < $IMAGE > $TMPFILE
+
+$E2IMAGE_EXE -r -b 8193 -B 1024 $TMPFILE $TMPFILE.raw
+$FSCK -n -b 8193 $TMPFILE.raw |\
+ sed -f $cmd_dir/filter.sed -e "s;$TMPFILE.raw;test.img;" > $OUT
+rm -f $TMPFILE $TMPFILE.raw $OUT.new
+
+cmp -s $OUT $EXP
+status=$?
+
+if [ "$status" = 0 ] ; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ echo "$test_name: $test_description: failed"
+ diff $EXP $OUT > $test_name.failed
+ rm -f $test_name.tmp
+fi
+
+unset IMAGE FSCK_OPT OUT EXP
+
+else
+ echo "$test_name: $test_description: skipped"
+fi
--
2.13.6 (Apple Git-96)
Powered by blists - more mailing lists