From patchwork Fri Nov 10 01:34:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 10052263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A350E60631 for ; Fri, 10 Nov 2017 01:34:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 946312AB02 for ; Fri, 10 Nov 2017 01:34:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86C572985F; Fri, 10 Nov 2017 01:34:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 749F528478 for ; Fri, 10 Nov 2017 01:34:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755593AbdKJBe2 (ORCPT ); Thu, 9 Nov 2017 20:34:28 -0500 Received: from victor.provo.novell.com ([137.65.250.26]:33445 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755578AbdKJBe0 (ORCPT ); Thu, 9 Nov 2017 20:34:26 -0500 Received: from adam-pc.lan (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Thu, 09 Nov 2017 18:34:24 -0700 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH 3/3] btrfs-progs: test/fsck/021: Cleanup custom check by overriding check_image Date: Fri, 10 Nov 2017 09:34:19 +0800 Message-Id: <20171110013419.15159-3-wqu@suse.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171110013419.15159-1-wqu@suse.com> References: <20171110013419.15159-1-wqu@suse.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Qu Wenruo --- .../fsck-tests/021-partially-dropped-snapshot-case/test.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/fsck-tests/021-partially-dropped-snapshot-case/test.sh b/tests/fsck-tests/021-partially-dropped-snapshot-case/test.sh index 44a33a63d269..a5e166ec5060 100755 --- a/tests/fsck-tests/021-partially-dropped-snapshot-case/test.sh +++ b/tests/fsck-tests/021-partially-dropped-snapshot-case/test.sh @@ -5,14 +5,18 @@ source "$TOP/tests/common" check_prereq btrfs -for img in *.img -do - image=$(extract_image "$img") +check_image() +{ + local image + + image=$1 + run_check_stdout "$TOP/btrfs" check "$image" 2>&1 | grep -q "Errors found in extent allocation tree or chunk allocation" if [ $? -eq 0 ]; then rm -f "$image" _fail "unexpected error occurred when checking $img" fi - rm -f "$image" -done +} + +check_all_images