mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
test-network: add simple test case for DHCP relay on bridge interface
For issue #30763.
This commit is contained in:
parent
3db1e6a874
commit
a663ddc04e
7
test/test-network/conf/25-agent-bridge-port.network
Normal file
7
test/test-network/conf/25-agent-bridge-port.network
Normal file
@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
[Match]
|
||||
Name=client-peer
|
||||
|
||||
[Network]
|
||||
Bridge=bridge-relay
|
||||
IPv6AcceptRA=no
|
4
test/test-network/conf/25-agent-bridge.netdev
Normal file
4
test/test-network/conf/25-agent-bridge.netdev
Normal file
@ -0,0 +1,4 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
[NetDev]
|
||||
Name=bridge-relay
|
||||
Kind=bridge
|
12
test/test-network/conf/25-agent-bridge.network
Normal file
12
test/test-network/conf/25-agent-bridge.network
Normal file
@ -0,0 +1,12 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
[Match]
|
||||
Name=bridge-relay
|
||||
|
||||
[Network]
|
||||
Address=192.168.2.1/24
|
||||
DHCPServer=yes
|
||||
IPv6AcceptRA=no
|
||||
|
||||
[DHCPServer]
|
||||
RelayTarget=192.168.1.1
|
||||
RelayAgentRemoteId=string:aabbccdd
|
@ -5380,6 +5380,24 @@ class NetworkdDHCPServerRelayAgentTests(unittest.TestCase, Utilities):
|
||||
print(output)
|
||||
self.assertRegex(output, r'Address: 192.168.5.150 \(DHCP4 via 192.168.5.1\)')
|
||||
|
||||
def test_replay_agent_on_bridge(self):
|
||||
copy_network_unit('25-agent-bridge.netdev',
|
||||
'25-agent-veth-client.netdev',
|
||||
'25-agent-bridge.network',
|
||||
'25-agent-bridge-port.network',
|
||||
'25-agent-client.network')
|
||||
start_networkd()
|
||||
self.wait_online(['bridge-relay:routable', 'client-peer:enslaved'])
|
||||
|
||||
# For issue #30763.
|
||||
expect = 'bridge-relay: DHCPv4 server: STARTED'
|
||||
for _ in range(20):
|
||||
if expect in read_networkd_log():
|
||||
break
|
||||
time.sleep(0.5)
|
||||
else:
|
||||
self.fail()
|
||||
|
||||
class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
|
||||
|
||||
def setUp(self):
|
||||
|
Loading…
Reference in New Issue
Block a user