mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 04:52:10 -07:00
add dhcp6 layer test
This commit is contained in:
parent
c3cfc1ef68
commit
56c4110312
1 changed files with 29 additions and 0 deletions
29
packets/dhcp6_layer_test.go
Normal file
29
packets/dhcp6_layer_test.go
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
package packets
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/google/gopacket"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestDHCPv6Layer(t *testing.T) {
|
||||||
|
layer := DHCPv6Layer{}
|
||||||
|
|
||||||
|
exp := 0
|
||||||
|
got := len(layer.Raw)
|
||||||
|
|
||||||
|
if exp != got {
|
||||||
|
t.Fatalf("expected '%v', got '%v'", exp, got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDHCP6SerializeTo(t *testing.T) {
|
||||||
|
layer := DHCPv6Layer{}
|
||||||
|
buffer := gopacket.NewSerializeBuffer()
|
||||||
|
opts := gopacket.SerializeOptions{}
|
||||||
|
|
||||||
|
got := layer.SerializeTo(buffer, opts)
|
||||||
|
|
||||||
|
if got != nil {
|
||||||
|
t.Fatalf("expected '%v', got '%v'", nil, got)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue