summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/ztpv4
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2018-12-22 14:39:10 +0000
committerPablo Mazzini <pmazzini@gmail.com>2018-12-22 14:39:10 +0000
commite81cd12b55a01f9bec8325f4a57cbff357570972 (patch)
tree048a04f453cf0afd64d853d77e9c17d585f3f6c6 /dhcpv4/ztpv4
parent8c76c175ee8c3e2de4de54c461abccc04c2b7167 (diff)
increase coverage
Diffstat (limited to 'dhcpv4/ztpv4')
-rw-r--r--dhcpv4/ztpv4/ztp_test.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/dhcpv4/ztpv4/ztp_test.go b/dhcpv4/ztpv4/ztp_test.go
index c9c8d86..9950bf5 100644
--- a/dhcpv4/ztpv4/ztp_test.go
+++ b/dhcpv4/ztpv4/ztp_test.go
@@ -53,9 +53,11 @@ func TestParseV4VendorClass(t *testing.T) {
t.Fatalf("failed to creat dhcpv4 packet object: %v", err)
}
- packet.AddOption(&dhcpv4.OptClassIdentifier{
- Identifier: tc.vc,
- })
+ if tc.vc != "" {
+ packet.AddOption(&dhcpv4.OptClassIdentifier{
+ Identifier: tc.vc,
+ })
+ }
if tc.hostname != "" {
packet.AddOption(&dhcpv4.OptHostName{