From patchwork Thu Dec 28 01:36:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhihao Cheng X-Patchwork-Id: 18568 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1755806dyb; Wed, 27 Dec 2023 17:34:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHC9v4IQNo/dm40sA6qppxXJAl/2ApSfHGfbCP5YjygJaGyDrY2C7DWZVBcZIcb8HpIY1gb X-Received: by 2002:ad4:594c:0:b0:67f:457c:21ac with SMTP id eo12-20020ad4594c000000b0067f457c21acmr15172975qvb.48.1703727259573; Wed, 27 Dec 2023 17:34:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703727259; cv=none; d=google.com; s=arc-20160816; b=C47eTpP6PyrH1DUOA82CyZo7jaeRLTcqaenox0r5uWFqek/HJK7ng5CyY/h8f7fovq tp8So+T2iJ0+By01tqJg3mtJyfhaDpnmyKDJhusBL6WDs2VU0dA71xfQqozYzBQr+Skq Wl/ZelVFSEBImICuTDg6ZGLQAcIygQeSmNkP7JJXiO/mu9Exwr86pBRNK3vL/Kemz8Kr 4xzdqbpqqsITA+wJ06dOh35n8KHyNV8qYQZvTfd337L5Sm/hHuOh1k8b3auKJsw2OuIH nWfEQRrDO2ih9LbOJbmdTFB7JU1gk7mVYJ6zBL+HtXvywd5zU3ojKEAHFGl/zJo1fYhp gUjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=kAbogsY5ItvTYSu/hPy/8l7jEJIUbFmQMlFD3L34HmM=; fh=3kaVOPShTC55oj708yh1yJALapWuogKx6Yvc3sQq9zY=; b=C/ZAJFotiNW24xaUl2VbQabnie+7WXC/y687dOcXwdYfgrfBOwisuxw+FPeAHZZoK2 Cq89u62eaOXd9pARSm6WnHZXr2ZCMWWTFShDVQDIUDtHz+385qkkY7eYrnSejoEXhR/Y mjieHiA1YokmFfPt1wCGuPmvkLb9R64J8NmS1xRxW+xI064q0jX2TAAZB+suMKcft3xK VEZrP2vVeiKI0gCSuOtMcq5WmSLk85SC2u7q8lXsFxtV50iQQhO+17iEse2EBaELZUQd E8YQbr86DU4MVEz3UW29D1GbvbfRSfXE9tMe9U/Uww2BqjjZtzyRoQyED4qxz72ENyVp xgUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12336-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12336-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j3-20020a0cf503000000b0067a9b3d05b8si15116541qvm.110.2023.12.27.17.34.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 17:34:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12336-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12336-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12336-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 51A6B1C21387 for ; Thu, 28 Dec 2023 01:34:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F075A33F7; Thu, 28 Dec 2023 01:33:45 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E61CA10E3 for ; Thu, 28 Dec 2023 01:33:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4T0rcL0L0Lz1Q6th; Thu, 28 Dec 2023 09:33:06 +0800 (CST) Received: from kwepemm000013.china.huawei.com (unknown [7.193.23.81]) by mail.maildlp.com (Postfix) with ESMTPS id CF09B18001F; Thu, 28 Dec 2023 09:33:32 +0800 (CST) Received: from huawei.com (10.175.127.227) by kwepemm000013.china.huawei.com (7.193.23.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 28 Dec 2023 09:33:32 +0800 From: Zhihao Cheng To: , , , , CC: , Subject: [PATCH mtd-utils 00/11] tests: Add new testcases for ubifs_repair Date: Thu, 28 Dec 2023 09:36:28 +0800 Message-ID: <20231228013639.2827205-1-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.31.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm000013.china.huawei.com (7.193.23.81) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786487514686979213 X-GMAIL-MSGID: 1786487514686979213 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