nixos/soju: add tests

For now, just try creating a user with sojuctl. Actually connecting an
irc client is pretty annoying.
This commit is contained in:
Benjamin Lee 2023-10-01 17:56:37 -07:00
parent d772ac182f
commit e9fed4bcad
No known key found for this signature in database
GPG Key ID: FB9624E2885D55A4
2 changed files with 32 additions and 0 deletions

View File

@ -821,6 +821,7 @@ in {
soapui = handleTest ./soapui.nix {};
soft-serve = handleTest ./soft-serve.nix {};
sogo = handleTest ./sogo.nix {};
soju = handleTest ./soju.nix {};
solanum = handleTest ./solanum.nix {};
sonarr = handleTest ./sonarr.nix {};
sonic-server = handleTest ./sonic-server.nix {};

31
nixos/tests/soju.nix Normal file
View File

@ -0,0 +1,31 @@
import ./make-test-python.nix ({ pkgs, lib, ... }:
let
certs = import ./common/acme/server/snakeoil-certs.nix;
domain = certs.domain;
user = "testuser";
pass = "hunter2";
in
{
name = "soju";
meta.maintainers = with lib.maintainers; [ Benjamin-L ];
nodes.machine = { ... }: {
services.soju = {
enable = true;
adminSocket.enable = true;
hostName = domain;
tlsCertificate = certs.${domain}.cert;
tlsCertificateKey = certs.${domain}.key;
};
};
testScript = ''
start_all()
machine.wait_for_unit("soju")
machine.wait_for_file("/run/soju/admin")
machine.succeed("sojuctl user create -username ${user} -password ${pass}")
'';
})