summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_nontemporaryaddress_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/option_nontemporaryaddress_test.go')
-rw-r--r--dhcpv6/option_nontemporaryaddress_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/dhcpv6/option_nontemporaryaddress_test.go b/dhcpv6/option_nontemporaryaddress_test.go
index a9e7087..54df8f0 100644
--- a/dhcpv6/option_nontemporaryaddress_test.go
+++ b/dhcpv6/option_nontemporaryaddress_test.go
@@ -1,6 +1,7 @@
package dhcpv6
import (
+ "net"
"testing"
"github.com/stretchr/testify/require"
@@ -39,6 +40,26 @@ func TestOptIANAParseOptIANAInvalidOptions(t *testing.T) {
require.Error(t, err)
}
+func TestOptIANAGetOneOption(t *testing.T) {
+ oaddr := &OptIAAddress{
+ IPv6Addr: net.ParseIP("::1"),
+ }
+ opt := OptIANA{
+ Options: []Option{&OptElapsedTime{}, oaddr},
+ }
+ require.Equal(t, oaddr, opt.GetOneOption(OPTION_IAADDR))
+}
+
+func TestOptIANAGetOneOptionMissingOpt(t *testing.T) {
+ oaddr := &OptIAAddress{
+ IPv6Addr: net.ParseIP("::1"),
+ }
+ opt := OptIANA{
+ Options: []Option{&OptElapsedTime{}, oaddr},
+ }
+ require.Equal(t, nil, opt.GetOneOption(DNS_RECURSIVE_NAME_SERVER))
+}
+
func TestOptIANADelOption(t *testing.T) {
optiana1 := OptIANA{}
optiana2 := OptIANA{}