1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

test-network: add testcase that Neighbor.LinkLayerAddress= is IP address

This commit is contained in:
Yu Watanabe 2019-07-11 03:26:30 +09:00
parent d86f5c194c
commit 74761cf37e
3 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,6 @@
[Match]
Name=dummy98
[Network]
IPv6AcceptRA=no
Tunnel=gretun97

View File

@ -0,0 +1,10 @@
[Match]
Name=gretun97
[Network]
IPv6AcceptRA=no
Address=10.0.0.21
[Neighbor]
Address=10.0.0.22
LinkLayerAddress=10.65.223.239

View File

@ -1376,7 +1376,9 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
'bond199',
'dummy98',
'dummy99',
'test1']
'gretun97',
'test1'
]
units = [
'11-dummy.netdev',
@ -1391,8 +1393,11 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
'25-bond-active-backup-slave.netdev',
'25-fibrule-invert.network',
'25-fibrule-port-range.network',
'25-gre-tunnel-remote-any.netdev',
'25-ipv6-address-label-section.network',
'25-neighbor-section.network',
'25-neighbor-ip-dummy.network',
'25-neighbor-ip.network',
'25-link-local-addressing-no.network',
'25-link-local-addressing-yes.network',
'25-link-section-unmanaged.network',
@ -1630,6 +1635,16 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
self.assertRegex(output, '192.168.10.1.*00:00:5e:00:02:65.*PERMANENT')
self.assertRegex(output, '2004:da8:1::1.*00:00:5e:00:02:66.*PERMANENT')
def test_neighbor_gre(self):
copy_unit_to_networkd_unit_path('25-neighbor-ip.network', '25-neighbor-ip-dummy.network',
'12-dummy.netdev', '25-gre-tunnel-remote-any.netdev')
start_networkd()
wait_online(['dummy98:degraded', 'gretun97:routable'], timeout='40s')
output = check_output('ip neigh list dev gretun97')
print(output)
self.assertRegex(output, '10.0.0.22 lladdr 10.65.223.239 PERMANENT')
def test_link_local_addressing(self):
copy_unit_to_networkd_unit_path('25-link-local-addressing-yes.network', '11-dummy.netdev',
'25-link-local-addressing-no.network', '12-dummy.netdev')