nixpkgs/nixos/tests/web-apps/writefreely.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
930 B
Nix
Raw Normal View History

2022-06-25 22:08:43 -07:00
{
runTest,
...
2022-06-25 22:08:43 -07:00
}:
let
writefreelyTest =
{ name, type }:
runTest {
2022-06-25 22:08:43 -07:00
name = "writefreely-${name}";
nodes.machine =
{ config, pkgs, ... }:
{
services.writefreely = {
enable = true;
host = "localhost:3000";
admin.name = "nixos";
database = {
inherit type;
createLocally = type == "mysql";
passwordFile = pkgs.writeText "db-pass" "pass";
};
settings.server.port = 3000;
};
2022-06-25 22:08:43 -07:00
};
testScript = ''
start_all()
machine.wait_for_unit("writefreely.service")
machine.wait_for_open_port(3000)
machine.succeed("curl --fail http://localhost:3000")
'';
};
in
{
sqlite = writefreelyTest {
name = "sqlite";
type = "sqlite3";
};
mysql = writefreelyTest {
name = "mysql";
type = "mysql";
};
}