about summary refs log tree commit diff
path: root/nixos/tests/odoo.nix
diff options
context:
space:
mode:
authorMaciej Krüger <mkg20001@gmail.com>2021-11-02 01:48:47 +0100
committerMaciej Krüger <mkg20001@gmail.com>2021-11-03 03:52:42 +0100
commitf21e2644d338c94dd0528c2433b7f3d9dd3ef933 (patch)
treefb7092d34061f87f2c688b0e9c10135b3cb6d586 /nixos/tests/odoo.nix
parentede778be9c712a2fbefa3d3eae9e20aa1e038989 (diff)
nixosTests.odoo: init
Diffstat (limited to 'nixos/tests/odoo.nix')
-rw-r--r--nixos/tests/odoo.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/nixos/tests/odoo.nix b/nixos/tests/odoo.nix
new file mode 100644
index 0000000000000..96e3405482b41
--- /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 '<title>Odoo</title>'")
+    server.succeed("curl -s http://localhost/web/database/selector | grep '<title>Odoo</title>'")
+  '';
+})