]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: record missing openssl as a failure
authorMichael Biebl <biebl@debian.org>
Thu, 16 Dec 2021 18:18:28 +0000 (19:18 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 16 Dec 2021 21:18:38 +0000 (21:18 +0000)
The openssl binary is an optional dependency.
If systemd has been built with OpenSSL support, we want to test its
OpenSSL functionality.
So record a failure message in /failed if the binary is missing.

See https://github.com/systemd/systemd/pull/21724#issuecomment-992707614

test/units/testsuite-50.sh

index 1e8df9334956d5a73ae95375ba77d742a238ab6f..fa855fafcc08695a47540e0363d741b1d0c5ab58 100755 (executable)
@@ -128,6 +128,13 @@ signature_size="$((signature_size * 2))KiB"
 
 HAVE_OPENSSL=0
 if systemctl --version | grep -q -- +OPENSSL ; then
+    # The openssl binary is installed conditionally.
+    # If we have OpenSSL support enabled and openssl is missing, fail early
+    # with a proper error message.
+    if ! command -v openssl >/dev/null 2>&1; then
+        echo "openssl missing" >/failed
+        exit 1
+    fi
     HAVE_OPENSSL=1
     # Unfortunately OpenSSL insists on reading some config file, hence provide one with mostly placeholder contents
     cat >> "${image}.openssl.cnf" <<EOF