mirror of
https://github.com/systemd/systemd.git
synced 2024-12-25 01:34:28 +03:00
test-network: add test for issue #24377
The issue has been already fixed by
b05e52000b
(PR #24020).
This commit is contained in:
parent
5bd2a7c580
commit
b249834bc3
8
test/test-network/conf/21-bond-802.3ad.netdev
Normal file
8
test/test-network/conf/21-bond-802.3ad.netdev
Normal file
@ -0,0 +1,8 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
[NetDev]
|
||||
Name=bond99
|
||||
Kind=bond
|
||||
|
||||
[Bond]
|
||||
Mode=802.3ad
|
||||
TransmitHashPolicy=layer3+4
|
8
test/test-network/conf/21-bond-802.3ad.network
Normal file
8
test/test-network/conf/21-bond-802.3ad.network
Normal file
@ -0,0 +1,8 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
[Match]
|
||||
Name=bond99
|
||||
|
||||
[Network]
|
||||
VLAN=vlan99
|
||||
BindCarrier=test1 dummy98
|
||||
LinkLocalAddressing=no
|
7
test/test-network/conf/21-dummy-bond-slave.network
Normal file
7
test/test-network/conf/21-dummy-bond-slave.network
Normal file
@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
[Match]
|
||||
Name=test1
|
||||
Name=dummy98
|
||||
|
||||
[Network]
|
||||
Bond=bond99
|
7
test/test-network/conf/21-vlan-on-bond.netdev
Normal file
7
test/test-network/conf/21-vlan-on-bond.netdev
Normal file
@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
[NetDev]
|
||||
Name=vlan99
|
||||
Kind=vlan
|
||||
|
||||
[VLAN]
|
||||
Id=20
|
8
test/test-network/conf/21-vlan-on-bond.network
Normal file
8
test/test-network/conf/21-vlan-on-bond.network
Normal file
@ -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
|
@ -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']:
|
||||
|
Loading…
Reference in New Issue
Block a user