summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/dhcpv4_test.go
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2018-08-10 16:00:59 +0200
committerPablo Mazzini <pmazzini@gmail.com>2018-08-10 16:00:59 +0200
commitf55d67dc49bee6d6aa20913f070ed771b9ff725a (patch)
tree2e96a2f52ab0bac9f06e0560208ab21bb2c4bb51 /dhcpv4/dhcpv4_test.go
parentcff664d4ac7fe61377195a9d439e17259ce5899e (diff)
rename IsRequested to IsRequestedOption
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 1bce05d..a594890 100644
--- a/dhcpv4/dhcpv4_test.go
+++ b/dhcpv4/dhcpv4_test.go
@@ -401,6 +401,16 @@ func TestDHCPv4MessageTypeDiscovery(t *testing.T) {
require.Equal(t, MessageTypeDiscover, *m.MessageType())
}
+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 broadcast/unicast flags
// test Options setter/getter