summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/options_test.go
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2018-08-02 19:21:59 +0200
committerPablo Mazzini <pmazzini@gmail.com>2018-08-02 19:21:59 +0200
commit63d7f1ef09968bc3007f26eae4c7a6e1ef4272f6 (patch)
tree995f813a873df8c0811d1dd7897b4052f982331d /dhcpv4/options_test.go
parent54efe77e5afa90329d78cf8302b8eb8e0af3e898 (diff)
OptClientArchType: increase coverage
Diffstat (limited to 'dhcpv4/options_test.go')
-rw-r--r--dhcpv4/options_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/dhcpv4/options_test.go b/dhcpv4/options_test.go
index b2d671a..9d3e88a 100644
--- a/dhcpv4/options_test.go
+++ b/dhcpv4/options_test.go
@@ -41,6 +41,14 @@ func TestParseOption(t *testing.T) {
require.Equal(t, 4, opt.Length(), "Length")
require.Equal(t, option, opt.ToBytes(), "ToBytes")
+ // Option host name
+ option = []byte{12, 4, 't', 'e', 's', 't'}
+ opt, err = ParseOption(option)
+ require.NoError(t, err)
+ require.Equal(t, OptionHostName, opt.Code(), "Code")
+ 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)