naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
b7dd4d
From 434b4b64d17e16ed23f90c99c26dbd0e4ce6cd88 Mon Sep 17 00:00:00 2001
b7dd4d
From: Lennart Poettering <lennart@poettering.net>
b7dd4d
Date: Wed, 24 Nov 2021 15:58:50 +0100
b7dd4d
Subject: [PATCH] test: make test-execute pass on Linux 5.15
b7dd4d
b7dd4d
Linux 5.15 broke kernel API:
b7dd4d
b7dd4d
https://github.com/torvalds/linux/commit/e70344c05995a190a56bbd1a23dc2218bcc8c924
b7dd4d
b7dd4d
Previously setting IOPRIO_CLASS_NONE for a process would then report
b7dd4d
IOPRIO_CLASS_NONE back. But since 5.15 it reports IOPRIO_CLASS_BE
b7dd4d
instead. Since IOPRIO_CLASS_NONE is an alias for a special setting of
b7dd4d
IOPRIO_CLASS_BE this makes some sense, but it's also a kernel API
b7dd4d
breakage that our testsuite trips up on.
b7dd4d
b7dd4d
(I made some minimal effort to inform the kernel people about this API
b7dd4d
breakage during the 5.15 rc phase, but noone was interested.)
b7dd4d
b7dd4d
Either way let's hadle this gracefully in our test suite and accept
b7dd4d
"best-effort" too when "none" was set.
b7dd4d
b7dd4d
(This is only triggable if the tests are run on 5.15 with full privs)
b7dd4d
b7dd4d
(cherry picked from commit d9b8771108cf2955efc3852b477391017d2c599a)
b7dd4d
b7dd4d
Related: #2087152
b7dd4d
---
b7dd4d
 test/test-execute/exec-ioschedulingclass-none.service | 3 ++-
b7dd4d
 1 file changed, 2 insertions(+), 1 deletion(-)
b7dd4d
b7dd4d
diff --git a/test/test-execute/exec-ioschedulingclass-none.service b/test/test-execute/exec-ioschedulingclass-none.service
b7dd4d
index b6af122a1e..8f917d345d 100644
b7dd4d
--- a/test/test-execute/exec-ioschedulingclass-none.service
b7dd4d
+++ b/test/test-execute/exec-ioschedulingclass-none.service
b7dd4d
@@ -2,6 +2,7 @@
b7dd4d
 Description=Test for IOSchedulingClass=none
b7dd4d
 
b7dd4d
 [Service]
b7dd4d
-ExecStart=/bin/sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "none"'
b7dd4d
+# Old kernels might report "none" here, new kernels "best-effort".
b7dd4d
+ExecStart=/bin/sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "none" -o "$${c%%:*}" = "best-effort"'
b7dd4d
 Type=oneshot
b7dd4d
 IOSchedulingClass=none