Loading nixos/tests/all-tests.nix +8 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,14 @@ in { lib-extend = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./nixos-test-driver/lib-extend.nix {}; node-name = runTest ./nixos-test-driver/node-name.nix; busybox = runTest ./nixos-test-driver/busybox.nix; driver-timeout = pkgs.runCommand "ensure-timeout-induced-failure" { failed = pkgs.testers.testBuildFailure ((runTest ./nixos-test-driver/timeout.nix).config.rawTestDerivation); } '' grep -F "timeout reached; test terminating" $failed/testBuildFailure.log # The program will always be terminated by SIGTERM (143) if it waits for the deadline thread. [[ 143 = $(cat $failed/testBuildFailure.exit) ]] touch $out ''; }; # NixOS vm tests and non-vm unit tests Loading nixos/tests/nixos-test-driver/timeout.nix 0 → 100644 +15 −0 Original line number Diff line number Diff line { name = "Test that sleep of 6 seconds fails a timeout of 5 seconds"; globalTimeout = 5; nodes = { machine = ({ pkgs, ... }: { }); }; testScript = '' start_all() machine.wait_for_unit("multi-user.target") machine.succeed("sleep 6") ''; } Loading
nixos/tests/all-tests.nix +8 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,14 @@ in { lib-extend = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./nixos-test-driver/lib-extend.nix {}; node-name = runTest ./nixos-test-driver/node-name.nix; busybox = runTest ./nixos-test-driver/busybox.nix; driver-timeout = pkgs.runCommand "ensure-timeout-induced-failure" { failed = pkgs.testers.testBuildFailure ((runTest ./nixos-test-driver/timeout.nix).config.rawTestDerivation); } '' grep -F "timeout reached; test terminating" $failed/testBuildFailure.log # The program will always be terminated by SIGTERM (143) if it waits for the deadline thread. [[ 143 = $(cat $failed/testBuildFailure.exit) ]] touch $out ''; }; # NixOS vm tests and non-vm unit tests Loading
nixos/tests/nixos-test-driver/timeout.nix 0 → 100644 +15 −0 Original line number Diff line number Diff line { name = "Test that sleep of 6 seconds fails a timeout of 5 seconds"; globalTimeout = 5; nodes = { machine = ({ pkgs, ... }: { }); }; testScript = '' start_all() machine.wait_for_unit("multi-user.target") machine.succeed("sleep 6") ''; }