2020-04-24 23:36:52 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }: {
|
|
|
|
name = "minidlna";
|
|
|
|
|
|
|
|
nodes = {
|
|
|
|
server =
|
|
|
|
{ ... }:
|
|
|
|
{
|
|
|
|
imports = [ ../modules/profiles/minimal.nix ];
|
2022-09-09 14:08:57 +00:00
|
|
|
services.minidlna.enable = true;
|
|
|
|
services.minidlna.openFirewall = true;
|
|
|
|
services.minidlna.settings = {
|
|
|
|
log_level = "error";
|
|
|
|
media_dir = [
|
|
|
|
"PV,/tmp/stuff"
|
|
|
|
];
|
|
|
|
friendly_name = "rpi3";
|
|
|
|
root_container = "B";
|
|
|
|
notify_interval = 60;
|
|
|
|
album_art_names = [
|
|
|
|
"Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg"
|
|
|
|
"AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg"
|
|
|
|
"Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2022-09-09 14:08:57 +00:00
|
|
|
client = { ... }: { };
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
''
|
|
|
|
start_all()
|
|
|
|
server.succeed("mkdir -p /tmp/stuff && chown minidlna: /tmp/stuff")
|
|
|
|
server.wait_for_unit("minidlna")
|
2022-06-16 17:23:12 +00:00
|
|
|
server.wait_for_open_port(8200)
|
2022-03-30 09:31:56 +00:00
|
|
|
# requests must be made *by IP* to avoid triggering minidlna's
|
|
|
|
# DNS-rebinding protection
|
|
|
|
server.succeed("curl --fail http://$(getent ahostsv4 localhost | head -n1 | cut -f 1 -d ' '):8200/")
|
|
|
|
client.succeed("curl --fail http://$(getent ahostsv4 server | head -n1 | cut -f 1 -d ' '):8200/")
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
})
|