[LTP] [RFC] Re: lib: Rename function check_kver() => check_min_kver()

Petr Vorel <[email protected]> Mon, 3 Aug 2026 15:06:45 +0200
Newsgroups it.linux.lists.ltp
Message-ID <20260803130645.GA246496@pevik>
Hi all,

> > In that case we want to have both in a single commit, right?
> > => yet another version.

> Yes, I think so

I'm not sure what's reasonable, therefore RFC please.

We can for sure can have test with both flags, .min_kver < .max_kver:

.min_kver = "6.5"
.max_kver = "7.2"

which will be tested on kernels <6.5, 7.2> (including all their stable
versions). Here the code works like (using AND):

$(uname -r) >= .min_kver && $(uname -r) <= .max_kver

(BTW although current version prints only the version which is not sufficient.
And I think it's better than print the range without specifying which version is
not sufficient).

But can we have also a variant when .min_kver > .max_kver (using OR)?

.max_kver = "6.10"
.min_kver = "7.2"

i.e it will be tested on <whatever_minimum_LTP is, 6.10> <7.2, future versions>:

$(uname -r) <= .max_kver || $(uname -r) >= .min_kver

Advantages:
* only 2 flags
* no need to parse complicated expressions (e.g. "< 6.9, > 7.1" or "le 6.10, ge 7.2")

Disadvantages
* a bit unintuitive
* complicated expressions will not work

WDYT?

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp