test-network: add tests for BridgeFDB.Destination=

This commit is contained in:
Yu Watanabe 2019-05-03 06:08:55 +02:00
parent c2c2793f39
commit 1c862fe05a
3 changed files with 32 additions and 6 deletions

View File

@ -0,0 +1,6 @@
[Match]
Name=test1
[Network]
IPv6AcceptRA=false
VXLAN=vxlan99

View File

@ -1,5 +1,17 @@
[Match]
Name=test1
Name=vxlan99
[Network]
VXLAN=vxlan99
IPv6AcceptRA=no
[BridgeFDB]
MACAddress=00:11:22:33:44:55
Destination=10.0.0.5
[BridgeFDB]
MACAddress=00:11:22:33:44:66
Destination=10.0.0.6
[BridgeFDB]
MACAddress=00:11:22:33:44:77
Destination=10.0.0.7

View File

@ -331,6 +331,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
'sit.network',
'vti6.network',
'vti.network',
'vxlan-test1.network',
'vxlan.network']
def setUp(self):
@ -861,14 +862,15 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
subprocess.call(['ip', 'fou', 'del', 'port', '55556'])
def test_vxlan(self):
self.copy_unit_to_networkd_unit_path('25-vxlan.netdev', 'vxlan.network', '11-dummy.netdev')
self.start_networkd()
self.copy_unit_to_networkd_unit_path('25-vxlan.netdev', 'vxlan.network',
'11-dummy.netdev', 'vxlan-test1.network')
self.start_networkd(0)
self.assertTrue(self.link_exits('vxlan99'))
self.wait_online(['test1:degraded', 'vxlan99:degraded'])
output = subprocess.check_output(['ip', '-d', 'link', 'show', 'vxlan99']).rstrip().decode('utf-8')
print(output)
self.assertRegex(output, "999")
self.assertRegex(output, '999')
self.assertRegex(output, '5555')
self.assertRegex(output, 'l2miss')
self.assertRegex(output, 'l3miss')
@ -879,6 +881,12 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
self.assertRegex(output, 'remcsumrx')
self.assertRegex(output, 'gbp')
output = subprocess.check_output(['bridge', 'fdb', 'show', 'dev', 'vxlan99']).rstrip().decode('utf-8')
print(output)
self.assertRegex(output, '00:11:22:33:44:55 dst 10.0.0.5 self permanent')
self.assertRegex(output, '00:11:22:33:44:66 dst 10.0.0.6 self permanent')
self.assertRegex(output, '00:11:22:33:44:77 dst 10.0.0.7 self permanent')
def test_macsec(self):
self.copy_unit_to_networkd_unit_path('25-macsec.netdev', '25-macsec.network', '25-macsec.key',
'macsec.network', '12-dummy.netdev')