test-network: add test for small MTU for vcan

Prompted by https://github.com/systemd/systemd/issues/30140#issuecomment-1837973580.
This commit is contained in:
Yu Watanabe 2023-12-06 14:55:03 +09:00
parent 941f8e1399
commit 470a329d98
4 changed files with 23 additions and 2 deletions

View file

@ -2,3 +2,4 @@
[NetDev]
Name=vcan99
Kind=vcan
MTUBytes=16

View file

@ -0,0 +1,4 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[NetDev]
Name=vcan98
Kind=vcan

View file

@ -0,0 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Match]
Name=vcan98
[Link]
MTUBytes=16

View file

@ -1725,10 +1725,20 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
@expectedFailureIfModuleIsNotAvailable('vcan')
def test_vcan(self):
copy_network_unit('25-vcan.netdev', '26-netdev-link-local-addressing-yes.network')
copy_network_unit('25-vcan.netdev', '26-netdev-link-local-addressing-yes.network',
'25-vcan98.netdev', '25-vcan98.network')
start_networkd()
self.wait_online(['vcan99:carrier'])
self.wait_online(['vcan99:carrier', 'vcan98:carrier'])
# https://github.com/systemd/systemd/issues/30140
output = check_output('ip -d link show vcan99')
print(output)
self.assertIn('mtu 16 ', output)
output = check_output('ip -d link show vcan98')
print(output)
self.assertIn('mtu 16 ', output)
@expectedFailureIfModuleIsNotAvailable('vxcan')
def test_vxcan(self):