Skip to content

Commit

Permalink
selftests/lkdtm: Use grep -E instead of egrep
Browse files Browse the repository at this point in the history
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>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
  • Loading branch information
Michael Ellerman authored and Shuah Khan committed May 8, 2020
1 parent f131d9e commit 851c4df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/testing/selftests/lkdtm/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 851c4df

Please sign in to comment.