diff options
Diffstat (limited to 'nixpkgs/nixos/tests/lorri')
-rw-r--r-- | nixpkgs/nixos/tests/lorri/builder.sh | 3 | ||||
-rw-r--r-- | nixpkgs/nixos/tests/lorri/default.nix | 28 | ||||
-rw-r--r-- | nixpkgs/nixos/tests/lorri/fake-shell.nix | 5 |
3 files changed, 36 insertions, 0 deletions
diff --git a/nixpkgs/nixos/tests/lorri/builder.sh b/nixpkgs/nixos/tests/lorri/builder.sh new file mode 100644 index 000000000000..b586b2bf7985 --- /dev/null +++ b/nixpkgs/nixos/tests/lorri/builder.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +printf "%s" "${name:?}" > "${out:?}" diff --git a/nixpkgs/nixos/tests/lorri/default.nix b/nixpkgs/nixos/tests/lorri/default.nix new file mode 100644 index 000000000000..a4bdc92490ce --- /dev/null +++ b/nixpkgs/nixos/tests/lorri/default.nix @@ -0,0 +1,28 @@ +import ../make-test-python.nix { + name = "lorri"; + + nodes.machine = { pkgs, ... }: { + imports = [ ../../modules/profiles/minimal.nix ]; + environment.systemPackages = [ pkgs.lorri ]; + }; + + testScript = '' + # Copy files over + machine.succeed( + "cp '${./fake-shell.nix}' shell.nix" + ) + machine.succeed( + "cp '${./builder.sh}' builder.sh" + ) + + # Start the daemon and wait until it is ready + machine.execute("lorri daemon > lorri.stdout 2> lorri.stderr &") + machine.wait_until_succeeds("grep --fixed-strings 'ready' lorri.stdout") + + # Ping the daemon + machine.succeed("lorri internal ping shell.nix") + + # Wait for the daemon to finish the build + machine.wait_until_succeeds("grep --fixed-strings 'Completed' lorri.stdout") + ''; +} diff --git a/nixpkgs/nixos/tests/lorri/fake-shell.nix b/nixpkgs/nixos/tests/lorri/fake-shell.nix new file mode 100644 index 000000000000..9de9d247e542 --- /dev/null +++ b/nixpkgs/nixos/tests/lorri/fake-shell.nix @@ -0,0 +1,5 @@ +derivation { + system = builtins.currentSystem; + name = "fake-shell"; + builder = ./builder.sh; +} |