nixos/tests/networking: test nameservers via DHCP

This commit is contained in:
rnhmjoj 2023-12-25 00:54:46 +01:00
parent aff5d1d523
commit bad5251e87
No known key found for this signature in database
GPG Key ID: BFBAF4C975F76450
3 changed files with 6 additions and 0 deletions

View File

@ -132,6 +132,10 @@ let
client.wait_until_succeeds("ip addr show dev enp2s0 | grep -q '192.168.2'")
client.wait_until_succeeds("ip addr show dev enp2s0 | grep -q 'fd00:1234:5678:2:'")
with subtest("Wait until we have received the nameservers"):
client.wait_until_succeeds("grep -q 2001:db8::1 /etc/resolv.conf")
client.wait_until_succeeds("grep -q 192.168.2.1 /etc/resolv.conf")
with subtest("Test vlan 1"):
client.wait_until_succeeds("ping -c 1 192.168.1.1")
client.wait_until_succeeds("ping -c 1 fd00:1234:5678:1::1")

View File

@ -121,6 +121,7 @@ let
static.wait_for_unit("NetworkManager.service")
dynamic.wait_until_succeeds("cat /etc/resolv.conf | grep -q '192.168.1.1'")
dynamic.wait_until_succeeds("cat /etc/resolv.conf | grep -q '2001:db8::1'")
static.wait_until_succeeds("cat /etc/resolv.conf | grep -q '10.10.10.10'")
static.wait_until_fails("cat /etc/resolv.conf | grep -q '192.168.1.1'")
'';

View File

@ -72,6 +72,7 @@
AdvSendAdvert on;
AdvManagedFlag on;
AdvOtherConfigFlag on;
RDNSS 2001:db8::1 {};
prefix fd00:1234:5678:${toString n}::/64 {
AdvAutonomous off;