check_qemu_log
}
+is_systemd_version_greater_or_equal() {
+ local version="$1"
+
+ command -v systemctl &> /dev/null
+ systemd_version=$(systemctl --version | awk 'NR==1 { print $2 }')
+ ((systemd_version >= "$version"))
+}
+
test_setup() {
build_client_rootfs "$TESTDIR/rootfs"
build_ext4_image "$TESTDIR/rootfs" "$TESTDIR"/root.img ' rdinit=/bin/sh'
# shellcheck disable=SC2144 # We're not installing multilib libfido2, so
# glob will only match once. More matches would break the test anyway.
- if pkg-config --exists "libsystemd >= 257" && [ -e /usr/lib*/libfido2.so.1 ] \
+ if is_systemd_version_greater_or_equal 257 && [ -e /usr/lib*/libfido2.so.1 ] \
&& ! lsinitrd "$TESTDIR"/initramfs.testing | grep -E ' usr/lib[^/]*/libfido2\.so\.1\b' > /dev/null; then
echo "Error: libfido2.so.1 should have been included in the initramfs" >&2
return 1