tests: (chrt) skip SCHED_EXT subtest when kernel lacks support#4452
Open
dengbo11 wants to merge 1 commit into
Open
tests: (chrt) skip SCHED_EXT subtest when kernel lacks support#4452dengbo11 wants to merge 1 commit into
dengbo11 wants to merge 1 commit into
Conversation
sched_get_priority_max/min() returns 0 for SCHED_EXT even when the kernel was built without CONFIG_SCHED_CLASS_EXT, so the existing skip_policy() check (grepping chrt --max output) cannot detect the missing support. The test then fails at runtime with EINVAL rather than skipping gracefully. Add an optional second argument to skip_policy(): when set, the function performs a runtime probe by actually trying to set the policy. Pass '--ext' for the ext subtest so unsupported kernels correctly skip the test. Addresses: util-linux#4429
karelzak
reviewed
Jun 30, 2026
| fi | ||
|
|
||
| if [ -n "$2" ]; then | ||
| $TS_CMD_CHRT $2 0 true >/dev/null 2>&1 |
Collaborator
There was a problem hiding this comment.
What about using --pid 0 to avoid dependence and exec true? And probably also quotes, "$2".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sched_get_priority_max/min() returns 0 for SCHED_EXT even when the kernel was built without CONFIG_SCHED_CLASS_EXT, so the existing skip_policy() check (grepping chrt --max output) cannot detect the missing support. The test then fails at runtime with EINVAL rather than skipping gracefully.
Add an optional second argument to skip_policy(): when set, the function performs a runtime probe by actually trying to set the policy. Pass '--ext' for the ext subtest so unsupported kernels correctly skip the test.
Addresses: #4429