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.systemctl("start network-online.target")
59 server.systemctl("start network-online.target")
60 client.wait_for_unit("network-online.target")
61 server.wait_for_unit("network-online.target")
62 server.wait_for_unit("ferm.service")
63 server.wait_for_unit("nginx.service")
64 server.wait_until_succeeds("ss -ntl | grep -q 80")
66 with subtest("port 80 is allowed"):
67 client.succeed("curl --fail -g http://192.168.1.1:80/status")
68 client.succeed("curl --fail -g http://[fd00::1]:80/status")
70 with subtest("port 8080 is not allowed"):
71 server.succeed("curl --fail -g http://192.168.1.1:8080/status")
72 server.succeed("curl --fail -g http://[fd00::1]:8080/status")
74 client.fail("curl --fail -g http://192.168.1.1:8080/status")
75 client.fail("curl --fail -g http://[fd00::1]:8080/status")