about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/mympd.nix
blob: ac6a896966e6b4366552a6fc645afb1f0f3f0bd3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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")
  '';
})