From patchwork Sun Jan 21 07:24:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 10176827 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 2983960224 for ; Sun, 21 Jan 2018 07:24:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06E3B2094F for ; Sun, 21 Jan 2018 07:24:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF0B921F61; Sun, 21 Jan 2018 07:24:05 +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 88FAB2094F for ; Sun, 21 Jan 2018 07:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750923AbeAUHYE (ORCPT ); Sun, 21 Jan 2018 02:24:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:48602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbeAUHYE (ORCPT ); Sun, 21 Jan 2018 02:24:04 -0500 Received: from garbanzo.do-not-panic.com (c-73-15-241-2.hsd1.ca.comcast.net [73.15.241.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 62ABE2176E; Sun, 21 Jan 2018 07:24:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62ABE2176E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mcgrof@kernel.org From: "Luis R. Rodriguez" To: fstests@vger.kernel.org Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, "Luis R. Rodriguez" Subject: [PATCH 1/2] fstests: move expunge test into a helper Date: Sat, 20 Jan 2018 23:24:00 -0800 Message-Id: <20180121072401.1047-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.13.2 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move the expunge test into a helper. Signed-off-by: Luis R. Rodriguez --- check | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/check b/check index f8db3cd6dfab..0ba71d5d2005 100755 --- a/check +++ b/check @@ -485,6 +485,18 @@ _check_filesystems() fi } +_expunge_test() +{ + TEST_ID="$1" + if [ -s $tmp.xlist ]; then + if grep $TEST_ID $tmp.xlist > /dev/null 2>&1 ; then + echo " [expunged]" + return 1 + fi + fi + return 0 +} + _prepare_test_list if $OPTIONS_HAVE_SECTIONS; then @@ -672,11 +684,9 @@ for section in $HOST_OPTIONS_SECTIONS; do rm -f $seqres.out.bad # check if we really should run it - if [ -s $tmp.xlist ]; then - if grep $seqnum $tmp.xlist > /dev/null 2>&1 ; then - echo " [expunged]" - continue - fi + _expunge_test $seqnum + if [ $? -eq 1 ]; then + continue fi # slashes now in names, sed barfs on them so use grep