test: replace 'grep -q' with 'grep >/dev/null'

After afa3eb821d, we have introduced 'grep -q'
at several places. Let's replace them.
This commit is contained in:
Yu Watanabe
2026-06-05 04:56:34 +09:00
parent 8cfe1c2f7e
commit 421429e7fe
5 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -126,13 +126,13 @@ systemd-mstack -U /tmp/ooo
ls -alR /home/testuser/.local/state/machines/ocicombo.mstack
run0 -u testuser importctl list-images --user | grep -q ocicombo
run0 -u testuser importctl list-images --user | grep ocicombo >/dev/null
ls -alR /home/testuser/.local/state/machines/ocicombo.mstack
run0 -u testuser systemd-nspawn -q --pipe -M ocicombo /sbin/init | grep -q luftikus
run0 -u testuser systemd-nspawn -q --pipe -M ocicombo /sbin/init | grep luftikus >/dev/null
run0 -u testuser --pipe systemd-run -q --unit=fimpel --user -p PrivateUsers=managed -p RootMStack=/home/testuser/.local/state/machines/ocicombo.mstack --pipe /sbin/init | grep -q luftikus
run0 -u testuser --pipe systemd-run -q --unit=fimpel --user -p PrivateUsers=managed -p RootMStack=/home/testuser/.local/state/machines/ocicombo.mstack --pipe /sbin/init | grep luftikus >/dev/null
run0 -u testuser machinectl list-images -a --user
+1 -1
View File
@@ -411,7 +411,7 @@ ExecStart=bash -c ' \\
sleep 0.1; \\
done; \\
mount; \\
mount | grep -F "on /tmp/img type squashfs" | grep -q -F "nosuid"; \\
mount | grep -F "on /tmp/img type squashfs" | grep -F "nosuid" >/dev/null; \\
'
EOF
systemctl start testservice-50d.service
+2 -2
View File
@@ -175,13 +175,13 @@ EOF
systemd-run -M testuser@ --user --pipe --wait \
--property RootImage="$MINIMAL_IMAGE.gpt" \
--property RootImageOptions="root:nosuid" \
sh -c "test -e \"/dev/mapper/${MINIMAL_IMAGE_ROOTHASH}-verity\" && mount | grep -F squashfs | grep -q -F nosuid"
sh -c "test -e \"/dev/mapper/${MINIMAL_IMAGE_ROOTHASH}-verity\" && mount | grep -F squashfs | grep -F nosuid >/dev/null"
systemd-run -M testuser@ --user --pipe --wait \
--property RootImage="$MINIMAL_IMAGE.raw" \
--property ExtensionImages=/tmp/app0.raw \
--property MountImages=/tmp/app0.raw:/var/tmp:nosuid \
sh -c "test -e \"/dev/mapper/${MINIMAL_IMAGE_ROOTHASH}-verity\" && test -e \"/dev/mapper/$(</tmp/app0.roothash)-verity\" && mount | grep -F /var/tmp | grep -q -F nosuid"
sh -c "test -e \"/dev/mapper/${MINIMAL_IMAGE_ROOTHASH}-verity\" && test -e \"/dev/mapper/$(</tmp/app0.roothash)-verity\" && mount | grep -F /var/tmp | grep -F nosuid >/dev/null"
rm -f /etc/polkit-1/rules.d/mountoptions.rules
systemctl try-reload-or-restart polkit.service
+1 -1
View File
@@ -1951,7 +1951,7 @@ EOF
touch "$imgs/empty-password"
# the expectation for hmac-sha256 is 'integrity: hmac(sha256)'
cryptsetup luksDump "${loop}p1" | grep -q "integrity: $(echo "$1" | sed -r 's/^hmac-(.*)$/hmac(\1)/')"
cryptsetup luksDump "${loop}p1" | grep "integrity: $(echo "$1" | sed -r 's/^hmac-(.*)$/hmac(\1)/')" >/dev/null
cryptsetup open --type=luks2 --key-file="$imgs/empty-password" "${loop}p1" "$volume"
dmsetup status > "$dmstatus"
+1 -1
View File
@@ -207,7 +207,7 @@ varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Manager.Reexecute '{}
# Wait for the manager to finish re-exec before proceeding — the user manager
# tests below use systemd-run which requires a functional PID 1.
for _ in {1..10}; do
if systemctl is-system-running 2>/dev/null | grep -qE 'running|degraded'; then
if systemctl is-system-running 2>/dev/null | grep -E 'running|degraded' >/dev/null; then
break
fi
sleep 1