From e9fed4bcad77e0d04a77a42886d51282f96c2163 Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Sun, 1 Oct 2023 17:56:37 -0700 Subject: [PATCH] nixos/soju: add tests For now, just try creating a user with sojuctl. Actually connecting an irc client is pretty annoying. --- nixos/tests/all-tests.nix | 1 + nixos/tests/soju.nix | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 nixos/tests/soju.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index cc8f5959f006..816fa3b8cd84 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -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 {}; diff --git a/nixos/tests/soju.nix b/nixos/tests/soju.nix new file mode 100644 index 000000000000..23da36f7b3ab --- /dev/null +++ b/nixos/tests/soju.nix @@ -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}") + ''; +})