at 25.11-pre 1.9 kB view raw
1import ./make-test-python.nix ( 2 { pkgs, lib, ... }: 3 { 4 name = "ndppd"; 5 meta = with pkgs.lib.maintainers; { 6 maintainers = [ fpletz ]; 7 }; 8 9 nodes = { 10 upstream = 11 { pkgs, ... }: 12 { 13 environment.systemPackages = [ pkgs.tcpdump ]; 14 networking.useDHCP = false; 15 networking.interfaces = { 16 eth1 = { 17 ipv6.addresses = [ 18 { 19 address = "fd23::1"; 20 prefixLength = 112; 21 } 22 ]; 23 ipv6.routes = [ 24 { 25 address = "fd42::"; 26 prefixLength = 112; 27 } 28 ]; 29 }; 30 }; 31 }; 32 server = 33 { pkgs, ... }: 34 { 35 boot.kernel.sysctl = { 36 "net.ipv6.conf.all.forwarding" = "1"; 37 "net.ipv6.conf.default.forwarding" = "1"; 38 }; 39 environment.systemPackages = [ pkgs.tcpdump ]; 40 networking.useDHCP = false; 41 networking.interfaces = { 42 eth1 = { 43 ipv6.addresses = [ 44 { 45 address = "fd23::2"; 46 prefixLength = 112; 47 } 48 ]; 49 }; 50 }; 51 services.ndppd = { 52 enable = true; 53 proxies.eth1.rules."fd42::/112" = { }; 54 }; 55 containers.client = { 56 autoStart = true; 57 privateNetwork = true; 58 hostAddress = "192.168.255.1"; 59 localAddress = "192.168.255.2"; 60 hostAddress6 = "fd42::1"; 61 localAddress6 = "fd42::2"; 62 config = { }; 63 }; 64 }; 65 }; 66 67 testScript = '' 68 start_all() 69 server.wait_for_unit("multi-user.target") 70 upstream.wait_for_unit("multi-user.target") 71 upstream.wait_until_succeeds("ping -c5 fd42::2") 72 ''; 73 } 74)