Loading nixos/tests/all-tests.nix +1 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,7 @@ in authelia = runTest ./authelia.nix; auto-cpufreq = runTest ./auto-cpufreq.nix; autobrr = runTest ./autobrr.nix; autosuspend = runTest ./autosuspend.nix; avahi = runTest { imports = [ ./avahi.nix ]; _module.args.networkd = false; Loading nixos/tests/autosuspend.nix 0 → 100644 +30 −0 Original line number Diff line number Diff line { lib, pkgs, ... }: { name = "autosuspend"; meta.maintainers = [ lib.maintainers.anthonyroussel ]; nodes = { machine = { services.autosuspend = { enable = true; settings = { interval = 5; idle_time = 5; suspend_cmd = "${pkgs.coreutils}/bin/touch /tmp/suspended"; }; # Return exit code 1 to trigger suspend checks.ExternalCommand.command = "exit 1"; }; }; }; testScript = '' start_all() machine.wait_for_unit("autosuspend.service") machine.wait_for_file("/tmp/suspended") ''; } pkgs/by-name/au/autosuspend/package.nix +5 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ lib, dbus, fetchFromGitHub, nixosTests, python3, sphinxHook, withDocs ? true, Loading Loading @@ -87,6 +88,10 @@ python3.pkgs.buildPythonApplication (finalAttrs: { "test_multiple_sessions" ]; passthru.tests = { inherit (nixosTests) autosuspend; }; meta = { description = "Daemon to automatically suspend and wake up a system"; homepage = "https://autosuspend.readthedocs.io"; Loading Loading
nixos/tests/all-tests.nix +1 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,7 @@ in authelia = runTest ./authelia.nix; auto-cpufreq = runTest ./auto-cpufreq.nix; autobrr = runTest ./autobrr.nix; autosuspend = runTest ./autosuspend.nix; avahi = runTest { imports = [ ./avahi.nix ]; _module.args.networkd = false; Loading
nixos/tests/autosuspend.nix 0 → 100644 +30 −0 Original line number Diff line number Diff line { lib, pkgs, ... }: { name = "autosuspend"; meta.maintainers = [ lib.maintainers.anthonyroussel ]; nodes = { machine = { services.autosuspend = { enable = true; settings = { interval = 5; idle_time = 5; suspend_cmd = "${pkgs.coreutils}/bin/touch /tmp/suspended"; }; # Return exit code 1 to trigger suspend checks.ExternalCommand.command = "exit 1"; }; }; }; testScript = '' start_all() machine.wait_for_unit("autosuspend.service") machine.wait_for_file("/tmp/suspended") ''; }
pkgs/by-name/au/autosuspend/package.nix +5 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ lib, dbus, fetchFromGitHub, nixosTests, python3, sphinxHook, withDocs ? true, Loading Loading @@ -87,6 +88,10 @@ python3.pkgs.buildPythonApplication (finalAttrs: { "test_multiple_sessions" ]; passthru.tests = { inherit (nixosTests) autosuspend; }; meta = { description = "Daemon to automatically suspend and wake up a system"; homepage = "https://autosuspend.readthedocs.io"; Loading