2022-09-05 15:06:54 +00:00
|
|
|
import ./make-test-python.nix {
|
2020-07-19 00:01:16 +00:00
|
|
|
name = "mediatomb";
|
|
|
|
|
|
|
|
nodes = {
|
2022-09-05 15:06:54 +00:00
|
|
|
server = {
|
|
|
|
services.mediatomb = {
|
|
|
|
enable = true;
|
|
|
|
serverName = "Gerbera";
|
|
|
|
interface = "eth1";
|
|
|
|
openFirewall = true;
|
|
|
|
mediaDirectories = [
|
|
|
|
{
|
|
|
|
path = "/var/lib/gerbera/pictures";
|
|
|
|
recursive = false;
|
|
|
|
hidden-files = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
path = "/var/lib/gerbera/audio";
|
|
|
|
recursive = true;
|
|
|
|
hidden-files = false;
|
|
|
|
}
|
|
|
|
];
|
2020-07-19 00:01:16 +00:00
|
|
|
};
|
2022-09-05 15:06:54 +00:00
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
"d /var/lib/gerbera/pictures 0770 mediatomb mediatomb"
|
|
|
|
"d /var/lib/gerbera/audio 0770 mediatomb mediatomb"
|
|
|
|
];
|
|
|
|
};
|
2020-07-19 00:01:16 +00:00
|
|
|
|
2022-09-05 15:06:54 +00:00
|
|
|
client = {};
|
2020-07-19 00:01:16 +00:00
|
|
|
};
|
|
|
|
|
2022-09-05 15:06:54 +00:00
|
|
|
testScript = ''
|
2020-07-19 00:01:16 +00:00
|
|
|
start_all()
|
|
|
|
|
2022-09-05 15:06:54 +00:00
|
|
|
server.wait_for_unit("mediatomb")
|
|
|
|
server.wait_until_succeeds("nc -z 192.168.1.2 49152")
|
|
|
|
server.succeed("curl -v --fail http://server:49152/")
|
2020-07-19 00:01:16 +00:00
|
|
|
|
2022-09-05 15:06:54 +00:00
|
|
|
client.wait_for_unit("multi-user.target")
|
|
|
|
page = client.succeed("curl -v --fail http://server:49152/")
|
2020-07-19 00:01:16 +00:00
|
|
|
assert "Gerbera" in page and "MediaTomb" not in page
|
|
|
|
'';
|
2022-09-05 15:06:54 +00:00
|
|
|
}
|