summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/options_test.go
diff options
context:
space:
mode:
authorSean Karlage <skarlage@get9.io>2018-07-29 23:08:03 -0500
committerGitHub <noreply@github.com>2018-07-29 23:08:03 -0500
commitb1289a39b521aa6ce714af91bab9f8104e5cc002 (patch)
treedbdbb6508f71ee74419f3cd944ecabad4c63c715 /dhcpv4/options_test.go
parent23c03c8fa262c77c68741b079e0e1d2c91397823 (diff)
parent8922ac28f1dd0b814f7df49378ef0b716d12ef72 (diff)
Merge pull request #103 from pmazzini/master
add OptRouter
Diffstat (limited to 'dhcpv4/options_test.go')
-rw-r--r--dhcpv4/options_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/dhcpv4/options_test.go b/dhcpv4/options_test.go
index 01d7427..b3d7605 100644
--- a/dhcpv4/options_test.go
+++ b/dhcpv4/options_test.go
@@ -25,6 +25,14 @@ func TestParseOption(t *testing.T) {
require.Equal(t, 4, opt.Length(), "Length")
require.Equal(t, option, opt.ToBytes(), "ToBytes")
+ // Requested IP address
+ option = []byte{50, 4, 1, 2, 3, 4}
+ opt, err = ParseOption(option)
+ require.NoError(t, err)
+ require.Equal(t, OptionRequestedIPAddress, opt.Code(), "Code")
+ require.Equal(t, 4, opt.Length(), "Length")
+ require.Equal(t, option, opt.ToBytes(), "ToBytes")
+
// Message type
option = []byte{53, 1, 1}
opt, err = ParseOption(option)
@@ -41,14 +49,6 @@ func TestParseOption(t *testing.T) {
require.Equal(t, 3, opt.Length(), "Length")
require.Equal(t, option, opt.ToBytes(), "ToBytes")
- // Requested IP address
- option = []byte{50, 4, 1, 2, 3, 4}
- opt, err = ParseOption(option)
- require.NoError(t, err)
- require.Equal(t, OptionRequestedIPAddress, opt.Code(), "Code")
- require.Equal(t, 4, opt.Length(), "Length")
- require.Equal(t, option, opt.ToBytes(), "ToBytes")
-
// Option server ID
option = []byte{54, 4, 1, 2, 3, 4}
opt, err = ParseOption(option)