nixpkgs/nixos/tests/odoo.nix
Sirio Balmelli c2b4c0e51d tests/odoo: replace db init workaround with services.odoo.autoInit
Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
2024-07-19 11:52:01 +02:00

28 lines
789 B
Nix

import ./make-test-python.nix ({ pkgs, lib, package ? pkgs.odoo, ...} : {
name = "odoo";
meta.maintainers = with lib.maintainers; [ mkg20001 ];
nodes = {
server = { ... }: {
services.nginx = {
enable = true;
recommendedProxySettings = true;
};
services.odoo = {
enable = true;
package = package;
autoInit = true;
autoInitExtraFlags = [ "--without-demo=all" ];
domain = "localhost";
};
};
};
testScript = { nodes, ... }:
''
server.wait_for_unit("odoo.service")
server.wait_until_succeeds("curl -s http://localhost:8069/web/database/selector | grep '<title>Odoo</title>'")
server.succeed("curl -s http://localhost/web/database/selector | grep '<title>Odoo</title>'")
'';
})