dnsmasq's internal knowledge about the leases is hidden in memory.
For that reason, we use a --dhcp-script to persistently mirror this state in the auth_dhcp_leases table (also for unauth).
Furthermore, dnsmasq bootstraps this state by passing said script the init command.
To ensure correctness of this synchronization, we should add unit tests for the lease_server.
Mainly, this means extending test stubs like the following:
|
def test_add_lease(): |
|
pass |
The lease server is not completely untested, however: Some bats tests check whether the lease invalidation on refresh works correctly, which at least uses
- the capability of dnsmasq to correctly reconstruct the lease state using the
init command
- the capability of the lease server to accept the
delete command and delete the corresponding row in the leases table
dnsmasq's internal knowledge about the leases is hidden in memory.
For that reason, we use a
--dhcp-scriptto persistently mirror this state in theauth_dhcp_leasestable (also for unauth).Furthermore, dnsmasq bootstraps this state by passing said script the
initcommand.To ensure correctness of this synchronization, we should add unit tests for the
lease_server.Mainly, this means extending test stubs like the following:
hades/tests/test_lease_sync.py
Lines 69 to 70 in d8a48d4
The lease server is not completely untested, however: Some bats tests check whether the lease invalidation on refresh works correctly, which at least uses
initcommanddeletecommand and delete the corresponding row in the leases table