lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

nixosTests.earlyoom: handleTest -> runTest

+32 -36
+1 -1
nixos/tests/all-tests.nix
··· 434 434 drbd-driver = runTest ./drbd-driver.nix; 435 435 dublin-traceroute = runTest ./dublin-traceroute.nix; 436 436 dwl = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./dwl.nix; 437 - earlyoom = handleTestOn [ "x86_64-linux" ] ./earlyoom.nix { }; 437 + earlyoom = runTestOn [ "x86_64-linux" ] ./earlyoom.nix; 438 438 early-mount-options = handleTest ./early-mount-options.nix { }; 439 439 ec2-config = (handleTestOn [ "x86_64-linux" ] ./ec2.nix { }).boot-ec2-config or { }; 440 440 ec2-nixops = (handleTestOn [ "x86_64-linux" ] ./ec2.nix { }).boot-ec2-nixops or { };
+31 -35
nixos/tests/earlyoom.nix
··· 1 - import ./make-test-python.nix ( 2 - { lib, ... }: 3 - { 4 - name = "earlyoom"; 5 - meta = { 6 - maintainers = with lib.maintainers; [ 7 - ncfavier 8 - oxalica 9 - ]; 10 - }; 1 + { lib, ... }: 2 + { 3 + name = "earlyoom"; 4 + meta.maintainers = with lib.maintainers; [ 5 + ncfavier 6 + oxalica 7 + ]; 11 8 12 - nodes.machine = 13 - { pkgs, ... }: 14 - { 15 - # Limit VM resource usage. 16 - virtualisation.memorySize = 1024; 9 + nodes.machine = 10 + { pkgs, ... }: 11 + { 12 + # Limit VM resource usage. 13 + virtualisation.memorySize = 1024; 17 14 18 - services.earlyoom = { 19 - enable = true; 20 - # Use SIGKILL, or `tail` will catch SIGTERM and exit successfully. 21 - freeMemKillThreshold = 90; 22 - }; 15 + services.earlyoom = { 16 + enable = true; 17 + # Use SIGKILL, or `tail` will catch SIGTERM and exit successfully. 18 + freeMemKillThreshold = 90; 19 + }; 23 20 24 - systemd.services.testbloat = { 25 - description = "Create a lot of memory pressure"; 26 - serviceConfig = { 27 - ExecStart = "${pkgs.coreutils}/bin/tail /dev/zero"; 28 - }; 21 + systemd.services.testbloat = { 22 + description = "Create a lot of memory pressure"; 23 + serviceConfig = { 24 + ExecStart = "${pkgs.coreutils}/bin/tail /dev/zero"; 29 25 }; 30 26 }; 27 + }; 31 28 32 - testScript = '' 33 - machine.wait_for_unit("earlyoom.service") 29 + testScript = '' 30 + machine.wait_for_unit("earlyoom.service") 34 31 35 - with subtest("earlyoom should kill the bad service"): 36 - machine.fail("systemctl start --wait testbloat.service") 37 - assert machine.get_unit_info("testbloat.service")["Result"] == "signal" 38 - output = machine.succeed('journalctl -u earlyoom.service -b0') 39 - assert 'low memory! at or below SIGKILL limits' in output 40 - ''; 41 - } 42 - ) 32 + with subtest("earlyoom should kill the bad service"): 33 + machine.fail("systemctl start --wait testbloat.service") 34 + assert machine.get_unit_info("testbloat.service")["Result"] == "signal" 35 + output = machine.succeed('journalctl -u earlyoom.service -b0') 36 + assert 'low memory! at or below SIGKILL limits' in output 37 + ''; 38 + }