From 936e298f0e9e3b7a8077e11bb1dabf6d8d0abd30 Mon Sep 17 00:00:00 2001 From: Matteo Croce Date: Fri, 4 Apr 2025 18:16:08 +0200 Subject: [PATCH] use grep whole-word search grep supports whole-word search with `-w`, no need to look for a trailing space. --- test/units/TEST-35-LOGIN.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/units/TEST-35-LOGIN.sh b/test/units/TEST-35-LOGIN.sh index b19f42b524..9620bbad6f 100755 --- a/test/units/TEST-35-LOGIN.sh +++ b/test/units/TEST-35-LOGIN.sh @@ -765,19 +765,19 @@ EOF # Now check that run0's session class control works systemd-run --service-type=notify run0 -u lightuser --unit="$RUN0UNIT0" sleep infinity - loginctl | grep lightuser | grep -q "background-light " + loginctl | grep lightuser | grep -qw background-light systemctl stop "$RUN0UNIT0" systemd-run --service-type=notify run0 -u lightuser --unit="$RUN0UNIT1" --lightweight=yes sleep infinity - loginctl | grep lightuser | grep -q "background-light " + loginctl | grep lightuser | grep -qw background-light systemctl stop "$RUN0UNIT1" systemd-run --service-type=notify run0 -u lightuser --unit="$RUN0UNIT2" --lightweight=no sleep infinity - loginctl | grep lightuser | grep -q "background " + loginctl | grep lightuser | grep -qw background systemctl stop "$RUN0UNIT2" systemd-run --service-type=notify run0 -u root --unit="$RUN0UNIT3" sleep infinity - loginctl | grep root | grep -q "background-light " + loginctl | grep root | grep -qw background-light systemctl stop "$RUN0UNIT3" }