summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/modifiers_test.go
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2020-02-10 09:54:18 +0000
committerGitHub <noreply@github.com>2020-02-10 09:54:18 +0000
commit45e5f320b2f0f87515ac27f1a04bbd24f494ac90 (patch)
treec077ddd63a2f91cade9c6e14be46c6fef1b9e234 /dhcpv6/modifiers_test.go
parent5214532ecf392e5a8818355f3fff993aaef42c06 (diff)
parent8a245966f316b2f19e13e806a95ef1c4e6806eb5 (diff)
Merge pull request #355 from 10000TB/davidhu-dhcpv6-fqdn
dhcpv6 fqdn: implements OptionFQDN option
Diffstat (limited to 'dhcpv6/modifiers_test.go')
-rw-r--r--dhcpv6/modifiers_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/dhcpv6/modifiers_test.go b/dhcpv6/modifiers_test.go
index 324c425..dfef08c 100644
--- a/dhcpv6/modifiers_test.go
+++ b/dhcpv6/modifiers_test.go
@@ -95,3 +95,13 @@ func TestWithDomainSearchList(t *testing.T) {
require.Equal(t, "slackware.it", labels[0])
require.Equal(t, "dhcp.slackware.it", labels[1])
}
+
+func TestWithFQDN(t *testing.T) {
+ var d Message
+ WithFQDN(4, "cnos.localhost")(&d)
+ require.Equal(t, 1, len(d.Options))
+ ofqdn := d.Options[0].(*OptFQDN)
+ require.Equal(t, OptionFQDN, ofqdn.Code())
+ require.Equal(t, uint8(4), ofqdn.Flags)
+ require.Equal(t, "cnos.localhost", ofqdn.DomainName)
+}