summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2022-07-17 15:41:38 +0200
committerDavid Tardon <dtardon@redhat.com>2022-07-17 20:26:09 +0200
commit283db37a20900b549508b2bf6d9db898c9a0ca67 (patch)
tree564336a78213a75894e86fa36fdb4fe6dee11d71 /test
parent6083f7a604267d02a648c76edd3e0cb7b83b4620 (diff)
downloadsystemd-283db37a20900b549508b2bf6d9db898c9a0ca67.tar.gz
test: merge grep | awk calls
Diffstat (limited to 'test')
-rwxr-xr-xtest/units/testsuite-35.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/units/testsuite-35.sh b/test/units/testsuite-35.sh
index e2b3f497f2..d2cd36005a 100755
--- a/test/units/testsuite-35.sh
+++ b/test/units/testsuite-35.sh
@@ -262,7 +262,7 @@ check_session() (
return 1
fi
- session=$(loginctl --no-legend | grep "logind-test-user" | awk '{ print $1 }')
+ session=$(loginctl --no-legend | awk '$3 == "logind-test-user" { print $1 }')
if [[ -z "$session" ]]; then
echo "no session found for user logind-test-user" >&2
return 1
@@ -273,7 +273,7 @@ check_session() (
return 1
fi
- leader_pid=$(loginctl session-status "$session" | grep "Leader:" | awk '{ print $2 }')
+ leader_pid=$(loginctl session-status "$session" | awk '$1 == "Leader:" { print $2 }')
if [[ -z "$leader_pid" ]]; then
echo "cannot found leader process for session $session" >&2
return 1
@@ -353,7 +353,7 @@ EOF
udevadm info "$dev"
# trigger logind and activate session
- loginctl activate "$(loginctl --no-legend | grep "logind-test-user" | awk '{ print $1 }')"
+ loginctl activate "$(loginctl --no-legend | awk '$3 == "logind-test-user" { print $1 }')"
# check ACL
sleep 1