test-network: add tests for BridgeFDB.Destination=
This commit is contained in:
parent
c2c2793f39
commit
1c862fe05a
6
test/test-network/conf/vxlan-test1.network
Normal file
6
test/test-network/conf/vxlan-test1.network
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[Match]
|
||||||
|
Name=test1
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
IPv6AcceptRA=false
|
||||||
|
VXLAN=vxlan99
|
|
@ -1,5 +1,17 @@
|
||||||
[Match]
|
[Match]
|
||||||
Name=test1
|
Name=vxlan99
|
||||||
|
|
||||||
[Network]
|
[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
|
||||||
|
|
|
@ -331,6 +331,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
|
||||||
'sit.network',
|
'sit.network',
|
||||||
'vti6.network',
|
'vti6.network',
|
||||||
'vti.network',
|
'vti.network',
|
||||||
|
'vxlan-test1.network',
|
||||||
'vxlan.network']
|
'vxlan.network']
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -861,14 +862,15 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
|
||||||
subprocess.call(['ip', 'fou', 'del', 'port', '55556'])
|
subprocess.call(['ip', 'fou', 'del', 'port', '55556'])
|
||||||
|
|
||||||
def test_vxlan(self):
|
def test_vxlan(self):
|
||||||
self.copy_unit_to_networkd_unit_path('25-vxlan.netdev', 'vxlan.network', '11-dummy.netdev')
|
self.copy_unit_to_networkd_unit_path('25-vxlan.netdev', 'vxlan.network',
|
||||||
self.start_networkd()
|
'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')
|
output = subprocess.check_output(['ip', '-d', 'link', 'show', 'vxlan99']).rstrip().decode('utf-8')
|
||||||
print(output)
|
print(output)
|
||||||
self.assertRegex(output, "999")
|
self.assertRegex(output, '999')
|
||||||
self.assertRegex(output, '5555')
|
self.assertRegex(output, '5555')
|
||||||
self.assertRegex(output, 'l2miss')
|
self.assertRegex(output, 'l2miss')
|
||||||
self.assertRegex(output, 'l3miss')
|
self.assertRegex(output, 'l3miss')
|
||||||
|
@ -879,6 +881,12 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
|
||||||
self.assertRegex(output, 'remcsumrx')
|
self.assertRegex(output, 'remcsumrx')
|
||||||
self.assertRegex(output, 'gbp')
|
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):
|
def test_macsec(self):
|
||||||
self.copy_unit_to_networkd_unit_path('25-macsec.netdev', '25-macsec.network', '25-macsec.key',
|
self.copy_unit_to_networkd_unit_path('25-macsec.netdev', '25-macsec.network', '25-macsec.key',
|
||||||
'macsec.network', '12-dummy.netdev')
|
'macsec.network', '12-dummy.netdev')
|
||||||
|
|
Loading…
Reference in a new issue