summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-08-20 20:36:12 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-08-20 20:50:02 +0900
commitb249834bc322d724e6cfca0a20d521db3ab2c316 (patch)
tree9c6526b70a7b44b68ce588e371be31371164c707
parent5bd2a7c580e502a6c0a1e0f1279dba4b2008e707 (diff)
downloadsystemd-b249834bc322d724e6cfca0a20d521db3ab2c316.tar.gz
test-network: add test for issue #24377
The issue has been already fixed by b05e52000b4eee764b383cc3031da0a3739e996e (PR #24020).
-rw-r--r--test/test-network/conf/21-bond-802.3ad.netdev8
-rw-r--r--test/test-network/conf/21-bond-802.3ad.network8
-rw-r--r--test/test-network/conf/21-dummy-bond-slave.network7
-rw-r--r--test/test-network/conf/21-vlan-on-bond.netdev7
-rw-r--r--test/test-network/conf/21-vlan-on-bond.network8
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py25
6 files changed, 63 insertions, 0 deletions
diff --git a/test/test-network/conf/21-bond-802.3ad.netdev b/test/test-network/conf/21-bond-802.3ad.netdev
new file mode 100644
index 0000000000..ccb8228a95
--- /dev/null
+++ b/test/test-network/conf/21-bond-802.3ad.netdev
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[NetDev]
+Name=bond99
+Kind=bond
+
+[Bond]
+Mode=802.3ad
+TransmitHashPolicy=layer3+4
diff --git a/test/test-network/conf/21-bond-802.3ad.network b/test/test-network/conf/21-bond-802.3ad.network
new file mode 100644
index 0000000000..9bed020cce
--- /dev/null
+++ b/test/test-network/conf/21-bond-802.3ad.network
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Match]
+Name=bond99
+
+[Network]
+VLAN=vlan99
+BindCarrier=test1 dummy98
+LinkLocalAddressing=no
diff --git a/test/test-network/conf/21-dummy-bond-slave.network b/test/test-network/conf/21-dummy-bond-slave.network
new file mode 100644
index 0000000000..4c7c9d7ade
--- /dev/null
+++ b/test/test-network/conf/21-dummy-bond-slave.network
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Match]
+Name=test1
+Name=dummy98
+
+[Network]
+Bond=bond99
diff --git a/test/test-network/conf/21-vlan-on-bond.netdev b/test/test-network/conf/21-vlan-on-bond.netdev
new file mode 100644
index 0000000000..caa217aee9
--- /dev/null
+++ b/test/test-network/conf/21-vlan-on-bond.netdev
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[NetDev]
+Name=vlan99
+Kind=vlan
+
+[VLAN]
+Id=20
diff --git a/test/test-network/conf/21-vlan-on-bond.network b/test/test-network/conf/21-vlan-on-bond.network
new file mode 100644
index 0000000000..6536b7be51
--- /dev/null
+++ b/test/test-network/conf/21-vlan-on-bond.network
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Match]
+Name=vlan99
+
+[Network]
+IPv6AcceptRA=false
+Address=192.168.23.5/24
+LinkLocalAddressing=yes
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index d6625be9ff..284bc3146f 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -1199,6 +1199,31 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
print(output)
self.assertRegex(output, 'inet 192.168.23.5/24 brd 192.168.23.255 scope global vlan99')
+ def test_vlan_on_bond(self):
+ # For issue #24377 (https://github.com/systemd/systemd/issues/24377),
+ # which is fixed by b05e52000b4eee764b383cc3031da0a3739e996e (PR#24020).
+
+ copy_network_unit('21-bond-802.3ad.netdev', '21-bond-802.3ad.network',
+ '21-vlan-on-bond.netdev', '21-vlan-on-bond.network')
+ start_networkd()
+ self.wait_online(['bond99:off'])
+ self.wait_operstate('vlan99', operstate='off', setup_state='configuring', setup_timeout=10)
+
+ # The commit b05e52000b4eee764b383cc3031da0a3739e996e adds ", ignoring". To make it easily confirmed
+ # that the issue is fixed by the commit, let's allow to match both string.
+ log_re = re.compile('vlan99: Could not bring up interface(, ignoring|): Network is down$', re.MULTILINE)
+ for i in range(20):
+ if i > 0:
+ time.sleep(0.5)
+ if log_re.search(read_networkd_log()):
+ break
+ else:
+ self.fail()
+
+ copy_network_unit('11-dummy.netdev', '12-dummy.netdev', '21-dummy-bond-slave.network')
+ networkctl_reload()
+ self.wait_online(['test1:enslaved', 'dummy98:enslaved', 'bond99:carrier', 'vlan99:routable'])
+
def test_macvtap(self):
first = True
for mode in ['private', 'vepa', 'bridge', 'passthru']: