nixos/dolibarr: add h2o+postgres setup as an extra test machine

This commit is contained in:
·𐑑𐑴𐑕𐑑𐑩𐑤
2025-10-06 18:55:56 +07:00
parent 3fdabe09a5
commit 401e2b5e84

View File

@@ -3,7 +3,8 @@
name = "dolibarr"; name = "dolibarr";
meta.maintainers = [ ]; meta.maintainers = [ ];
nodes.machine = nodes = {
nginx_mysql =
{ ... }: { ... }:
{ {
services.dolibarr = { services.dolibarr = {
@@ -13,12 +14,29 @@
forceSSL = false; forceSSL = false;
enableACME = false; enableACME = false;
}; };
database.type = "mysql";
}; };
networking.firewall.allowedTCPPorts = [ 80 ]; networking.firewall.allowedTCPPorts = [ 80 ];
}; };
h2o_postgresql =
{ ... }:
{
services.dolibarr = {
enable = true;
domain = "localhost";
h2o = {
acme.enable = false;
};
database.type = "postgresql";
};
testScript = '' networking.firewall.allowedTCPPorts = [ 80 ];
};
};
testScript = # python
''
from html.parser import HTMLParser from html.parser import HTMLParser
start_all() start_all()
@@ -32,12 +50,20 @@
def handle_endtag(self, tag): pass def handle_endtag(self, tag): pass
def handle_data(self, data): pass def handle_data(self, data): pass
# wait for app
for machine in (nginx_mysql, h2o_postgresql):
machine.wait_for_unit("phpfpm-dolibarr.service") machine.wait_for_unit("phpfpm-dolibarr.service")
machine.wait_for_unit("nginx.service")
machine.wait_for_open_port(80) # wait for web servers
nginx_mysql.wait_for_unit("nginx.service")
nginx_mysql.wait_for_open_port(80)
h2o_postgresql.wait_for_unit("h2o.service")
h2o_postgresql.wait_for_open_port(80)
for machine in (nginx_mysql, h2o_postgresql):
# Sanity checks on URLs. # Sanity checks on URLs.
# machine.succeed("curl -fL http://localhost/index.php") machine.succeed("curl -fL http://localhost/index.php")
# machine.succeed("curl -fL http://localhost/") machine.succeed("curl -fL http://localhost/")
# Perform installation. # Perform installation.
machine.succeed('curl -fL -X POST http://localhost/install/check.php -F selectlang=auto') machine.succeed('curl -fL -X POST http://localhost/install/check.php -F selectlang=auto')
machine.succeed('curl -fL -X POST http://localhost/install/fileconf.php -F selectlang=auto') machine.succeed('curl -fL -X POST http://localhost/install/fileconf.php -F selectlang=auto')