Pull request: all: imp dhcp host normalization, validation
Updates #2952. Squashed commit of the following: commit 45afcab5d33c1ec8176c0ad05423288c8770b772 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 20 15:02:34 2021 +0300 all: imp docs commit d844ce1e2bb0b92a892119161774ec95f3e59711 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 20 14:57:49 2021 +0300 all: more code imp commit eef08cb69015ead0ffaef866e12a2c6556786d37 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 20 14:52:33 2021 +0300 all: imp code, docs commit 20748f20ab9fcc410b11daf0e23eaf156dcdc7cd Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 20 14:30:57 2021 +0300 all: imp dhcp host normalization, validation
This commit is contained in:
@@ -157,7 +157,7 @@ func TestV4StaticLease_Get(t *testing.T) {
|
||||
assert.True(t, l.IP.Equal(resp.YourIPAddr))
|
||||
assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0]))
|
||||
assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier()))
|
||||
assert.Equal(t, s.conf.subnetMask, resp.SubnetMask())
|
||||
assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask())
|
||||
assert.Equal(t, s.conf.leaseTime.Seconds(), resp.IPAddressLeaseTime(-1).Seconds())
|
||||
})
|
||||
|
||||
@@ -179,7 +179,7 @@ func TestV4StaticLease_Get(t *testing.T) {
|
||||
assert.True(t, l.IP.Equal(resp.YourIPAddr))
|
||||
assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0]))
|
||||
assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier()))
|
||||
assert.Equal(t, s.conf.subnetMask, resp.SubnetMask())
|
||||
assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask())
|
||||
assert.Equal(t, s.conf.leaseTime.Seconds(), resp.IPAddressLeaseTime(-1).Seconds())
|
||||
})
|
||||
|
||||
@@ -246,7 +246,7 @@ func TestV4DynamicLease_Get(t *testing.T) {
|
||||
|
||||
assert.Equal(t, s.conf.GatewayIP, router[0])
|
||||
|
||||
assert.Equal(t, s.conf.subnetMask, resp.SubnetMask())
|
||||
assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask())
|
||||
assert.Equal(t, s.conf.leaseTime.Seconds(), resp.IPAddressLeaseTime(-1).Seconds())
|
||||
assert.Equal(t, []byte("012"), resp.Options[uint8(dhcpv4.OptionFQDN)])
|
||||
|
||||
@@ -271,7 +271,7 @@ func TestV4DynamicLease_Get(t *testing.T) {
|
||||
assert.True(t, s.conf.RangeStart.Equal(resp.YourIPAddr))
|
||||
assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0]))
|
||||
assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier()))
|
||||
assert.Equal(t, s.conf.subnetMask, resp.SubnetMask())
|
||||
assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask())
|
||||
assert.Equal(t, s.conf.leaseTime.Seconds(), resp.IPAddressLeaseTime(-1).Seconds())
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user