nixos/auto-cpufreq: init vm test

Even though cpufreq cannot be adjusted within qemu this test is still
useful to ensure that the service is running and the auto-cpufreq cli is
able to interact with the auto-cpufreq service.
This commit is contained in:
Robert James Hernandez
2024-10-21 19:00:20 +00:00
parent ec7caabec9
commit c258e18f67
2 changed files with 34 additions and 0 deletions

View File

@@ -141,6 +141,7 @@ in {
audiobookshelf = handleTest ./audiobookshelf.nix {};
auth-mysql = handleTest ./auth-mysql.nix {};
authelia = handleTest ./authelia.nix {};
auto-cpufreq = handleTest ./auto-cpufreq.nix {};
avahi = handleTest ./avahi.nix {};
avahi-with-resolved = handleTest ./avahi.nix { networkd = true; };
ayatana-indicators = runTest ./ayatana-indicators.nix;

View File

@@ -0,0 +1,33 @@
import ./make-test-python.nix (
{ pkgs, ... }:
{
name = "auto-cpufreq-server";
nodes = {
machine =
{ pkgs, ... }:
{
# service will still start but since vm inside qemu cpufreq adjustments
# cannot be made. This will resource in the following error but the service
# remains up:
# ERROR:
# Couldn't find any of the necessary scaling governors.
services.auto-cpufreq = {
enable = true;
settings = {
charger = {
turbo = "auto";
};
};
};
};
};
testScript = ''
machine.start()
machine.wait_for_unit("auto-cpufreq.service")
machine.succeed("auto-cpufreq --force reset")
'';
}
)