3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-18 17:22:50 +01:00
iwd/autotests/testNetconfig/dhcpd.conf
Andrew Zaborowski 187706c348 autotests: DHCPv4 renewal/resend test in testNetconfig
Test that the DHCPv4 lease got renewed after the T1 timer runs out.
Then also simulate the DHCPREQUEST during renew being lost and
retransmitted and the lease eventually getting renewed T1 + 60s later.

The main downside is that this test will inevitably take a while if
running in Qemu without the time travel ability.

Update the test and some utility code to run hostapd in an isolated net
namespace for connection_test.py.  We now need a second hostapd
instance though because in static_test.py we test ACD and we need to
produce an IP conflict.  Moving the hostapd instance unexpectedly fixes
dhcpd's internal mechanism to avoid IP conflicts and it would no longer
assign 192.168.1.10 to the second client, it'd notice that address was
already in use and assign the next free address, or fail if there was
none.  So add a second hostapd instance that runs in the main namespace
together with the statically-configured client, it turns out the test
relies on the kernel being unable to deliver IP traffic to interfaces on
the same system.
2022-07-12 12:47:09 -05:00

26 lines
1.0 KiB
ISCdhcpd

default-lease-time 120; # 2 minutes
min-lease-time 120; # 2 minutes
max-lease-time 120; # 2 minutes
option dhcp-renewal-time 15; # 15 secs for T1
# We set a relatively low lease lifetime of 2 minutes but our renewal interval
# (T1) is still unproportionally low to speed the test up -- 12% instead of the
# default 50% lifetime value. We need a lifetime in the order of minutes
# because minimum lease renewal retry interval is 60s per spec. However by
# default dhcpd will not renew leases that are newer than 25% their lifetime.
# Set that threshold to 1% so that we can verify that the lease is renewed
# without waiting too long.
dhcp-cache-threshold 1;
option broadcast-address 192.168.127.255;
option routers 192.168.1.254;
option subnet-mask 255.255.128.0;
subnet 192.168.0.0 netmask 255.255.128.0
{
option routers 192.168.1.1;
option subnet-mask 255.255.128.0;
option domain-name-servers 192.168.1.2;
range 192.168.1.10 192.168.1.20;
range 192.168.1.100 192.168.1.200;
}