tlaternet-webserver/nix/checks/open-homepage.nix

36 lines
554 B
Nix

{
self,
nixosTest,
}:
nixosTest {
nodes = {
host = {
config,
lib,
pkgs,
...
}: {
imports = [self.nixosModules.default];
services.tlaternet-webserver = {
enable = true;
listen = {
addr = "0.0.0.0";
port = 8000;
};
};
networking.firewall.allowedTCPPorts = [8000];
};
client = {pkgs, ...}: {};
};
testScript = ''
start_all()
host.wait_for_unit("default.target")
client.succeed("curl --fail http://host:8000/ >&2")
'';
}