2 import ./make-test-python.nix ({ pkgs, ...} : {
4 meta = with pkgs.lib.maintainers; {
5 maintainers = [ mic92 ];
14 dhcpcd.enable = false;
15 interfaces.eth1.ipv6.addresses = mkOverride 0 [ { address = "fd00::2"; prefixLength = 64; } ];
16 interfaces.eth1.ipv4.addresses = mkOverride 0 [ { address = "192.168.1.2"; prefixLength = 24; } ];
24 dhcpcd.enable = false;
27 interfaces.eth1.ipv6.addresses = mkOverride 0 [ { address = "fd00::1"; prefixLength = 64; } ];
28 interfaces.eth1.ipv4.addresses = mkOverride 0 [ { address = "192.168.1.1"; prefixLength = 24; } ];
34 domain (ip ip6) table filter chain INPUT {
36 proto tcp dport 8080 REJECT reject-with tcp-reset;
47 location /status { stub_status on; }
58 client.wait_for_unit("network-online.target")
59 server.wait_for_unit("network-online.target")
60 server.wait_for_unit("ferm.service")
61 server.wait_for_unit("nginx.service")
62 server.wait_until_succeeds("ss -ntl | grep -q 80")
64 with subtest("port 80 is allowed"):
65 client.succeed("curl --fail -g http://192.168.1.1:80/status")
66 client.succeed("curl --fail -g http://[fd00::1]:80/status")
68 with subtest("port 8080 is not allowed"):
69 server.succeed("curl --fail -g http://192.168.1.1:8080/status")
70 server.succeed("curl --fail -g http://[fd00::1]:8080/status")
72 client.fail("curl --fail -g http://192.168.1.1:8080/status")
73 client.fail("curl --fail -g http://[fd00::1]:8080/status")