summaryrefslogtreecommitdiffstats
path: root/nixos/tests/filebrowser.nix
blob: 52999487c9055d14ef9cc4175b9665ac757af33a (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
{
  name = "filebrowser";

  nodes.machine = {
    services.filebrowser = {
      enable = true;
      settings = {
        address = "localhost";
        port = 8080;
        database = "/var/lib/filebrowser/filebrowser.db";
      };
    };
  };

  testScript = ''
    machine.start()

    machine.wait_for_unit("filebrowser.service")
    machine.wait_for_open_port(8080)

    machine.succeed("curl --fail http://localhost:8080/")

    machine.succeed("stat /var/lib/filebrowser/filebrowser.db")

    machine.shutdown()
  '';
}