From d210ed99c4461c4d11f7a2a02a4da2cfe41616af Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 4 May 2021 14:30:25 +0200 Subject: [PATCH] nixos/tests/botamusique: init --- nixos/tests/all-tests.nix | 1 + nixos/tests/botamusique.nix | 47 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 nixos/tests/botamusique.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 4ada4a5de804..99393e5b1842 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -47,6 +47,7 @@ in boot = handleTestOn ["x86_64-linux"] ./boot.nix {}; # syslinux is unsupported on aarch64 boot-stage1 = handleTest ./boot-stage1.nix {}; borgbackup = handleTest ./borgbackup.nix {}; + botamusique = handleTest ./botamusique.nix {}; buildbot = handleTest ./buildbot.nix {}; buildkite-agents = handleTest ./buildkite-agents.nix {}; caddy = handleTest ./caddy.nix {}; diff --git a/nixos/tests/botamusique.nix b/nixos/tests/botamusique.nix new file mode 100644 index 000000000000..ccb105dc142f --- /dev/null +++ b/nixos/tests/botamusique.nix @@ -0,0 +1,47 @@ +import ./make-test-python.nix ({ pkgs, lib, ...} : + +{ + name = "botamusique"; + meta.maintainers = with lib.maintainers; [ hexa ]; + + nodes = { + machine = { config, ... }: { + services.murmur = { + enable = true; + registerName = "NixOS tests"; + }; + + services.botamusique = { + enable = true; + settings = { + server = { + channel = "NixOS tests"; + }; + bot = { + version = false; + auto_check_update = false; + }; + }; + }; + }; + }; + + testScript = '' + start_all() + + machine.wait_for_unit("murmur.service") + machine.wait_for_unit("botamusique.service") + + machine.sleep(10) + + machine.wait_until_succeeds( + "journalctl -u murmur.service -e | grep -q '<1:botamusique(-1)> Authenticated'" + ) + + with subtest("Check systemd hardening"): + output = machine.execute("systemctl show botamusique.service")[1] + machine.log(output) + output = machine.execute("systemd-analyze security botamusique.service")[1] + machine.log(output) + ''; +})