linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: fstests@vger.kernel.org
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Luis R. Rodriguez" <mcgrof@kernel.org>
Subject: [PATCH 1/2] fstests: move expunge test into a helper
Date: Sat, 20 Jan 2018 23:24:00 -0800	[thread overview]
Message-ID: <20180121072401.1047-1-mcgrof@kernel.org> (raw)

Move the expunge test into a helper.

Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
 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
-- 
2.15.0

             reply	other threads:[~2018-01-21  7:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-21  7:24 Luis R. Rodriguez [this message]
2018-01-21  7:24 ` [PATCH 2/2] fstests: expunge tests when doing a dry run Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180121072401.1047-1-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).