[LTP] [PATCH v16] thermal: add new test group
Andrea Cervesato
andrea.cervesato@suse.com
Mon Apr 27 13:50:27 CEST 2026
Hi Piotr,
> + interrupts[i] = strtoull(ptr, &endptr, 10);
> +
> + if (ptr == endptr)
> + tst_brk(TBROK, "CPU %d: interrupt not found", nproc);
> +
> + if (errno == ERANGE)
> + tst_brk(TBROK, "CPU %d: interrupt out of range", nproc);
`nproc` inside tst_brk() is wrong, we should use `i`, otherwise we see
a wrong error message.
> +static void run(void)
> +{
> + for (int i = 0; i < tz_counter; i++) {
> + if (x86_pkg_temp_tz[i]) {
> + read_interrupts(interrupt_init);
> + test_zone(i);
> + read_interrupts(interrupt_later);
> + for (int j = 0; j < nproc; j++) {
> + if (interrupt_later[j] < interrupt_init[j])
> + tst_res(TFAIL, "CPU %d interrupt counter: %" PRIu64 " (previous: %" PRIu64 ")",
> + j, interrupt_later[j], interrupt_init[j]);
> + }
> + if (temp <= temp_high)
> + tst_res(TFAIL, "Zone temperature is not rising as expected");
> + else
> + tst_res(TPASS, "x86 package thermal interrupt triggered");
The interrupt check only flags TFAIL when counters decrease (< ), but
never verifies they actually increased. If no new interrupts were
triggered (counters stay the same), the test still passes as long as
temperature rose. The condition should use <= to catch the "no increase"
case, and the TPASS should reflect that interrupts were verified, not
just temperature.
The rest LGTM.
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
More information about the ltp
mailing list