1 import ./make-test-python.nix ({ lib, pkgs, ... }: {
2 name = "livebook-service";
5 machine = { config, pkgs, ... }: {
7 ./common/user-account.nix
11 enableUserService = true;
13 LIVEBOOK_PORT = 20123;
15 environmentFile = pkgs.writeText "livebook.env" ''
16 LIVEBOOK_PASSWORD = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
22 testScript = { nodes, ... }:
24 user = nodes.machine.users.users.alice;
25 sudo = lib.concatStringsSep " " [
26 "XDG_RUNTIME_DIR=/run/user/${toString user.uid}"
28 "--preserve-env=XDG_RUNTIME_DIR"
34 machine.wait_for_unit("multi-user.target")
36 machine.succeed("loginctl enable-linger alice")
37 machine.wait_until_succeeds("${sudo} systemctl --user is-active livebook.service")
38 machine.wait_for_open_port(20123, timeout=10)
40 machine.succeed("curl -L localhost:20123 | grep 'Type password'")