summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2022-10-01 13:31:46 +0100
committerGitHub <noreply@github.com>2022-10-01 13:31:46 +0100
commit17a7e45e47326931084145a08aaeb1470f6504dd (patch)
tree881781bc351b044f902a4b3504f0bf8452a9c6e9
parent18231451f3d97ab8e78fbad5d7e281af294d38d0 (diff)
parent5293afb5278e6cb951023c406e6b9256addc02fb (diff)
Merge pull request #480 from twelho/newinform-modifier-test
dhcpv4: add test for NewInform() with modifiers
-rw-r--r--dhcpv4/dhcpv4_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/dhcpv4/dhcpv4_test.go b/dhcpv4/dhcpv4_test.go
index eff7a71..d2d6edd 100644
--- a/dhcpv4/dhcpv4_test.go
+++ b/dhcpv4/dhcpv4_test.go
@@ -355,6 +355,16 @@ func TestNewInform(t *testing.T) {
require.True(t, m.ClientIPAddr.Equal(localIP))
}
+func TestDHCPv4NewInformWithModifier(t *testing.T) {
+ hwAddr := net.HardwareAddr{1, 2, 3, 4, 5, 6}
+ localIP := net.IPv4(10, 10, 11, 11)
+ serverID := net.IPv4(192, 168, 0, 1)
+ m, err := NewInform(hwAddr, localIP, WithOption(OptServerIdentifier(serverID)))
+
+ require.NoError(t, err)
+ require.True(t, serverID.Equal(m.ServerIdentifier()))
+}
+
func TestIsOptionRequested(t *testing.T) {
pkt, err := New()
require.NoError(t, err)