nixpkgs/nixos/tests/mympd.nix

29 lines
559 B
Nix
Raw Permalink Normal View History

{ pkgs, lib, ... }:
{
name = "mympd";
2023-12-18 23:31:29 +02:00
nodes.mympd = {
services.mympd = {
enable = true;
settings = {
http_port = 8081;
2023-12-18 23:31:29 +02:00
};
};
2023-12-18 23:31:29 +02:00
services.mpd.enable = true;
};
testScript = ''
start_all();
machine.wait_for_unit("mympd.service");
2023-12-18 23:31:29 +02:00
# Ensure that mympd can connect to mpd
machine.wait_until_succeeds(
"journalctl -eu mympd -o cat | grep 'Connected to MPD'"
)
2023-12-18 23:31:29 +02:00
# Ensure that the web server is working
machine.succeed("curl http://localhost:8081 --compressed | grep -o myMPD")
'';
}