test/check-systemd-unit: skip if systemd too old
On RHEL 8, the --offline argument is not yet there. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2060
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
set -e
|
set -e
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
if systemd-analyze --offline=true security 2>/dev/null </dev/null; then
|
||||||
|
|
||||||
# We're using "security" as opposed to "verify" because (as of 2024)
|
# We're using "security" as opposed to "verify" because (as of 2024)
|
||||||
# the latter doesn't support --offline runs.
|
# the latter doesn't support --offline runs.
|
||||||
#
|
#
|
||||||
@@ -14,3 +16,7 @@ env -i systemd-analyze --offline=true security "$1" 2>&1 |awk '
|
|||||||
{if (!suppress) {print; failed++}}
|
{if (!suppress) {print; failed++}}
|
||||||
END {exit failed}
|
END {exit failed}
|
||||||
'
|
'
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "SKIP: systemd-analyze --offline=true security not supported" >&2
|
||||||
|
fi
|
||||||
|
Reference in New Issue
Block a user