From f21e2644d338c94dd0528c2433b7f3d9dd3ef933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Tue, 2 Nov 2021 01:48:47 +0100 Subject: [PATCH] nixosTests.odoo: init --- nixos/tests/all-tests.nix | 1 + nixos/tests/odoo.nix | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 nixos/tests/odoo.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 5f919dbf7855..f4d6800aff60 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -172,6 +172,7 @@ in installed-tests = pkgs.recurseIntoAttrs (handleTest ./installed-tests {}); invidious = handleTest ./invidious.nix {}; oci-containers = handleTestOn ["x86_64-linux"] ./oci-containers.nix {}; + odoo = handleTest ./odoo.nix {}; # 9pnet_virtio used to mount /nix partition doesn't support # hibernation. This test happens to work on x86_64-linux but # not on other platforms. diff --git a/nixos/tests/odoo.nix b/nixos/tests/odoo.nix new file mode 100644 index 000000000000..96e3405482b4 --- /dev/null +++ b/nixos/tests/odoo.nix @@ -0,0 +1,27 @@ +import ./make-test-python.nix ({ pkgs, lib, ...} : with lib; { + name = "odoo"; + meta = with pkgs.lib.maintainers; { + maintainers = [ mkg20001 ]; + }; + + nodes = { + server = { ... }: { + services.nginx = { + enable = true; + recommendedProxySettings = true; + }; + + services.odoo = { + enable = true; + domain = "localhost"; + }; + }; + }; + + testScript = { nodes, ... }: + '' + server.wait_for_unit("odoo.service") + server.wait_until_succeeds("curl -s http://localhost:8069/web/database/selector | grep 'Odoo'") + server.succeed("curl -s http://localhost/web/database/selector | grep 'Odoo'") + ''; +})