summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2018-07-13 16:17:31 +0100
committerAndrea Barberio <insomniac@slackware.it>2018-07-13 16:17:31 +0100
commita0c764be8d07b0f3d925ba2565c8f675e56e3fde (patch)
tree4255820f04423b581cff65aa3da349beb048f163 /dhcpv6
parent2b18d4aca0504a12a0b2a24e0dbec12f87c12241 (diff)
Added tests for GetOneOption
Diffstat (limited to 'dhcpv6')
-rw-r--r--dhcpv6/option_nontemporaryaddress_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/dhcpv6/option_nontemporaryaddress_test.go b/dhcpv6/option_nontemporaryaddress_test.go
index a9e7087..b910e36 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,16 @@ 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 TestOptIANADelOption(t *testing.T) {
optiana1 := OptIANA{}
optiana2 := OptIANA{}