summaryrefslogtreecommitdiffhomepage
path: root/server/server_test.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-04-10 22:39:08 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-05-07 21:18:04 +0900
commitee91af5b638755a19c6954579b77a28916fb9bff (patch)
tree478e31d4ba6a8b5563e4e631d81c4f8ef36bd659 /server/server_test.go
parent34382909f09cb9758132a3653306a917ef4a61c3 (diff)
preparation for shrinking Destination structure
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/server_test.go')
-rw-r--r--server/server_test.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/server/server_test.go b/server/server_test.go
index 7eaea7b7..720202d0 100644
--- a/server/server_test.go
+++ b/server/server_test.go
@@ -269,7 +269,11 @@ func newPeerandInfo(myAs, as uint32, address string, rib *table.TableManager) (*
}
func process(rib *table.TableManager, l []*table.Path) (*table.Path, *table.Path) {
- news, olds, _ := dstsToPaths(table.GLOBAL_RIB_NAME, 0, rib.ProcessPaths(l), false)
+ dsts := make([]*table.Destination, 0)
+ for _, path := range l {
+ dsts = append(dsts, rib.Update(path)...)
+ }
+ news, olds, _ := dstsToPaths(table.GLOBAL_RIB_NAME, 0, dsts)
if len(news) != 1 {
panic("can't handle multiple paths")
}
@@ -297,8 +301,9 @@ func TestFilterpathWitheBGP(t *testing.T) {
path1 := table.NewPath(pi1, nlri, false, pa1, time.Now(), false)
path2 := table.NewPath(pi2, nlri, false, pa2, time.Now(), false)
-
- new, old := process(rib, []*table.Path{path1, path2})
+ rib.Update(path2)
+ d := rib.Update(path1)
+ new, old, _ := d[0].GetChanges(table.GLOBAL_RIB_NAME, 0, false)
assert.Equal(t, new, path1)
filterpath(p1, new, old)
filterpath(p2, new, old)