]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: drop pointless redirection of stderr from 'command -v' 38827/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 5 Sep 2025 06:07:24 +0000 (08:07 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 5 Sep 2025 06:29:52 +0000 (08:29 +0200)
The whole point of using 'command -v' is that it's a very portable
way to check if an executable exists. It doesn't print an error.

test/units/TEST-21-DFUZZER.sh
test/units/TEST-46-HOMED.sh
test/units/TEST-50-DISSECT.DDI.sh
test/units/TEST-74-AUX-UTILS.ssh.sh

index fdf0e8054976d717c800841bd43a009f4b0c3249..555b8a1592e75c8e6f96a4d483d933553365c8d1 100755 (executable)
@@ -4,7 +4,7 @@ set -eux
 set -o pipefail
 
 # check dfuzzer is present before testing
-if ! command -v dfuzzer &>/dev/null; then
+if ! command -v dfuzzer >/dev/null; then
     echo "dfuzzer is not installed, skipping" | tee --append /skipped
     exit 77
 fi
index 12a1e3d884190e8e6bb9fc1e854e42095d3ccbc0..8a6aa54fa19bc876cecff49065a6e18c19a1abb5 100755 (executable)
@@ -537,7 +537,7 @@ for opt in json multiplexer output synthesize with-dropin with-nss with-varlink;
 done
 
 # FIXME: sshd seems to crash inside asan currently, skip the actual ssh test hence
-if command -v ssh &>/dev/null && command -v sshd &>/dev/null && ! [[ -v ASAN_OPTIONS ]]; then
+if command -v ssh >/dev/null && command -v sshd >/dev/null && ! [[ -v ASAN_OPTIONS ]]; then
     at_exit() {
         set +e
 
index 42c9a4312ae19b0fe50e2c2e885a038fb02606dc..9f8ecfc1b7804a049a48b8b9e6c11da13b314225 100755 (executable)
@@ -9,7 +9,7 @@ mount -t ddi "$MINIMAL_IMAGE.gpt" "$dir" -o ro,X-mount.mkdir,discard
 umount -R "$dir"
 
 # Test systemd-repart --make-ddi=:
-if [[ -z "${OPENSSL_CONFIG:?}" ]] || ! command -v mksquashfs &>/dev/null; then
+if [[ -z "${OPENSSL_CONFIG:?}" ]] || ! command -v mksquashfs >/dev/null; then
     echo "Skipping --make-ddi= tests"
     exit 0
 fi
index da2188ea3efea9fd985ca28044da71f195f89f43..890763c9dc9c92b8c050ce896220533681bccf4d 100755 (executable)
@@ -3,7 +3,7 @@
 set -eux
 set -o pipefail
 
-if ! command -v ssh &> /dev/null || ! command -v sshd &> /dev/null ; then
+if ! command -v ssh >/dev/null || ! command -v sshd >/dev/null ; then
     echo "ssh/sshd not found, skipping test." >&2
     exit 0
 fi
@@ -58,11 +58,11 @@ ssh -o StrictHostKeyChecking=no -v -i "$ROOTID" .host cat /etc/machine-id | cmp
 ssh -o StrictHostKeyChecking=no -v -i "$ROOTID" unix/run/ssh-unix-local/socket cat /etc/machine-id | cmp - /etc/machine-id
 ssh -o StrictHostKeyChecking=no -v -i "$ROOTID" machine/.host cat /etc/machine-id | cmp - /etc/machine-id
 
-modprobe vsock_loopback ||:
+modprobe vsock_loopback || :
 if test -e /dev/vsock -a -d /sys/module/vsock_loopback ; then
     ssh -o StrictHostKeyChecking=no -v -i "$ROOTID" vsock/1 cat /etc/machine-id | cmp - /etc/machine-id
 
-    if ! command -v scp &> /dev/null ; then
+    if ! command -v scp >/dev/null ; then
         echo "scp not found, skipping subtest" >&2
     else
         OUT_FILE=$(mktemp -u)