diff options
author | Andrea Barberio <insomniac@slackware.it> | 2018-07-13 16:21:25 +0100 |
---|---|---|
committer | Andrea Barberio <insomniac@slackware.it> | 2018-07-13 16:21:25 +0100 |
commit | 382d61320c478be8e39240a15a1f3d18d4a034ac (patch) | |
tree | 9be18cd1d9a07cf45d9f8bf56a0b2fe5077371c1 /dhcpv6 | |
parent | fdc5bef9740d6dc1be9ecaffd42c64108a11aa33 (diff) |
Added negative test case
Diffstat (limited to 'dhcpv6')
-rw-r--r-- | dhcpv6/option_nontemporaryaddress_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dhcpv6/option_nontemporaryaddress_test.go b/dhcpv6/option_nontemporaryaddress_test.go index b910e36..54df8f0 100644 --- a/dhcpv6/option_nontemporaryaddress_test.go +++ b/dhcpv6/option_nontemporaryaddress_test.go @@ -50,6 +50,16 @@ func TestOptIANAGetOneOption(t *testing.T) { 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{} |