summaryrefslogtreecommitdiffhomepage
path: root/server/server_test.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-06-27 14:47:48 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-07-04 09:30:48 +0900
commit04ce5ce2956d4e77dd4782adce7ab889625e3f08 (patch)
tree9167b91b72f581eb4d0f02387c94983f4f2cf0d2 /server/server_test.go
parent547cd0893a5d426a1c34713026291f5cd55516fe (diff)
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 <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/server_test.go')
-rw-r--r--server/server_test.go15
1 files changed, 8 insertions, 7 deletions
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
}