[nix] update test to run quicker

This commit is contained in:
2023-10-31 16:43:02 +01:00
parent 54c0e8a46b
commit 06c48f2927

View File

@@ -1,8 +1,6 @@
# ./tests/hello-world-server.nix
(import ./lib.nix) { (import ./lib.nix) {
name = "gokill-base-test"; name = "gokill-base-test";
nodes = { nodes = {
# `self` here is set by using specialArgs in `lib.nix`
node1 = { self, pkgs, ... }: { node1 = { self, pkgs, ... }: {
imports = [ self.nixosModules.gokill ]; imports = [ self.nixosModules.gokill ];
@@ -13,7 +11,7 @@
type = "Timeout"; type = "Timeout";
name = "custom timeout"; name = "custom timeout";
options = { options = {
duration = 10; duration = 3;
}; };
actions = [ actions = [
{ {
@@ -34,9 +32,9 @@
import time import time
start_all() # wait for our service to start start_all() # wait for our service to start
node1.wait_for_unit("gokill") node1.wait_for_unit("gokill")
time.sleep(11) time.sleep(4)
output = node1.succeed("journalctl -u gokill.service | tail -n 2 | head -n 1") output = node1.succeed("journalctl -u gokill.service | tail -n 2 | head -n 1")
# Check if our webserver returns the expected result # Check if our webserver returns the expected result
assert "hellow world" in output assert "hello world" in output
''; '';
} }