New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mpd: add NixOS tests #42118
mpd: add NixOS tests #42118
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't run this test with nix-build nixos/tests/mpd.nix
, this is the log: https://gist.github.com/Infinisil/7dc3bb2ca1054b002a165f19ad19f93b.
And I think the test should also be added to nixos/release.nix.
nixos/tests/mpd.nix
Outdated
# License: http://creativecommons.org/licenses/by-sa/4.0/ | ||
|
||
name = "Blue_Wave_Theory-Skyhawk_Beach.mp3"; | ||
url = https://freemusicarchive.org/music/download/c7f57c4f783d3226610aaa41c5c2f0c7cbbb2958; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a persistent url, use https://freemusicarchive.org/file/music/ccCommunity/Blue_Wave_Theory/Surf_Music_Month_Challenge/Blue_Wave_Theory_-_04_-_Skyhawk_Beach.mp3
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the polkit issue I mentioned (or something that's affecting polkit). I'll just rebase this unto the current nixos-unstable branch. It will run there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh right, sorry
nixos/modules/services/audio/mpd.nix
Outdated
@@ -166,6 +166,7 @@ in { | |||
preStart = '' | |||
mkdir -p "${cfg.dataDir}" && chown -R ${cfg.user}:${cfg.group} "${cfg.dataDir}" | |||
mkdir -p "${cfg.playlistDirectory}" && chown -R ${cfg.user}:${cfg.group} "${cfg.playlistDirectory}" | |||
mkdir -p "${cfg.musicDirectory}" && chown -R ${cfg.user}:${cfg.group} "${cfg.musicDirectory}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is really what we want because mpd doesn't touch files in the music directory in contrast to the data and playlist directories. For instance, in my case, the music directory is managed by other services which need to drop music in there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would also break my configuration. I have the music directory on a samba share and I don't want the owner to be changed to mpd (besides, chown would just fail with permission denied).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent. Keep the feedback coming :)
This change adds NixOS tests for the MPD (Music Player Daemon) module. Tests include: - Playing audio locally using ALSA directly. - Playing audio locally using PulseAudio (backed by ALSA). - Playing audio from an external client. - Rejecting an external client when it's not explicitly allowed (default configuration). refs NixOS#41772
5a5c242
to
5509a4d
Compare
@GrahamcOfBorg test mpd |
Success on x86_64-linux (full log) Attempted: tests.mpd Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: tests.mpd Partial log (click to expand)
|
This change adds NixOS tests for the MPD (Music Player Daemon) module.
Tests include:
These tests revealed a bug in the MDP module: Unlike the playlist directory, the musicdirectly is not created prior to starting MPD, causing MPD client commands to fail.
This change includes a fix for the aforementioned bug.
refs #41772
Motivation for this change
The intent of this change is to prepare the MDP module to be extended so it can optionally be configured to run as a systemd user service. These tests are meant to confirm the functionality of the MPD module as it stands today and mitigate the risk of making changes in the future.
Things done
sandbox
innix.conf
on non-NixOS)[ ] macOS[ ] other Linux distributions[ ] Tested compilation of all pkgs that depend on this change usingnix-shell -p nox --run "nox-review wip"
./result/bin/
)Note
There's currently an issue with polkit. Because it doesn't build these tests will not run. However, they do run on nixos-unstable (4b649a9). In addition, something funky is going on with this markdown. I didn't intend this paragraph to be in-your-face like this. My troubleshooting muscles are done for today.It builds now and the tests run.