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