summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/nclient4/lease_test.go
diff options
context:
space:
mode:
authorDennis Marttinen <twelho@welho.tech>2022-07-15 12:56:31 +0300
committerDennis Marttinen <twelho@welho.tech>2022-07-27 15:54:45 +0300
commitaeb78d02bd032611653400cd55e3331a1f839aa9 (patch)
treefb858be02bbd66b75273d4380bbcc4ec63e661aa /dhcpv4/nclient4/lease_test.go
parent0405526172c87e4fc75325c9a195834a8fb4ba94 (diff)
dhcpv4: add a client method to facilitate lease renewals
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
Diffstat (limited to 'dhcpv4/nclient4/lease_test.go')
-rw-r--r--dhcpv4/nclient4/lease_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/dhcpv4/nclient4/lease_test.go b/dhcpv4/nclient4/lease_test.go
index 361847f..d27eeca 100644
--- a/dhcpv4/nclient4/lease_test.go
+++ b/dhcpv4/nclient4/lease_test.go
@@ -1,4 +1,4 @@
-// this tests nclient4 with lease and release
+// this tests nclient4 with lease, renew and release
package nclient4
@@ -236,6 +236,14 @@ func (sll *testServerLeaseList) runTest(t *testing.T) {
sll.lastTestSvrErrLock.RLock()
keepgoing := chkerr(err, sll.lastTestSvrErr, l.ShouldFail, t)
sll.lastTestSvrErrLock.RUnlock()
+
+ if keepgoing {
+ err = clnt.Renew(context.Background(), lease)
+ sll.lastTestSvrErrLock.RLock()
+ keepgoing = chkerr(err, sll.lastTestSvrErr, l.ShouldFail, t)
+ sll.lastTestSvrErrLock.RUnlock()
+ }
+
if keepgoing {
err = clnt.Release(lease)
//this sleep is to make sure release is handled by server