aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/tests/lorri/default.nix
blob: c33c7503993da565e7195b122d24aa62d082b955 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import ../make-test-python.nix {
  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")
  '';
}