diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-30 23:31:52 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-30 23:31:52 +0900 |
commit | 7cac8709ad043b8aa2ce7dae378b7f921071835d (patch) | |
tree | a1cbb526802b62a457fc4a4f384121d72e225cce /table/table_manager_test.go | |
parent | 40e40449ff08a0f226ca8b5cee04307a66a5e59f (diff) |
table: make path.Clone private
table_manager.go clones withdraw path before passing it to peer.go
clone() doesn't clone pathattributes. This patch adds a helper
funciton to clone PathAttributes to message.go (it is used by
createing BGPUpdate message to withdraw ipv6. later it will be used
for 2 byte AS peer).
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/table_manager_test.go')
-rw-r--r-- | table/table_manager_test.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/table/table_manager_test.go b/table/table_manager_test.go index 66a5b2c5..761e6f54 100644 --- a/table/table_manager_test.go +++ b/table/table_manager_test.go @@ -1640,10 +1640,6 @@ func TestProcessBGPUpdate_bestpath_lost_ipv4(t *testing.T) { // check destination expectedPrefix := "10.10.10.0" assert.Equal(t, expectedPrefix, path.getPrefix().String()) - // check nexthop - expectedNexthop := "192.168.50.1" - assert.Equal(t, expectedNexthop, path.getNexthop().String()) - } func TestProcessBGPUpdate_bestpath_lost_ipv6(t *testing.T) { @@ -1719,10 +1715,6 @@ func TestProcessBGPUpdate_bestpath_lost_ipv6(t *testing.T) { // check destination expectedPrefix := "2001:123:123:1::" assert.Equal(t, expectedPrefix, path.getPrefix().String()) - // check nexthop - expectedNexthop := "2001::192:168:50:1" - assert.Equal(t, expectedNexthop, path.getNexthop().String()) - } // test: implicit withdrawal case @@ -2206,7 +2198,9 @@ func TestModifyPathAttribute(t *testing.T) { assert.NoError(t, err) path0 := pList[0] - path1 := path0.Clone(false) + path1 := path0.clone(false) + ipv4p := path1.(*IPv4Path) + ipv4p.PathDefault.pathAttrs = clonePathAttributes(path0.GetPathAttrs()) _, attr1 := path1.GetPathAttr(bgp.BGP_ATTR_TYPE_MULTI_EXIT_DISC) mx1 := attr1.(*bgp.PathAttributeMultiExitDisc) |