nixos/lk-jwt-service: add test

This commit is contained in:
Henry-Hiles 2025-04-29 01:03:33 -04:00
parent c8f4df349c
commit ba9ab12dc2
No known key found for this signature in database
3 changed files with 30 additions and 0 deletions

View file

@ -737,6 +737,7 @@ in
listmonk = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./listmonk.nix { };
litellm = runTest ./litellm.nix;
litestream = handleTest ./litestream.nix { };
lk-jwt-service = runTest ./matrix/lk-jwt-service.nix;
lldap = handleTest ./lldap.nix { };
localsend = handleTest ./localsend.nix { };
locate = handleTest ./locate.nix { };

View file

@ -0,0 +1,26 @@
{
pkgs,
lib,
...
}:
{
name = "lk-jwt-service";
meta.maintainers = [ lib.maintainers.quadradical ];
nodes.machine = {
services.lk-jwt-service = {
enable = true;
keyFile = pkgs.writers.writeYAML "keys.yaml" {
key = "f6lQGaHtM5HfgZjIcec3cOCRfiDqIine4CpZZnqdT5cE";
};
livekitUrl = "wss://127.0.0.1:8100";
port = 8000;
};
};
testScript = ''
machine.wait_for_unit("lk-jwt-service.service")
machine.wait_for_open_port(8000)
machine.succeed('curl 127.0.0.1:8000/sfu/get -sLX POST -w "%{http_code}" | grep -q "^400"')
'';
}

View file

@ -2,6 +2,7 @@
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
}:
buildGoModule (finalAttrs: {
@ -17,6 +18,8 @@ buildGoModule (finalAttrs: {
vendorHash = "sha256-47eJO1Ai78RuhlEPn/J1cd+YSqvmfUD8cuPZIqsdxvI=";
passthru.tests = nixosTests.lk-jwt-service;
meta = with lib; {
changelog = "https://github.com/element-hq/lk-jwt-service/releases/tag/${finalAttrs.src.tag}";
description = "Minimal service to issue LiveKit JWTs for MatrixRTC";