about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorshivaraj-bh <sbh69840@gmail.com>2024-06-04 16:07:06 +0530
committershivaraj-bh <sbh69840@gmail.com>2024-06-04 16:46:19 +0530
commitf66cb82fef9d3f02cb1f72744e9493116aa41408 (patch)
tree7cf06521f0c69f6457a85ec79420e6c658629b7f /nixos/tests
parent1860d7862be0fb8a7c240234befd3250f1ce773f (diff)
nixos/open-webui: init
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/open-webui.nix33
2 files changed, 34 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 035c288c22e5c..e2f13a474ce68 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -691,6 +691,7 @@ in {
   outline = handleTest ./outline.nix {};
   image-contents = handleTest ./image-contents.nix {};
   openvscode-server = handleTest ./openvscode-server.nix {};
+  open-webui = runTest ./open-webui.nix;
   orangefs = handleTest ./orangefs.nix {};
   os-prober = handleTestOn ["x86_64-linux"] ./os-prober.nix {};
   osquery = handleTestOn ["x86_64-linux"] ./osquery.nix {};
diff --git a/nixos/tests/open-webui.nix b/nixos/tests/open-webui.nix
new file mode 100644
index 0000000000000..f10ef1ad98fb0
--- /dev/null
+++ b/nixos/tests/open-webui.nix
@@ -0,0 +1,33 @@
+{ lib, ... }:
+let
+  mainPort = "8080";
+in
+{
+  name = "open-webui";
+  meta = with lib.maintainers; {
+    maintainers = [ shivaraj-bh ];
+  };
+
+  nodes = {
+    machine =
+      { ... }:
+      {
+        services.open-webui = {
+          enable = true;
+          environment = {
+            # Requires network connection
+            RAG_EMBEDDING_MODEL = "";
+          };
+        };
+      };
+  };
+
+  testScript = ''
+    machine.start()
+
+    machine.wait_for_unit("open-webui.service")
+    machine.wait_for_open_port(${mainPort})
+
+    machine.succeed("curl http://127.0.0.1:${mainPort}")
+  '';
+}