summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2019-02-02 16:05:12 +0100
committerelseym <elseym@me.com>2019-02-03 13:21:07 +0100
commitf1b91b5726c901ccb7056836d0882c7532883b36 (patch)
treeb55be98335ebc851c8aa2a76e4632e34d4d0c79e /nixos
parent56b79124cacacb4d30f9aa24cad720806b4d363b (diff)
downloadnixpkgs-f1b91b5726c901ccb7056836d0882c7532883b36.tar
nixpkgs-f1b91b5726c901ccb7056836d0882c7532883b36.tar.gz
nixpkgs-f1b91b5726c901ccb7056836d0882c7532883b36.tar.bz2
nixpkgs-f1b91b5726c901ccb7056836d0882c7532883b36.tar.lz
nixpkgs-f1b91b5726c901ccb7056836d0882c7532883b36.tar.xz
nixpkgs-f1b91b5726c901ccb7056836d0882c7532883b36.tar.zst
nixpkgs-f1b91b5726c901ccb7056836d0882c7532883b36.zip
nixos/tests: add ndppd test
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/ndppd.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/nixos/tests/ndppd.nix b/nixos/tests/ndppd.nix
new file mode 100644
index 00000000000..9f24eb6d9d4
--- /dev/null
+++ b/nixos/tests/ndppd.nix
@@ -0,0 +1,61 @@
+import ./make-test.nix ({ pkgs, lib, ...} : {
+  name = "ndppd";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ fpletz ];
+  };
+
+  nodes = {
+    upstream = { pkgs, ... }: {
+      environment.systemPackages = [ pkgs.tcpdump ];
+      networking.useDHCP = false;
+      networking.interfaces = {
+        eth1 = {
+          ipv6.addresses = [
+            { address = "fd23::1"; prefixLength = 112; }
+          ];
+          ipv6.routes = [
+            { address = "fd42::";
+              prefixLength = 112;
+            }
+          ];
+        };
+      };
+    };
+    server = { pkgs, ... }: {
+      boot.kernel.sysctl = {
+        "net.ipv6.conf.all.forwarding" = "1";
+        "net.ipv6.conf.default.forwarding" = "1";
+      };
+      environment.systemPackages = [ pkgs.tcpdump ];
+      networking.useDHCP = false;
+      networking.interfaces = {
+        eth1 = {
+          ipv6.addresses = [
+            { address = "fd23::2"; prefixLength = 112; }
+          ];
+        };
+      };
+      services.ndppd = {
+        enable = true;
+        interface = "eth1";
+        network = "fd42::/112";
+      };
+      containers.client = {
+        autoStart = true;
+        privateNetwork = true;
+        hostAddress = "192.168.255.1";
+        localAddress = "192.168.255.2";
+        hostAddress6 = "fd42::1";
+        localAddress6 = "fd42::2";
+        config = {};
+      };
+    };
+  };
+
+  testScript = ''
+    startAll;
+    $server->waitForUnit("multi-user.target");
+    $upstream->waitForUnit("multi-user.target");
+    $upstream->waitUntilSucceeds("ping -c5 fd42::2");
+  '';
+})