2021-11-05 05:30:45 +00:00
|
|
|
import ./make-test-python.nix (
|
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
2021-09-23 08:48:29 +00:00
|
|
|
name = "owncast";
|
2021-11-05 05:30:45 +00:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
|
|
|
maintainers = [ MayNiklas ];
|
|
|
|
};
|
|
|
|
|
2021-09-23 08:48:29 +00:00
|
|
|
nodes = {
|
2024-12-10 19:26:33 +00:00
|
|
|
client =
|
2021-11-05 05:30:45 +00:00
|
|
|
{ pkgs, ... }:
|
|
|
|
with pkgs.lib;
|
2024-12-10 19:26:33 +00:00
|
|
|
{
|
2021-11-05 05:30:45 +00:00
|
|
|
networking = {
|
|
|
|
dhcpcd.enable = false;
|
|
|
|
interfaces.eth1.ipv6.addresses = mkOverride 0 [
|
2024-12-10 19:26:33 +00:00
|
|
|
{
|
2021-11-05 05:30:45 +00:00
|
|
|
address = "fd00::2";
|
|
|
|
prefixLength = 64;
|
2024-12-10 19:26:33 +00:00
|
|
|
}
|
|
|
|
];
|
2021-11-05 05:30:45 +00:00
|
|
|
interfaces.eth1.ipv4.addresses = mkOverride 0 [
|
2024-12-10 19:26:33 +00:00
|
|
|
{
|
2021-11-05 05:30:45 +00:00
|
|
|
address = "192.168.1.2";
|
|
|
|
prefixLength = 24;
|
2024-12-10 19:26:33 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
server =
|
2021-11-05 05:30:45 +00:00
|
|
|
{ pkgs, ... }:
|
|
|
|
with pkgs.lib;
|
2024-12-10 19:26:33 +00:00
|
|
|
{
|
2021-11-05 05:30:45 +00:00
|
|
|
networking = {
|
|
|
|
dhcpcd.enable = false;
|
|
|
|
useNetworkd = true;
|
|
|
|
useDHCP = false;
|
|
|
|
interfaces.eth1.ipv6.addresses = mkOverride 0 [
|
2024-12-10 19:26:33 +00:00
|
|
|
{
|
2021-11-05 05:30:45 +00:00
|
|
|
address = "fd00::1";
|
|
|
|
prefixLength = 64;
|
2024-12-10 19:26:33 +00:00
|
|
|
}
|
|
|
|
];
|
2021-11-05 05:30:45 +00:00
|
|
|
interfaces.eth1.ipv4.addresses = mkOverride 0 [
|
2024-12-10 19:26:33 +00:00
|
|
|
{
|
2021-11-05 05:30:45 +00:00
|
|
|
address = "192.168.1.1";
|
|
|
|
prefixLength = 24;
|
2024-12-10 19:26:33 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2021-11-05 05:30:45 +00:00
|
|
|
firewall.allowedTCPPorts = [ 8080 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
services.owncast = {
|
|
|
|
enable = true;
|
|
|
|
listen = "0.0.0.0";
|
2024-12-10 19:26:33 +00:00
|
|
|
};
|
2021-11-05 05:30:45 +00:00
|
|
|
};
|
2021-09-23 08:48:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
start_all()
|
2021-11-05 05:30:45 +00:00
|
|
|
|
2023-10-03 08:04:16 +00:00
|
|
|
client.systemctl("start network-online.target")
|
|
|
|
server.systemctl("start network-online.target")
|
2021-11-05 05:30:45 +00:00
|
|
|
client.wait_for_unit("network-online.target")
|
|
|
|
server.wait_for_unit("network-online.target")
|
|
|
|
server.wait_for_unit("owncast.service")
|
|
|
|
server.wait_until_succeeds("ss -ntl | grep -q 8080")
|
|
|
|
|
|
|
|
client.succeed("curl http://192.168.1.1:8080/api/status")
|
|
|
|
client.succeed("curl http://[fd00::1]:8080/api/status")
|
2021-09-23 08:48:29 +00:00
|
|
|
'';
|
2021-11-05 05:30:45 +00:00
|
|
|
}
|
|
|
|
)
|