From b9559be8c40ed77f89706e8b420da498d90db290 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 26 May 2025 03:43:40 +0200 Subject: [PATCH] nixos/tests/livekit: test local ingress service integration --- nixos/tests/networking/livekit.nix | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/nixos/tests/networking/livekit.nix b/nixos/tests/networking/livekit.nix index 3f72ee5a050c..83fb3391a1f1 100644 --- a/nixos/tests/networking/livekit.nix +++ b/nixos/tests/networking/livekit.nix @@ -1,6 +1,7 @@ { - pkgs, + config, lib, + pkgs, ... }: { @@ -15,11 +16,28 @@ }; settings.port = 8000; }; + + specialisation.ingress = { + inheritParentConfig = true; + configuration = { + services.livekit = { + ingress.enable = true; + redis.port = 6379; + }; + }; + }; }; testScript = '' - machine.wait_for_unit("livekit.service") - machine.wait_for_open_port(8000) - machine.succeed("curl 127.0.0.1:8000 -L --fail") + with subtest("Test livekit service"): + machine.wait_for_unit("livekit.service") + machine.wait_for_open_port(8000) + machine.succeed("curl 127.0.0.1:8000 -L --fail") + + with subtest("Test locally distributed livekit service with ingress component"): + machine.succeed("${config.nodes.machine.system.build.toplevel}/specialisation/ingress/bin/switch-to-configuration test") + machine.wait_for_unit("livekit-ingress.service") + machine.wait_for_open_port(8080) + machine.log(machine.succeed("curl --fail -X OPTIONS 127.0.0.1:8080/whip/test")) ''; }