]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: use sd-analyze for kernel version check in TEST-62
authorLuca Boccassi <bluca@debian.org>
Thu, 25 Apr 2024 11:43:18 +0000 (12:43 +0100)
committerLuca Boccassi <bluca@debian.org>
Thu, 25 Apr 2024 12:32:10 +0000 (13:32 +0100)
test/units/testsuite-62.sh

index 84c92247b81ddb9d71f2e45faad500364f5a8db6..1fbb3cb1c2285de84f1c3bca00ec3430cb47ad62 100755 (executable)
@@ -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