about summary refs log tree commit diff
path: root/nixos/tests/all-tests.nix
diff options
context:
space:
mode:
authorRaito Bezarius <masterancpp@gmail.com>2023-10-27 13:32:04 +0200
committerRaito Bezarius <masterancpp@gmail.com>2023-10-29 12:45:00 +0100
commitc90219633c40eaeb9ca69c7a8cea75123a13d596 (patch)
tree48acf64031415cad8f42100fe99effb402c3bd19 /nixos/tests/all-tests.nix
parenta0dc17bd572018e9a4c6f77e30583f5fc292c5d5 (diff)
nixos/tests/nixos-test-driver: test timeout failures
We test that the test framework timeouts are working as expected.
Diffstat (limited to 'nixos/tests/all-tests.nix')
-rw-r--r--nixos/tests/all-tests.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 1c8ee32428eac..2b50c09872ea8 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -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