summaryrefslogtreecommitdiffhomepage
path: root/table/table_manager_test.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-11-29 04:08:36 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-12-08 14:45:37 +0900
commita719a3de6e8b2bb7803e02e7e05ea8e854d6f396 (patch)
treefbe41ae4055542414a7a02d81c87a0fc57b65f5c /table/table_manager_test.go
parent3213eed6a5aca1625ffa03ab410ffc587121b9da (diff)
server/table: use only one rib for multiple route server clients
speed up and reduce memory footprint Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/table_manager_test.go')
-rw-r--r--table/table_manager_test.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/table/table_manager_test.go b/table/table_manager_test.go
index f0e465b2..e441fb97 100644
--- a/table/table_manager_test.go
+++ b/table/table_manager_test.go
@@ -30,7 +30,15 @@ import (
// this function processes only BGPUpdate
func (manager *TableManager) ProcessUpdate(fromPeer *PeerInfo, message *bgp.BGPMessage) ([]*Path, error) {
paths := ProcessMessage(message, fromPeer, time.Now())
- return manager.ProcessPaths(paths)
+ dsts := manager.ProcessPaths(paths)
+ paths2 := make([]*Path, 0, len(paths))
+ for _, dst := range dsts {
+ p := dst.NewFeed(GLOBAL_RIB_NAME)
+ if p != nil {
+ paths2 = append(paths2, p)
+ }
+ }
+ return paths2, nil
}
func getLogger(lv log.Level) *log.Logger {
@@ -2148,7 +2156,7 @@ func TestProcessBGPUpdate_Timestamp(t *testing.T) {
nlri := []*bgp.IPAddrPrefix{bgp.NewIPAddrPrefix(24, "10.10.10.0")}
- adjRib := NewAdjRib([]bgp.RouteFamily{bgp.RF_IPv4_UC, bgp.RF_IPv6_UC})
+ adjRib := NewAdjRib("test", []bgp.RouteFamily{bgp.RF_IPv4_UC, bgp.RF_IPv6_UC})
m1 := bgp.NewBGPUpdateMessage(nil, pathAttributes, nlri)
peer := peerR1()
pList1 := ProcessMessage(m1, peer, time.Now())