diff options
Diffstat (limited to 'pkg/packet/bgp/prefix_sid_test.go')
-rw-r--r-- | pkg/packet/bgp/prefix_sid_test.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pkg/packet/bgp/prefix_sid_test.go b/pkg/packet/bgp/prefix_sid_test.go new file mode 100644 index 00000000..84f1312f --- /dev/null +++ b/pkg/packet/bgp/prefix_sid_test.go @@ -0,0 +1,25 @@ +package bgp + +import ( + "reflect" + "testing" +) + +func TestUnmarshalUnicastNLRI(t *testing.T) { + tests := []struct { + name string + input []byte + expect *PathAttributePrefixSID + }{} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := GetPathAttribute(tt.input) + if err != nil { + t.Fatalf("test failed with error: %+v", err) + } + if !reflect.DeepEqual(tt.expect, got) { + t.Fatalf("test failed as expected nlri %+v does not match actual nlri %+v", tt.expect, got) + } + }) + } +} |