1 import ./make-test-python.nix ({ pkgs, ... }:
4 dataDir = "/var/lib/foobar";
7 name = "etebase-server";
8 meta = with pkgs.lib.maintainers; {
9 maintainers = [ felschr ];
12 nodes.machine = { pkgs, ... }:
14 services.etebase-server = {
17 settings.global.secret_file =
18 toString (pkgs.writeText "secret" "123456");
23 machine.wait_for_unit("etebase-server.service")
24 machine.wait_for_open_port(8001)
26 with subtest("Database & src-version were created"):
27 machine.wait_for_file("${dataDir}/src-version")
29 "${pkgs.etebase-server}"
30 in machine.succeed("cat ${dataDir}/src-version")
32 machine.wait_for_file("${dataDir}/db.sqlite3")
33 machine.wait_for_file("${dataDir}/static")
35 with subtest("Only allow access from allowed_hosts"):
36 machine.succeed("curl -sSfL http://0.0.0.0:8001/")
37 machine.fail("curl -sSfL http://127.0.0.1:8001/")
38 machine.fail("curl -sSfL http://localhost:8001/")
40 with subtest("Run tests"):
41 machine.succeed("etebase-server check")
42 machine.succeed("etebase-server test")
44 with subtest("Create superuser"):
46 "etebase-server createsuperuser --no-input --username admin --email root@localhost"