nixos/mympd: add nixos test

This commit is contained in:
Elian Doran 2023-12-18 23:31:29 +02:00
parent 3c4ddf8284
commit d3ef138c1b
2 changed files with 28 additions and 0 deletions

View File

@ -542,6 +542,7 @@ in {
munin = handleTest ./munin.nix {};
mutableUsers = handleTest ./mutable-users.nix {};
mxisd = handleTest ./mxisd.nix {};
mympd = handleTest ./mympd.nix {};
mysql = handleTest ./mysql/mysql.nix {};
mysql-autobackup = handleTest ./mysql/mysql-autobackup.nix {};
mysql-backup = handleTest ./mysql/mysql-backup.nix {};

27
nixos/tests/mympd.nix Normal file
View File

@ -0,0 +1,27 @@
import ./make-test-python.nix ({pkgs, lib, ... }: {
name = "mympd";
nodes.mympd = {
services.mympd = {
enable = true;
settings = {
http_port = 8081;
};
};
services.mpd.enable = true;
};
testScript = ''
start_all();
machine.wait_for_unit("mympd.service");
# Ensure that mympd can connect to mpd
machine.wait_until_succeeds(
"journalctl -eu mympd -o cat | grep 'Connected to MPD'"
)
# Ensure that the web server is working
machine.succeed("curl http://localhost:8081 --compressed | grep -o myMPD")
'';
})