summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/modifiers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/modifiers_test.go')
-rw-r--r--dhcpv6/modifiers_test.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/dhcpv6/modifiers_test.go b/dhcpv6/modifiers_test.go
index 2179aaa..ff8022c 100644
--- a/dhcpv6/modifiers_test.go
+++ b/dhcpv6/modifiers_test.go
@@ -58,18 +58,17 @@ func TestWithIANA(t *testing.T) {
func TestWithDNS(t *testing.T) {
var d Message
- WithDNS([]net.IP{
+ WithDNS(
net.ParseIP("fe80::1"),
net.ParseIP("fe80::2"),
- }...)(&d)
+ )(&d)
require.Equal(t, 1, len(d.Options.Options))
- dns := d.Options.Options[0].(*OptDNSRecursiveNameServer)
+ dns := d.Options.DNS()
log.Printf("DNS %+v", dns)
- require.Equal(t, OptionDNSRecursiveNameServer, dns.Code())
- require.Equal(t, 2, len(dns.NameServers))
- require.Equal(t, net.ParseIP("fe80::1"), dns.NameServers[0])
- require.Equal(t, net.ParseIP("fe80::2"), dns.NameServers[1])
- require.NotEqual(t, net.ParseIP("fe80::1"), dns.NameServers[1])
+ require.Equal(t, 2, len(dns))
+ require.Equal(t, net.ParseIP("fe80::1"), dns[0])
+ require.Equal(t, net.ParseIP("fe80::2"), dns[1])
+ require.NotEqual(t, net.ParseIP("fe80::1"), dns[1])
}
func TestWithDomainSearchList(t *testing.T) {