Skip to content

Commit 073a356

Browse files
authored
Merge pull request #1 from secshellnet/test/radvd
tests/radvd: init
2 parents 3c71f7b + f5811e1 commit 073a356

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

tests/radvd/default.nix

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{ lib, ... }:
2+
{
3+
name = "radvd";
4+
5+
defaults = {
6+
networking.interfaces.eth1 = {
7+
ipv4.addresses = lib.mkForce [ ];
8+
ipv6.addresses = lib.mkForce [ ];
9+
};
10+
};
11+
12+
nodes = {
13+
a = {
14+
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1;
15+
16+
services.radvd = {
17+
enable = true;
18+
config = ''
19+
interface eth1 {
20+
AdvSendAdvert on;
21+
prefix 2001:db8:bad:c0de::/64 {
22+
AdvOnLink on;
23+
AdvAutonomous on;
24+
};
25+
};
26+
'';
27+
};
28+
};
29+
b = { };
30+
};
31+
32+
testScript = ''
33+
start_all()
34+
35+
a.wait_for_unit("network.target")
36+
b.wait_for_unit("network.target")
37+
38+
a.wait_for_unit("radvd.service")
39+
40+
b.wait_until_succeeds("ip -6 a sh eth1 | grep 2001:db8:bad:c0de:")
41+
42+
# wait for ipv6 dad to finish (initial ! causes the exit status to be negated)
43+
b.wait_until_succeeds("! ip -6 a sh eth1 | grep tentative")
44+
45+
print(b.succeed("ip -6 address show eth1"))
46+
print(b.succeed("ip -6 route"))
47+
'';
48+
}

0 commit comments

Comments
 (0)