Merge pull request #32475 from bluca/skip

test: skip testsuite-50.mountnfsd if kernel/polkit are too old
This commit is contained in:
Luca Boccassi 2024-04-25 18:48:57 +02:00 committed by GitHub
commit d1c4174d69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 10 deletions

View file

@ -36,6 +36,7 @@ test_append_files() {
fi
inst_binary mksquashfs
inst_binary unsquashfs
inst_binary pkcheck
install_verity_minimal
}

View file

@ -10,7 +10,9 @@ if [[ ! -f /usr/lib/systemd/system/systemd-mountfsd.socket ]] || \
[[ ! -f /usr/lib/systemd/system/systemd-nsresourced.socket ]] || \
! command -v mksquashfs || \
! grep -q bpf /sys/kernel/security/lsm ||
! find /usr/lib* -name libbpf.so.1 2>/dev/null | grep .; then
! find /usr/lib* -name libbpf.so.1 2>/dev/null | grep . || \
systemd-analyze compare-versions "$(uname -r)" lt 6.5 || \
systemd-analyze compare-versions "$(pkcheck --version | awk '{print $3}')" lt 124; then
echo "Skipping mountnfsd/nsresourced tests"
exit 0
fi

View file

@ -34,15 +34,7 @@ teardown() {
systemd-analyze log-level info
}
KERNEL_VERSION="$(uname -r)"
KERNEL_MAJOR="${KERNEL_VERSION%%.*}"
KERNEL_MINOR="${KERNEL_VERSION#"$KERNEL_MAJOR".}"
KERNEL_MINOR="${KERNEL_MINOR%%.*}"
MAJOR_REQUIRED=5
MINOR_REQUIRED=7
if [[ "$KERNEL_MAJOR" -lt $MAJOR_REQUIRED || ("$KERNEL_MAJOR" -eq $MAJOR_REQUIRED && "$KERNEL_MINOR" -lt $MINOR_REQUIRED) ]]; then
if systemd-analyze compare-versions "$(uname -r)" lt 5.7; then
echo "kernel is not 5.7+" >>/skipped
exit 77
fi