[LTP] [PATCH v5] power_management: rewrite runpwtests04.sh in C
Andrea Cervesato
andrea.cervesato@suse.com
Mon Jun 15 10:21:45 CEST 2026
Hi Jinseok,
I can't understand the utility of this test honestly. We are
checking if an obsolete ABI [1] such as
/sys/devices/system/cpu/cpuidle/current_governor_ro is actually
readable. That's ok, it's still there at least. Also, we are not
checking the return value or if the file is not writable.
We also have other ABI [2] to test.
Said so, it would be better to _at least_ verify read/write and
return value of `enough` ABI inside /sys/devices/system/cpu/cpuidle/
which are not subject to drivers behaviours. In particular:
- available_governors (ro) — lists registered idle governors
- current_driver (ro) — shows the active cpuidle driver name
- current_governor (rw) — shows/sets the active idle governor
- current_governor_ro (ro) — read-only view of current governor
> +static void setup(void)
> +{
> + if (access(CPUIDLE_PATH, R_OK))
> + tst_brk(TCONF, "%s is not available", CPUIDLE_PATH);
Instead of this check we should use .save_restore with TST_SR_TCONF.
[1] https://www.kernel.org/doc/html/latest/admin-guide/abi-obsolete-files.html#abi-file-obsolete-sysfs-cpuidle
[2] https://www.kernel.org/doc/html/latest/admin-guide/abi-testing.html#abi-sys-devices-system-cpu-cpuidle-available-governors
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
More information about the ltp
mailing list