From patchwork Mon Jun 26 16:58:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Blagodarenko X-Patchwork-Id: 783933 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3x23FG1GtQz9s78 for ; Tue, 4 Jul 2017 22:28:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CnAWnRjA"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752303AbdGDM2R (ORCPT ); Tue, 4 Jul 2017 08:28:17 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:35325 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752284AbdGDM2P (ORCPT ); Tue, 4 Jul 2017 08:28:15 -0400 Received: by mail-lf0-f68.google.com with SMTP id z78so5355457lff.2 for ; Tue, 04 Jul 2017 05:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z12HODUIdoKvNXzrZuHdLBWrncPwtBDCDrxcsJkAYJk=; b=CnAWnRjAUZthuQ7HKCtBY8Tqx7MkucGoTf7u0gOIIYJvfPxk0OoBZR/aT9+czmaUjW 4dIJG+Wgld0UOKyFgoPVtRTwx97IM6W2eOl3/x7MMankq6q9xOErWMJmrVtGfE6FKGcF MUJmXzhQuji6jWFhEhGyyXb/kLUzWrbNJ1jM3Sc5mK7+/dO6kfqaBc3dMGzIJFExDX7S FDcPlXUQVoapDW4umecigK7+6E8lS8mL9Fd6roGWTisZoYTR60oAwm0yIVERMsTillkf VIjhNPTgACPHobTuT1GDxnAUVGMZww0krHVdSqoHnHKh9GSRixlbaTbZ5zqSD8nCqOaM sW3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Z12HODUIdoKvNXzrZuHdLBWrncPwtBDCDrxcsJkAYJk=; b=OS9/wZ/0OgkHne/m6zQsiRt761xEOpI/196m1MspMJjRs2GN/1L95AY+tSP3Emv23r cPaSiV+We88PEUAyZux8nF7G2Swml6po/839MTcVwwrulizyfqijp8IdUsTwyFNprVPa bqsAnDHb0ORhET2VmvegQmBCwLaefmTql2RQCDkW8zYJW+uEsLi2nQP97OnGnfljtKNr oqCQIqaSxZPic7L0G56irNFlmhIgcRJLzBz+p0+Ie78lgQ8FG99Nji/9WNAigxXJnofO uYG3b7eit9WCpeQaBNVu1wemH0T3OmCWCoRGd0ZyWMTpxrLop6A5Apd1vyEpPrx/wxmI 7RvQ== X-Gm-Message-State: AKS2vOzd/b7hMmRg35ixx0ZR0Ak4knXAnxN4jTsdRhgO5HHvWeFG18DV 3Sgt1fRU/Mja9L2m X-Received: by 10.46.0.163 with SMTP id e35mr11685372lji.20.1499171293237; Tue, 04 Jul 2017 05:28:13 -0700 (PDT) Received: from localhost.localdomain ([91.105.197.111]) by smtp.googlemail.com with ESMTPSA id 25sm3867601ljh.47.2017.07.04.05.28.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 05:28:12 -0700 (PDT) From: Artem Blagodarenko To: linux-ext4@vger.kernel.org Cc: alexey.lyashkov@gmail.com, artem.blagodarenko@gmail.com Subject: [PATCH 3/4] tests: add test for e2image -b option Date: Mon, 26 Jun 2017 19:58:45 +0300 Message-Id: <1498496326-76684-4-git-send-email-artem.blagodarenko@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1498496326-76684-1-git-send-email-artem.blagodarenko@gmail.com> References: <1498496326-76684-1-git-send-email-artem.blagodarenko@gmail.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Artem Blagodarenko The test makes raw image from partition with broken super block and executes e2fsck. Signed-off-by: Artem Blagodarenko --- tests/i_zero_super/expect | 22 ++++++++++++++++++++++ tests/i_zero_super/image.gz | Bin 0 -> 13262 bytes tests/i_zero_super/script | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 0 deletions(-) diff --git a/tests/i_zero_super/expect b/tests/i_zero_super/expect new file mode 100644 index 0000000..863d692 --- /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@Tih#ASFE0G_ld9Vc5R+bpL^V>zwZSynpzd^M0St`F!5z^~3w8H;SqT zqYs|hy;?=Ydxb*`Y=(_Uj;z^->s>9@r^5EDn{U+Cn|rW>b}kfCoqXW-K~s(F;j74# zhqt?LGco2DyY?LC#w8Uk#19^?CI2?lfagqx1)ifG8HH6hag-M>b#n;a0ZPl9H5uQ* zh;IX^QFd*|QbjWJu&O+~X7%S}AV@xtYOvP)CS>1lrK);rafz~F03E!AP48O_FHJ-S zg=;|Z6CYQNv-ZtIAsw=E5_ROA?i#k~veE+)ipFdv$#ixO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0U!VbfB+Bx0zd!=00AKIbp=K!;yw%P>JwUP zN8Z$BYH3yUJBnz@L=EacMGN|;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* $TMPFILE + +$E2IMAGE_EXE -r -b 8193 $TMPFILE $TMPFILE.raw +$FSCK -n -b 8193 $TMPFILE.raw > $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE.raw;test.img;" $OUT.new >> $OUT + +rm -f $TMPFILE +rm -f $TMPFILE.raw +rm -f $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 #if test -x $E2IMAGE_EXE; then + echo "$test_name: $test_description: skipped" +fi