Skip to content

Commit

Permalink
nixos/tests: add ndppd test
Browse files Browse the repository at this point in the history
(cherry picked from commit f1b91b5)
Signed-off-by: Maximilian Bosch <maximilian@mbosch.me>
  • Loading branch information
fpletz authored and Ma27 committed Feb 4, 2019
1 parent d4a1e89 commit 43d2810
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions 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");
'';
})

0 comments on commit 43d2810

Please sign in to comment.