summaryrefslogtreecommitdiffhomepage
path: root/table/path_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'table/path_test.go')
-rw-r--r--table/path_test.go16
1 files changed, 3 insertions, 13 deletions
diff --git a/table/path_test.go b/table/path_test.go
index cc2ca1a7..3cd32d89 100644
--- a/table/path_test.go
+++ b/table/path_test.go
@@ -13,16 +13,14 @@ func TestPathNewIPv4(t *testing.T) {
peerP := PathCreatePeer()
msgP := PathCreateMSG(peerP)
pathP := PathCreatePath(msgP)
- ipv4p := NewIPv4Path(pathP[0].getSource(), pathP[0].GetNlri(), pathP[0].getSourceVerNum(), pathP[0].getNexthop(),
- true, pathP[0].getPathAttributeMap(), pathP[0].getMedSetByTargetNeighbor())
+ ipv4p := NewIPv4Path(pathP[0].getSource(), pathP[0].GetNlri(), pathP[0].getSourceVerNum(), true, pathP[0].GetPathAttrs(), pathP[0].getMedSetByTargetNeighbor())
assert.NotNil(t, ipv4p)
}
func TestPathNewIPv6(t *testing.T) {
peerP := PathCreatePeer()
msgP := PathCreateMSG(peerP)
pathP := PathCreatePath(msgP)
- ipv6p := NewIPv6Path(pathP[0].getSource(), pathP[0].GetNlri(), pathP[0].getSourceVerNum(), pathP[0].getNexthop(),
- true, pathP[0].getPathAttributeMap(), pathP[0].getMedSetByTargetNeighbor())
+ ipv6p := NewIPv6Path(pathP[0].getSource(), pathP[0].GetNlri(), pathP[0].getSourceVerNum(), true, pathP[0].GetPathAttrs(), pathP[0].getMedSetByTargetNeighbor())
assert.NotNil(t, ipv6p)
}
@@ -178,19 +176,11 @@ func TestPathGetAttribute(t *testing.T) {
msgP := PathCreateMSG(peerP)
pathP := PathCreatePath(msgP)
nh := "192.168.50.1"
- pa := pathP[0].getPathAttribute(bgp.BGP_ATTR_TYPE_NEXT_HOP)
+ _, pa := pathP[0].GetPathAttr(bgp.BGP_ATTR_TYPE_NEXT_HOP)
r_nh := pa.(*bgp.PathAttributeNextHop).Value.String()
assert.Equal(t, r_nh, nh)
}
-func TestPathClone(t *testing.T) {
- peerP := PathCreatePeer()
- msgP := PathCreateMSG(peerP)
- pathP := PathCreatePath(msgP)
- clPath := pathP[0].clone(false)
- assert.Equal(t, clPath, pathP[0])
-}
-
func PathCreatePeer() []*PeerInfo {
peerP1 := &PeerInfo{VersionNum: 4, AS: 65000}
peerP2 := &PeerInfo{VersionNum: 4, AS: 65001}