summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/dhcpv4_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4/dhcpv4_test.go')
-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 fe9fe0d..28f38d4 100644
--- a/dhcpv4/dhcpv4_test.go
+++ b/dhcpv4/dhcpv4_test.go
@@ -493,5 +493,15 @@ func TestNewInform(t *testing.T) {
require.True(t, m.ClientIPAddr().Equal(localIP))
}
+func TestIsOptionRequested(t *testing.T) {
+ pkt, err := New()
+ require.NoError(t, err)
+ require.False(t, pkt.IsOptionRequested(OptionDomainNameServer))
+
+ optprl := OptParameterRequestList{RequestedOpts: []OptionCode{OptionDomainNameServer}}
+ pkt.AddOption(&optprl)
+ require.True(t, pkt.IsOptionRequested(OptionDomainNameServer))
+}
+
// TODO
// test Summary() and String()