summaryrefslogtreecommitdiffhomepage
path: root/table/destination_test.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-11-09 21:11:03 -0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-11-12 21:21:54 -0800
commit0ef26666ef8e920d3fa0a4ebb9c3c8fea4e6cb36 (patch)
tree8cf03170029be413806a6ef3d73c5eae9ac68ccc /table/destination_test.go
parent6d52e8c1e5d4de4dfea37656b50c71579343b5f7 (diff)
table: use old best path instead of withdrawn paths
Preparation for removing in-memory adj-out. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/destination_test.go')
-rw-r--r--table/destination_test.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/table/destination_test.go b/table/destination_test.go
index 7cace89e..7bcf6599 100644
--- a/table/destination_test.go
+++ b/table/destination_test.go
@@ -438,17 +438,17 @@ func TestMultipath(t *testing.T) {
d.AddNewPath(path1)
d.AddNewPath(path2)
- best, w, multi := d.Calculate([]string{GLOBAL_RIB_NAME})
+ best, old, multi := d.Calculate([]string{GLOBAL_RIB_NAME})
assert.Equal(t, len(best), 1)
- assert.Equal(t, len(w), 0)
+ assert.Equal(t, old[GLOBAL_RIB_NAME], (*Path)(nil))
assert.Equal(t, len(multi), 2)
assert.Equal(t, len(d.GetKnownPathList(GLOBAL_RIB_NAME)), 2)
path3 := path2.Clone(true)
d.AddWithdraw(path3)
- best, w, multi = d.Calculate([]string{GLOBAL_RIB_NAME})
+ best, old, multi = d.Calculate([]string{GLOBAL_RIB_NAME})
assert.Equal(t, len(best), 1)
- assert.Equal(t, len(w), 1)
+ assert.Equal(t, old[GLOBAL_RIB_NAME], path1)
assert.Equal(t, len(multi), 1)
assert.Equal(t, len(d.GetKnownPathList(GLOBAL_RIB_NAME)), 1)
@@ -465,9 +465,8 @@ func TestMultipath(t *testing.T) {
path4 := ProcessMessage(updateMsg, peer3, time.Now())[0]
d.AddNewPath(path4)
- best, w, multi = d.Calculate([]string{GLOBAL_RIB_NAME})
+ best, _, multi = d.Calculate([]string{GLOBAL_RIB_NAME})
assert.Equal(t, len(best), 1)
- assert.Equal(t, len(w), 0)
assert.Equal(t, len(multi), 1)
assert.Equal(t, len(d.GetKnownPathList(GLOBAL_RIB_NAME)), 2)
@@ -482,9 +481,8 @@ func TestMultipath(t *testing.T) {
path5 := ProcessMessage(updateMsg, peer2, time.Now())[0]
d.AddNewPath(path5)
- best, w, multi = d.Calculate([]string{GLOBAL_RIB_NAME})
+ best, _, multi = d.Calculate([]string{GLOBAL_RIB_NAME})
assert.Equal(t, len(best), 1)
- assert.Equal(t, len(w), 0)
assert.Equal(t, len(multi), 2)
assert.Equal(t, len(d.GetKnownPathList(GLOBAL_RIB_NAME)), 3)