diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index d167ec0c90a5..7f48a36f8915 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1168,15 +1168,27 @@ in octoprint = runTest ./octoprint.nix; oddjobd = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./oddjobd.nix { }; odoo17 = runTest { - imports = [ ./odoo.nix ]; + imports = [ ./odoo/single-process.nix ]; + _module.args.package = pkgs.odoo17; + }; + odoo17-multiprocess = runTest { + imports = [ ./odoo/multi-process.nix ]; _module.args.package = pkgs.odoo17; }; odoo18 = runTest { - imports = [ ./odoo.nix ]; + imports = [ ./odoo/single-process.nix ]; + _module.args.package = pkgs.odoo18; + }; + odoo18-multiprocess = runTest { + imports = [ ./odoo/multi-process.nix ]; _module.args.package = pkgs.odoo18; }; odoo19 = runTest { - imports = [ ./odoo.nix ]; + imports = [ ./odoo/single-process.nix ]; + _module.args.package = pkgs.odoo19; + }; + odoo19-multiprocess = runTest { + imports = [ ./odoo/multi-process.nix ]; _module.args.package = pkgs.odoo19; }; oh-my-zsh = runTest ./oh-my-zsh.nix; diff --git a/nixos/tests/odoo/multi-process.nix b/nixos/tests/odoo/multi-process.nix new file mode 100644 index 000000000000..f73a37a5c9a6 --- /dev/null +++ b/nixos/tests/odoo/multi-process.nix @@ -0,0 +1,39 @@ +{ + package, + lib, + ... +}: +{ + name = "odoo-multi-process"; + meta.maintainers = with lib.maintainers; [ + mkg20001 + xanderio + ]; + + nodes.server = { + services.nginx = { + enable = true; + recommendedProxySettings = true; + }; + + services.odoo = { + enable = true; + package = package; + autoInit = true; + autoInitExtraFlags = [ "--without-demo=all" ]; + domain = "localhost"; + settings.options.workers = 2; + }; + }; + + testScript = # python + '' + server.wait_for_unit("odoo.service") + server.wait_until_succeeds( + "test $(journalctl -u odoo | grep -o 'Worker WorkerHTTP ([[:digit:]]*) alive' | wc -l) = 2" + ) + server.wait_until_succeeds("curl -s http://localhost:8069/web/database/selector | grep '