Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: keescook@chromium.org, linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] selftests/lkdtm: Use grep -E instead of egrep
Date: Fri,  8 May 2020 16:53:56 +1000	[thread overview]
Message-ID: <20200508065356.2493343-2-mpe@ellerman.id.au> (raw)
In-Reply-To: <20200508065356.2493343-1-mpe@ellerman.id.au>

shellcheck complains that egrep is deprecated, and the grep man page
agrees. Use grep -E instead.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 tools/testing/selftests/lkdtm/run.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/lkdtm/run.sh b/tools/testing/selftests/lkdtm/run.sh
index 0b409e187c7b..ee64ff8df8f4 100755
--- a/tools/testing/selftests/lkdtm/run.sh
+++ b/tools/testing/selftests/lkdtm/run.sh
@@ -25,13 +25,13 @@ fi
 # Figure out which test to run from our script name.
 test=$(basename $0 .sh)
 # Look up details about the test from master list of LKDTM tests.
-line=$(egrep '^#?'"$test"'\b' tests.txt)
+line=$(grep -E '^#?'"$test"'\b' tests.txt)
 if [ -z "$line" ]; then
 	echo "Skipped: missing test '$test' in tests.txt"
 	exit $KSELFTEST_SKIP_TEST
 fi
 # Check that the test is known to LKDTM.
-if ! egrep -q '^'"$test"'$' "$TRIGGER" ; then
+if ! grep -E -q '^'"$test"'$' "$TRIGGER" ; then
 	echo "Skipped: test '$test' missing in $TRIGGER!"
 	exit $KSELFTEST_SKIP_TEST
 fi
@@ -80,11 +80,11 @@ dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$DMESG" -
 
 cat "$LOG"
 # Check for expected output
-if egrep -qi "$expect" "$LOG" ; then
+if grep -E -qi "$expect" "$LOG" ; then
 	echo "$test: saw '$expect': ok"
 	exit 0
 else
-	if egrep -qi XFAIL: "$LOG" ; then
+	if grep -E -qi XFAIL: "$LOG" ; then
 		echo "$test: saw 'XFAIL': [SKIP]"
 		exit $KSELFTEST_SKIP_TEST
 	else
-- 
2.25.1


  reply	other threads:[~2020-05-08  6:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08  6:53 [PATCH 1/2] selftests/lkdtm: Don't clear dmesg when running tests Michael Ellerman
2020-05-08  6:53 ` Michael Ellerman [this message]
2020-05-08  7:30   ` [PATCH 2/2] selftests/lkdtm: Use grep -E instead of egrep Kees Cook
2020-05-08  7:30 ` [PATCH 1/2] selftests/lkdtm: Don't clear dmesg when running tests Kees Cook
2020-06-22  8:51 ` Naresh Kamboju
2020-06-24  3:48   ` Joe Lawrence
2020-06-24  8:39     ` Petr Mladek
2020-06-24 20:12       ` Joe Lawrence
2020-06-26  8:02         ` Petr Mladek
2020-06-26 13:38           ` Joe Lawrence
2020-06-26 15:51             ` Naresh Kamboju
2020-06-25  6:16   ` Kees Cook
2020-06-26 15:50     ` Naresh Kamboju

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=20200508065356.2493343-2-mpe@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@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