MCPcopy
hub / github.com/osrg/gobgp / Test_AsPathAttribute

Function Test_AsPathAttribute

pkg/apiutil/attribute_test.go:92–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

90}
91
92func Test_AsPathAttribute(t *testing.T) {
93 assert := assert.New(t)
94
95 input := &api.AsPathAttribute{
96 Segments: []*api.AsSegment{
97 {
98 Type: 1, // SET
99 Numbers: []uint32{100, 200},
100 },
101 {
102 Type: 2, // SEQ
103 Numbers: []uint32{300, 400},
104 },
105 },
106 }
107
108 a := &api.Attribute{Attr: &api.Attribute_AsPath{AsPath: input}}
109 n, err := UnmarshalAttribute(a)
110 assert.NoError(err)
111
112 output, _ := NewAsPathAttributeFromNative(n.(*bgp.PathAttributeAsPath))
113 assert.True(proto.Equal(input, output))
114}
115
116func Test_NextHopAttribute(t *testing.T) {
117 assert := assert.New(t)

Callers

nothing calls this directly

Calls 3

UnmarshalAttributeFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…