mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-12 08:58:20 +03:00
test-network: add a test case for DHCPv4.SendDecline=
This commit is contained in:
parent
c1d3fa29ca
commit
0fd8b71809
9
test/test-network/conf/dhcp-client-decline.network
Normal file
9
test/test-network/conf/dhcp-client-decline.network
Normal file
@ -0,0 +1,9 @@
|
||||
[Match]
|
||||
Name=veth99
|
||||
|
||||
[Network]
|
||||
DHCP=ipv4
|
||||
IPv6AcceptRA=false
|
||||
|
||||
[DHCPv4]
|
||||
SendDecline=yes
|
14
test/test-network/conf/dhcp-server-decline.network
Normal file
14
test/test-network/conf/dhcp-server-decline.network
Normal file
@ -0,0 +1,14 @@
|
||||
[Match]
|
||||
Name=veth-peer
|
||||
|
||||
[Network]
|
||||
Address=192.168.5.1/24
|
||||
Address=192.168.5.10/24
|
||||
IPv6AcceptRA=false
|
||||
DHCPServer=yes
|
||||
|
||||
[DHCPServer]
|
||||
PoolOffset=10
|
||||
PoolSize=1
|
||||
DNS=192.168.5.1
|
||||
NTP=192.168.5.1
|
@ -2632,6 +2632,7 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
|
||||
'25-vrf.netdev',
|
||||
'25-vrf.network',
|
||||
'dhcp-client-anonymize.network',
|
||||
'dhcp-client-decline.network',
|
||||
'dhcp-client-gateway-onlink-implicit.network',
|
||||
'dhcp-client-ipv4-dhcp-settings.network',
|
||||
'dhcp-client-ipv4-only-ipv6-disabled.network',
|
||||
@ -2656,6 +2657,7 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
|
||||
'dhcp-client-with-ipv4ll-fallback-without-dhcp-server.network',
|
||||
'dhcp-client-with-static-address.network',
|
||||
'dhcp-client.network',
|
||||
'dhcp-server-decline.network',
|
||||
'dhcp-server-veth-peer.network',
|
||||
'dhcp-v4-server-veth-peer.network',
|
||||
'dhcp-client-use-domains.network',
|
||||
@ -3328,6 +3330,14 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
|
||||
print(output)
|
||||
self.assertRegex(output, 'example.com')
|
||||
|
||||
def test_dhcp_client_decline(self):
|
||||
copy_unit_to_networkd_unit_path('25-veth.netdev', 'dhcp-server-decline.network', 'dhcp-client-decline.network')
|
||||
|
||||
start_networkd()
|
||||
self.wait_online(['veth-peer:carrier'])
|
||||
rc = call(*wait_online_cmd, '--timeout=10s', '--interface=veth99:routable', env=env)
|
||||
self.assertTrue(rc == 1)
|
||||
|
||||
class NetworkdIPv6PrefixTests(unittest.TestCase, Utilities):
|
||||
links = ['veth99']
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user