nixpkgs/nixos/tests/botamusique.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.2 KiB
Nix
Raw Normal View History

{
pkgs,
lib,
...
}:
{
name = "botamusique";
meta.maintainers = with lib.maintainers; [ hexa ];
nodes = {
machine =
{ config, ... }:
{
networking.extraHosts = ''
127.0.0.1 all.api.radio-browser.info
'';
services.murmur = {
enable = true;
registerName = "NixOS tests";
};
services.botamusique = {
enable = true;
settings = {
server = {
channel = "NixOS tests";
};
bot = {
version = false;
auto_check_update = false;
};
2021-05-04 14:30:25 +02:00
};
};
};
};
2021-05-04 14:30:25 +02:00
testScript = ''
start_all()
2021-05-04 14:30:25 +02:00
machine.wait_for_unit("murmur.service")
machine.wait_for_unit("botamusique.service")
2021-05-04 14:30:25 +02:00
machine.sleep(10)
2021-05-04 14:30:25 +02:00
machine.wait_until_succeeds(
"journalctl -u murmur.service -e | grep -q '<1:botamusique(-1)> Authenticated'"
)
2021-05-04 14:30:25 +02:00
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)
'';
}