diff options
author | Dennis Marttinen <twelho@welho.tech> | 2022-07-15 12:56:31 +0300 |
---|---|---|
committer | Dennis Marttinen <twelho@welho.tech> | 2022-07-27 15:54:45 +0300 |
commit | aeb78d02bd032611653400cd55e3331a1f839aa9 (patch) | |
tree | fb858be02bbd66b75273d4380bbcc4ec63e661aa /dhcpv4/server4/server_test.go | |
parent | 0405526172c87e4fc75325c9a195834a8fb4ba94 (diff) |
dhcpv4: add a client method to facilitate lease renewals
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
Diffstat (limited to 'dhcpv4/server4/server_test.go')
-rw-r--r-- | dhcpv4/server4/server_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dhcpv4/server4/server_test.go b/dhcpv4/server4/server_test.go index b3f6d9d..7be868c 100644 --- a/dhcpv4/server4/server_test.go +++ b/dhcpv4/server4/server_test.go @@ -115,6 +115,14 @@ func TestServer(t *testing.T) { require.Equal(t, xid, p.TransactionID) require.Equal(t, ifaces[0].HardwareAddr, p.ClientHWAddr) } + + err = c.Renew(context.Background(), lease, modifiers...) + require.NoError(t, err) + require.NotNil(t, lease.Offer, lease.ACK) + for _, p := range []*dhcpv4.DHCPv4{lease.Offer, lease.ACK} { + require.Equal(t, xid, p.TransactionID) + require.Equal(t, ifaces[0].HardwareAddr, p.ClientHWAddr) + } } func TestBadAddrFamily(t *testing.T) { |