diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-12-17 21:49:32 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-12-17 21:49:32 -0800 |
commit | f8929462982c77f6be2022c9cf42fe05bf3a4b92 (patch) | |
tree | 30ecff2ee8c45274c515ba7d38b74db9b6b8cfbe /table/message_test.go | |
parent | 52ce66ef711d4f2cd356ec654e57ad6e2732981d (diff) |
bmp: fix post-policy bmp message creation
post-policy code creates paths from bgp update and then create the
message from the modified paths. MP_UNREACH needs to be handled
diffently.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/message_test.go')
-rw-r--r-- | table/message_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/table/message_test.go b/table/message_test.go index 67a1da87..5d1e50a9 100644 --- a/table/message_test.go +++ b/table/message_test.go @@ -20,6 +20,7 @@ import ( "github.com/stretchr/testify/assert" "reflect" "testing" + "time" ) func updateMsg1(as []uint16) *bgp.BGPMessage { @@ -99,3 +100,25 @@ func TestAs4PathUnchanged(t *testing.T) { } } } + +func TestBMP(t *testing.T) { + aspath1 := []bgp.AsPathParamInterface{ + bgp.NewAs4PathParam(2, []uint32{1000000}), + bgp.NewAs4PathParam(1, []uint32{1000001, 1002}), + bgp.NewAs4PathParam(2, []uint32{1003, 100004}), + } + mp_nlri := []bgp.AddrPrefixInterface{bgp.NewIPv6AddrPrefix(100, + "fe80:1234:1234:5667:8967:af12:8912:1023")} + + p := []bgp.PathAttributeInterface{ + bgp.NewPathAttributeOrigin(3), + bgp.NewPathAttributeAsPath(aspath1), + bgp.NewPathAttributeMpUnreachNLRI(mp_nlri), + } + w := []*bgp.IPAddrPrefix{} + n := []*bgp.IPAddrPrefix{} + + msg := bgp.NewBGPUpdateMessage(w, p, n) + pList := ProcessMessage(msg, peerR1(), time.Now()) + CreateUpdateMsgFromPaths(pList) +} |