Skip to content

Commit d87db44

Browse files
committed
test-network: add test case for IPv4 DAD
1 parent 52a3de9 commit d87db44

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Match]
2+
Name=veth-peer
3+
4+
[Network]
5+
IPv6AcceptRA=no
6+
7+
[Address]
8+
Address=192.168.100.10/24
9+
DuplicateAddressDetection=ipv4
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Match]
2+
Name=veth99
3+
4+
[Network]
5+
IPv6AcceptRA=no
6+
7+
[Address]
8+
Address=192.168.100.10/24

test/test-network/systemd-networkd-tests.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,8 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
14791479
'23-active-slave.network',
14801480
'24-keep-configuration-static.network',
14811481
'24-search-domain.network',
1482+
'25-address-dad-veth-peer.network',
1483+
'25-address-dad-veth99.network',
14821484
'25-address-link-section.network',
14831485
'25-address-preferred-lifetime-zero.network',
14841486
'25-address-static.network',
@@ -1581,6 +1583,20 @@ def test_address_preferred_lifetime_zero_ipv6(self):
15811583
print(output)
15821584
self.assertRegex(output, 'default via 20.20.20.1 proto static')
15831585

1586+
def test_address_dad(self):
1587+
copy_unit_to_networkd_unit_path('25-address-dad-veth99.network', '25-address-dad-veth-peer.network',
1588+
'25-veth.netdev')
1589+
start_networkd()
1590+
self.wait_online(['veth99:routable', 'veth-peer:degraded'])
1591+
1592+
output = check_output('ip -4 address show dev veth99')
1593+
print(output)
1594+
self.assertRegex(output, '192.168.100.10/24')
1595+
1596+
output = check_output('ip -4 address show dev veth-peer')
1597+
print(output)
1598+
self.assertNotRegex(output, '192.168.100.10/24')
1599+
15841600
def test_configure_without_carrier(self):
15851601
copy_unit_to_networkd_unit_path('configure-without-carrier.network', '11-dummy.netdev')
15861602
start_networkd()

0 commit comments

Comments
 (0)