1{ system ? builtins.currentSystem, config ? { }
2, pkgs ? import ../../.. { inherit system config; } }:
3
4with import ../../lib/testing-python.nix { inherit system pkgs; };
5with pkgs.lib;
6
7let
8 writefreelyTest = { name, type }:
9 makeTest {
10 name = "writefreely-${name}";
11
12 nodes.machine = { config, pkgs, ... }: {
13 services.writefreely = {
14 enable = true;
15 host = "localhost:3000";
16 admin.name = "nixos";
17
18 database = {
19 inherit type;
20 createLocally = type == "mysql";
21 passwordFile = pkgs.writeText "db-pass" "pass";
22 };
23
24 settings.server.port = 3000;
25 };
26 };
27
28 testScript = ''
29 start_all()
30 machine.wait_for_unit("writefreely.service")
31 machine.wait_for_open_port(3000)
32 machine.succeed("curl --fail http://localhost:3000")
33 '';
34 };
35in {
36 sqlite = writefreelyTest {
37 name = "sqlite";
38 type = "sqlite3";
39 };
40 mysql = writefreelyTest {
41 name = "mysql";
42 type = "mysql";
43 };
44}