summaryrefslogtreecommitdiffstats
path: root/nixos/tests/web-apps/grav.nix
blob: d566788ee219063279f0897bdbea117f446ee7e3 (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
27
28
{ ... }:
{
  name = "grav";

  containers = {
    machine =
      { pkgs, ... }:
      {
        services.grav = {
          enable = true;
          package = pkgs.grav_2;
        };
      };
  };

  testScript = ''
    start_all()
    machine.wait_for_unit("phpfpm-grav.service")
    machine.wait_for_open_port(80)

    # The first request to a fresh install should result in a redirect to the
    # admin page, where the user is expected to set up an admin user.
    actual = machine.succeed("curl -v --stderr - http://localhost/").splitlines()
    expected = "< Location: /admin"
    assert expected in actual, \
      f"unexpected reply from Grav: '{actual}'"
  '';
}