From 04ce5ce2956d4e77dd4782adce7ab889625e3f08 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Tue, 27 Jun 2017 14:47:48 +0900 Subject: use Destination instead of Path for path selection API With Destination struct, multiple Paths can be moved from the table package to the server package in a cleaner way; for features such as add-path. Signed-off-by: FUJITA Tomonori --- server/server_test.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'server/server_test.go') diff --git a/server/server_test.go b/server/server_test.go index e5deb975..fb7b97f3 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -16,15 +16,16 @@ package server import ( + "net" + "runtime" + "testing" + "time" + "github.com/osrg/gobgp/config" "github.com/osrg/gobgp/packet/bgp" "github.com/osrg/gobgp/table" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" - "net" - "runtime" - "testing" - "time" ) func TestModPolicyAssign(t *testing.T) { @@ -214,14 +215,14 @@ func newPeerandInfo(myAs, as uint32, address string, rib *table.TableManager) (* } func process(rib *table.TableManager, l []*table.Path) (*table.Path, *table.Path) { - news, olds, _ := rib.ProcessPaths([]string{table.GLOBAL_RIB_NAME}, l) + news, olds, _ := dstsToPaths(table.GLOBAL_RIB_NAME, rib.ProcessPaths(l)) if len(news) != 1 { panic("can't handle multiple paths") } - for idx, path := range news[table.GLOBAL_RIB_NAME] { + for idx, path := range news { var old *table.Path if olds != nil { - old = olds[table.GLOBAL_RIB_NAME][idx] + old = olds[idx] } return path, old } -- cgit v1.2.3