summaryrefslogtreecommitdiffstats
path: root/test/test-network
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-12-06 06:55:03 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-12-08 02:47:42 +0100
commit470a329d9849d108e28f72d00dd130d130cebb01 (patch)
treebd5aa9792051cfce2b0384c4ee903f8c6f88383a /test/test-network
parentnetwork: allow to configure interface MTU for CAN devices (diff)
downloadsystemd-470a329d9849d108e28f72d00dd130d130cebb01.tar.xz
systemd-470a329d9849d108e28f72d00dd130d130cebb01.zip
test-network: add test for small MTU for vcan
Prompted by https://github.com/systemd/systemd/issues/30140#issuecomment-1837973580.
Diffstat (limited to 'test/test-network')
-rw-r--r--test/test-network/conf/25-vcan.netdev1
-rw-r--r--test/test-network/conf/25-vcan98.netdev4
-rw-r--r--test/test-network/conf/25-vcan98.network6
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py14
4 files changed, 23 insertions, 2 deletions
diff --git a/test/test-network/conf/25-vcan.netdev b/test/test-network/conf/25-vcan.netdev
index 29bd98e5c9..2762dd2374 100644
--- a/test/test-network/conf/25-vcan.netdev
+++ b/test/test-network/conf/25-vcan.netdev
@@ -2,3 +2,4 @@
[NetDev]
Name=vcan99
Kind=vcan
+MTUBytes=16
diff --git a/test/test-network/conf/25-vcan98.netdev b/test/test-network/conf/25-vcan98.netdev
new file mode 100644
index 0000000000..5333c82da4
--- /dev/null
+++ b/test/test-network/conf/25-vcan98.netdev
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[NetDev]
+Name=vcan98
+Kind=vcan
diff --git a/test/test-network/conf/25-vcan98.network b/test/test-network/conf/25-vcan98.network
new file mode 100644
index 0000000000..97f824d244
--- /dev/null
+++ b/test/test-network/conf/25-vcan98.network
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Match]
+Name=vcan98
+
+[Link]
+MTUBytes=16
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index 8ffcda37ed..a9fde69023 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -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):