intel / thermal_daemon

Thermal daemon for IA
GNU General Public License v2.0
540 stars 117 forks source link

tests: Add some experimental umockdev tests #363

Closed benzea closed 7 months ago

benzea commented 2 years ago

Maybe we can at least regession tests e.g. parsing of the adaptive tables this way.

Note:

Anyway, dumping it here. Unfortunately, I am unlikely to spend much more time on it in the future. But I figured I should at least post it.

Marking as draft as the umockdev changes are not ready.

spandruvada commented 2 years ago

I appreciate this effort. Since there are so many combinations of configurations, it is great to have a regression test suit. I have 10+ systems, when I release I just do some tests on them but that is not enough.

benzea commented 2 years ago

If you have an idea of what/how one can test thermald a bit, I might be able to assist a bit to actually get things up and running. So far, it is largely boilerplate stuff, but I guess one could e.g. make a recording of sysfs temperature changes and the expected behaviour.

Note that I was considering using UMLs time-travel mode with infinite CPU to avoid timing issues. That way one could easily feed sysfs temperature sensor changes and check whether thermald reacts correctly without being as susceptible to timing differences between runs.

benzea commented 2 years ago

Note that I was considering using UMLs time-travel mode with infinite CPU to avoid timing issues.

Though, to be fair, with the 4 second polling model, it should also work quite well to just wait for the mainloop iteration by reading stdout/stderr and doing sysfs changes just after the mainloop ran.

spandruvada commented 1 year ago

Did you make in progress here?

benzea commented 1 year ago

No, I just threw it quickly over the fence.

Hmm, not sure why the umockdev fix was not merged. Maybe that was just me not pushing the button, let me check with Martin.

spandruvada commented 7 months ago

I will close the pull request as this is open for a while with no progress. I am adding tests as a script in the next rev,