summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/utils_test.go
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2018-08-03 12:22:05 +0200
committerPablo Mazzini <pmazzini@gmail.com>2018-08-10 15:25:49 +0200
commit27e10b9e7f76b99dbdc0d8fd779b18ef322ed92c (patch)
tree5bfd9b0d94b0e387893519620cec34e5f3a62783 /dhcpv4/utils_test.go
parent5207d76712250f33111c546d9ace98336d616bfc (diff)
add IsRequested
Diffstat (limited to 'dhcpv4/utils_test.go')
-rw-r--r--dhcpv4/utils_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/dhcpv4/utils_test.go b/dhcpv4/utils_test.go
new file mode 100644
index 0000000..d722466
--- /dev/null
+++ b/dhcpv4/utils_test.go
@@ -0,0 +1,17 @@
+package dhcpv4
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+)
+
+func TestIsRequetsed(t *testing.T) {
+ pkt, err := New()
+ require.NoError(t, err)
+ require.False(t, IsRequested(pkt, OptionDomainNameServer))
+
+ optprl := OptParameterRequestList{RequestedOpts: []OptionCode{OptionDomainNameServer}}
+ pkt.AddOption(&optprl)
+ require.True(t, IsRequested(pkt, OptionDomainNameServer))
+}