diff options
author | Elian Doran <contact@eliandoran.me> | 2023-12-18 23:31:29 +0200 |
---|---|---|
committer | Elian Doran <contact@eliandoran.me> | 2023-12-21 16:02:10 +0200 |
commit | d3ef138c1b2cf26f64bd37a2a8367eb5aa1e2340 (patch) | |
tree | b12fa2523d5a38816a38dfc06a8c9b015de713d7 /nixos/tests | |
parent | 3c4ddf82842a172caa8a4b7bed13c50ea2bfadcd (diff) |
nixos/mympd: add nixos test
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/mympd.nix | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index ebebb54a2739b..ef75a80125cbf 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -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 {}; diff --git a/nixos/tests/mympd.nix b/nixos/tests/mympd.nix new file mode 100644 index 0000000000000..ac6a896966e6b --- /dev/null +++ b/nixos/tests/mympd.nix @@ -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") + ''; +}) |