summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/modifiers_test.go
diff options
context:
space:
mode:
authorXuehao (David) Hu <xuehaohu@google.com>2020-02-04 12:00:29 -0800
committerXuehao (David) Hu <xuehaohu@google.com>2020-02-06 18:15:13 -0800
commit8a245966f316b2f19e13e806a95ef1c4e6806eb5 (patch)
treec077ddd63a2f91cade9c6e14be46c6fef1b9e234 /dhcpv6/modifiers_test.go
parent5214532ecf392e5a8818355f3fff993aaef42c06 (diff)
hcpv6 fqdn: implements OptionFQDN option
per https://tools.ietf.org/rfc/rfc4704.txt Signed-off-by: Xuehao (David) Hu <xuehaohu@google.com>
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)
+}