1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

test: record missing openssl as a failure

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
This commit is contained in:
Michael Biebl 2021-12-16 19:18:28 +01:00 committed by Luca Boccassi
parent b0b1edc29b
commit 85e3a3a832

View File

@ -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