summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--table/path.go20
-rw-r--r--table/path_test.go4
-rw-r--r--table/table_manager.go8
-rw-r--r--table/table_manager_test.go140
4 files changed, 86 insertions, 86 deletions
diff --git a/table/path.go b/table/path.go
index 2e8bd839..78fa111c 100644
--- a/table/path.go
+++ b/table/path.go
@@ -36,7 +36,7 @@ type Path interface {
setWithdraw(withdraw bool)
IsWithdraw() bool
getNlri() bgp.AddrPrefixInterface
- getPrefix() net.IP
+ getPrefix() string
setMedSetByTargetNeighbor(medSetByTargetNeighbor bool)
getMedSetByTargetNeighbor() bool
clone(IsWithdraw bool) Path
@@ -192,22 +192,22 @@ func (pd *PathDefault) getPathAttr(pattrType bgp.BGPAttrType) (int, bgp.PathAttr
// return Path's string representation
func (pi *PathDefault) String() string {
str := fmt.Sprintf("IPv4Path Source: %v, ", pi.getSource())
- str = str + fmt.Sprintf(" NLRI: %s, ", pi.getPrefix().String())
+ str = str + fmt.Sprintf(" NLRI: %s, ", pi.getPrefix())
str = str + fmt.Sprintf(" nexthop: %s, ", pi.getNexthop().String())
str = str + fmt.Sprintf(" withdraw: %s, ", pi.IsWithdraw())
//str = str + fmt.Sprintf(" path attributes: %s, ", pi.getPathAttributeMap())
return str
}
-func (pi *PathDefault) getPrefix() net.IP {
-
+func (pi *PathDefault) getPrefix() string {
switch nlri := pi.nlri.(type) {
case *bgp.NLRInfo:
- return nlri.Prefix
+ return nlri.IPAddrPrefix.IPAddrPrefixDefault.String()
case *bgp.WithdrawnRoute:
- return nlri.Prefix
+ return nlri.IPAddrPrefix.IPAddrPrefixDefault.String()
}
- return nil
+ log.Fatal()
+ return ""
}
// create Path object based on route family
@@ -284,15 +284,15 @@ func (ipv6p *IPv6Path) getPathDefault() *PathDefault {
return ipv6p.PathDefault
}
-func (ipv6p *IPv6Path) getPrefix() net.IP {
+func (ipv6p *IPv6Path) getPrefix() string {
addrPrefix := ipv6p.nlri.(*bgp.IPv6AddrPrefix)
- return addrPrefix.Prefix
+ return addrPrefix.IPAddrPrefixDefault.String()
}
// return IPv6Path's string representation
func (ipv6p *IPv6Path) String() string {
str := fmt.Sprintf("IPv6Path Source: %v, ", ipv6p.getSource())
- str = str + fmt.Sprintf(" NLRI: %s, ", ipv6p.getPrefix().String())
+ str = str + fmt.Sprintf(" NLRI: %s, ", ipv6p.getPrefix())
str = str + fmt.Sprintf(" nexthop: %s, ", ipv6p.getNexthop().String())
str = str + fmt.Sprintf(" withdraw: %s, ", ipv6p.IsWithdraw())
//str = str + fmt.Sprintf(" path attributes: %s, ", ipv6p.getPathAttributeMap())
diff --git a/table/path_test.go b/table/path_test.go
index b913520f..20083785 100644
--- a/table/path_test.go
+++ b/table/path_test.go
@@ -151,9 +151,9 @@ func TestPathGetPrefix(t *testing.T) {
peerP := PathCreatePeer()
msgP := PathCreateMSG(peerP)
pathP := PathCreatePath(msgP)
- prefix := "10.10.10.0"
+ prefix := "10.10.10.0/24"
r_prefix := pathP[0].getPrefix()
- assert.Equal(t, r_prefix.String(), prefix)
+ assert.Equal(t, r_prefix, prefix)
}
func TestPathGetAttribute(t *testing.T) {
peerP := PathCreatePeer()
diff --git a/table/table_manager.go b/table/table_manager.go
index 1fb95f3f..6ee96518 100644
--- a/table/table_manager.go
+++ b/table/table_manager.go
@@ -172,8 +172,8 @@ func (manager *TableManager) calculate(destinationList []Destination) ([]Path, [
}
} else {
log.Debugf("new best path: NLRI: %v, next_hop=%v, reason=%v",
- newBestPath.getPrefix().String(),
- newBestPath.getNexthop().String(),
+ newBestPath.getPrefix(),
+ newBestPath.getNexthop(),
reason)
bestPaths = append(bestPaths, newBestPath)
@@ -244,7 +244,7 @@ func NewAdjRib() *AdjRib {
func (adj *AdjRib) update(rib map[bgp.RouteFamily]map[string]*ReceivedRoute, pathList []Path) {
for _, path := range pathList {
rf := path.GetRouteFamily()
- key := path.getPrefix().String()
+ key := path.getPrefix()
if path.IsWithdraw() {
_, found := rib[rf][key]
if found {
@@ -293,7 +293,7 @@ type ReceivedRoute struct {
}
func (rr *ReceivedRoute) String() string {
- return rr.path.(*PathDefault).getPrefix().String()
+ return rr.path.(*PathDefault).getPrefix()
}
func NewReceivedRoute(path Path, filtered bool) *ReceivedRoute {
diff --git a/table/table_manager_test.go b/table/table_manager_test.go
index f6cf2743..47e4d4a7 100644
--- a/table/table_manager_test.go
+++ b/table/table_manager_test.go
@@ -104,8 +104,8 @@ func TestProcessBGPUpdate_0_select_onlypath_ipv4(t *testing.T) {
assert.Equal(t, 4, len(path.getPathAttrs()))
// check destination
- expectedPrefix := "10.10.10.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "10.10.10.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "192.168.50.1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -156,8 +156,8 @@ func TestProcessBGPUpdate_0_select_onlypath_ipv6(t *testing.T) {
assert.Equal(t, 4, len(path.getPathAttrs()))
// check destination
- expectedPrefix := "2001:123:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "2001:123:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "2001::192:168:50:1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -241,8 +241,8 @@ func TestProcessBGPUpdate_1_select_high_localpref_ipv4(t *testing.T) {
assert.Equal(t, len(pathAttributes2), len(path.getPathAttrs()))
// check destination
- expectedPrefix := "10.10.10.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "10.10.10.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "192.168.50.1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -328,8 +328,8 @@ func TestProcessBGPUpdate_1_select_high_localpref_ipv6(t *testing.T) {
assert.Equal(t, 5, len(path.getPathAttrs()))
// check destination
- expectedPrefix := "2001:123:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "2001:123:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "2001::192:168:100:1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -413,8 +413,8 @@ func TestProcessBGPUpdate_2_select_local_origin_ipv4(t *testing.T) {
assert.Equal(t, len(pathAttributes2), len(path.getPathAttrs()))
// check destination
- expectedPrefix := "10.10.10.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "10.10.10.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "0.0.0.0"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -500,8 +500,8 @@ func TestProcessBGPUpdate_2_select_local_origin_ipv6(t *testing.T) {
assert.Equal(t, 5, len(path.getPathAttrs()))
// check destination
- expectedPrefix := "2001:123:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "2001:123:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "::"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -558,8 +558,8 @@ func TestProcessBGPUpdate_3_select_aspath_ipv4(t *testing.T) {
assert.Equal(t, 4, len(path.getPathAttrs()))
// check destination
- expectedPrefix := "20.20.20.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "20.20.20.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "192.168.100.1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -616,8 +616,8 @@ func TestProcessBGPUpdate_3_select_aspath_ipv6(t *testing.T) {
assert.Equal(t, 4, len(path.getPathAttrs()))
// check destination
- expectedPrefix := "2002:223:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "2002:223:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "2001::192:168:100:1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -701,8 +701,8 @@ func TestProcessBGPUpdate_4_select_low_origin_ipv4(t *testing.T) {
assert.Equal(t, len(pathAttributes2), len(path.getPathAttrs()))
// check destination
- expectedPrefix := "10.10.10.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "10.10.10.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "192.168.100.1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -788,8 +788,8 @@ func TestProcessBGPUpdate_4_select_low_origin_ipv6(t *testing.T) {
assert.Equal(t, 5, len(path.getPathAttrs()))
// check destination
- expectedPrefix := "2001:123:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "2001:123:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "2001::192:168:100:1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -873,8 +873,8 @@ func TestProcessBGPUpdate_5_select_low_med_ipv4(t *testing.T) {
assert.Equal(t, len(pathAttributes2), len(path.getPathAttrs()))
// check destination
- expectedPrefix := "10.10.10.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "10.10.10.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "192.168.100.1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -960,8 +960,8 @@ func TestProcessBGPUpdate_5_select_low_med_ipv6(t *testing.T) {
assert.Equal(t, 5, len(path.getPathAttrs()))
// check destination
- expectedPrefix := "2001:123:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "2001:123:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "2001::192:168:100:1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -1047,8 +1047,8 @@ func TestProcessBGPUpdate_6_select_ebgp_path_ipv4(t *testing.T) {
assert.Equal(t, len(pathAttributes2), len(path.getPathAttrs()))
// check destination
- expectedPrefix := "10.10.10.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "10.10.10.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "192.168.100.1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -1135,8 +1135,8 @@ func TestProcessBGPUpdate_6_select_ebgp_path_ipv6(t *testing.T) {
assert.Equal(t, 5, len(path.getPathAttrs()))
// check destination
- expectedPrefix := "2001:123:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "2001:123:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "2001::192:168:100:1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -1224,8 +1224,8 @@ func TestProcessBGPUpdate_7_select_low_routerid_path_ipv4(t *testing.T) {
assert.Equal(t, len(pathAttributes2), len(path.getPathAttrs()))
// check destination
- expectedPrefix := "10.10.10.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "10.10.10.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "192.168.100.1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -1312,8 +1312,8 @@ func TestProcessBGPUpdate_7_select_low_routerid_path_ipv6(t *testing.T) {
assert.Equal(t, 5, len(path.getPathAttrs()))
// check destination
- expectedPrefix := "2001:123:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "2001:123:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "2001::192:168:100:1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -1400,8 +1400,8 @@ func TestProcessBGPUpdate_8_withdraw_path_ipv4(t *testing.T) {
}
checkPattr(bgpMessage2, path)
// check destination
- expectedPrefix := "10.10.10.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "10.10.10.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "192.168.100.1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -1422,8 +1422,8 @@ func TestProcessBGPUpdate_8_withdraw_path_ipv4(t *testing.T) {
checkPattr(bgpMessage1, path)
// check destination
- expectedPrefix = "10.10.10.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix = "10.10.10.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop = "192.168.50.1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -1535,8 +1535,8 @@ func TestProcessBGPUpdate_8_mpunreach_path_ipv6(t *testing.T) {
checkPattr(bgpMessage2, path)
// check destination
- expectedPrefix := "2001:123:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "2001:123:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "2001::192:168:100:1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -1557,8 +1557,8 @@ func TestProcessBGPUpdate_8_mpunreach_path_ipv6(t *testing.T) {
checkPattr(bgpMessage1, path)
// check destination
- expectedPrefix = "2001:123:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix = "2001:123:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop = "2001::192:168:50:1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -1635,8 +1635,8 @@ func TestProcessBGPUpdate_bestpath_lost_ipv4(t *testing.T) {
checkPattr(bgpMessage1, path)
// check destination
- expectedPrefix := "10.10.10.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "10.10.10.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
}
func TestProcessBGPUpdate_bestpath_lost_ipv6(t *testing.T) {
@@ -1710,8 +1710,8 @@ func TestProcessBGPUpdate_bestpath_lost_ipv6(t *testing.T) {
checkPattr(bgpMessage1, path)
// check destination
- expectedPrefix := "2001:123:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "2001:123:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
}
// test: implicit withdrawal case
@@ -1793,8 +1793,8 @@ func TestProcessBGPUpdate_implicit_withdrwal_ipv4(t *testing.T) {
}
checkPattr(bgpMessage2, path)
// check destination
- expectedPrefix := "10.10.10.0"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "10.10.10.0/24"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "192.168.50.1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -1905,8 +1905,8 @@ func TestProcessBGPUpdate_implicit_withdrwal_ipv6(t *testing.T) {
checkPattr(bgpMessage2, path)
// check destination
- expectedPrefix := "2001:123:123:1::"
- assert.Equal(t, expectedPrefix, path.getPrefix().String())
+ expectedPrefix := "2001:123:123:1::/64"
+ assert.Equal(t, expectedPrefix, path.getPrefix())
// check nexthop
expectedNexthop := "2001::192:168:50:1"
assert.Equal(t, expectedNexthop, path.getNexthop().String())
@@ -1964,7 +1964,7 @@ func TestProcessBGPUpdate_multiple_nlri_ipv4(t *testing.T) {
assert.Equal(t, reflect.TypeOf(p).String(), expectedType)
checkPattr(m, p)
// check destination
- assert.Equal(t, prefix, p.getPrefix().String())
+ assert.Equal(t, prefix, p.getPrefix())
// check nexthop
assert.Equal(t, nexthop, p.getNexthop().String())
}
@@ -2010,22 +2010,22 @@ func TestProcessBGPUpdate_multiple_nlri_ipv4(t *testing.T) {
assert.Equal(t, 0, len(wList))
assert.NoError(t, err)
- checkBestPathResult("*table.IPv4Path", "10.10.10.0", "192.168.50.1", pList[0], bgpMessage1)
- checkBestPathResult("*table.IPv4Path", "20.20.20.0", "192.168.50.1", pList[1], bgpMessage1)
- checkBestPathResult("*table.IPv4Path", "30.30.30.0", "192.168.50.1", pList[2], bgpMessage1)
- checkBestPathResult("*table.IPv4Path", "40.40.40.0", "192.168.50.1", pList[3], bgpMessage1)
- checkBestPathResult("*table.IPv4Path", "50.50.50.0", "192.168.50.1", pList[4], bgpMessage1)
+ checkBestPathResult("*table.IPv4Path", "10.10.10.0/24", "192.168.50.1", pList[0], bgpMessage1)
+ checkBestPathResult("*table.IPv4Path", "20.20.20.0/24", "192.168.50.1", pList[1], bgpMessage1)
+ checkBestPathResult("*table.IPv4Path", "30.30.30.0/24", "192.168.50.1", pList[2], bgpMessage1)
+ checkBestPathResult("*table.IPv4Path", "40.40.40.0/24", "192.168.50.1", pList[3], bgpMessage1)
+ checkBestPathResult("*table.IPv4Path", "50.50.50.0/24", "192.168.50.1", pList[4], bgpMessage1)
pList, wList, err = tm.ProcessUpdate(peer1, bgpMessage2)
assert.Equal(t, 5, len(pList))
assert.Equal(t, 0, len(wList))
assert.NoError(t, err)
- checkBestPathResult("*table.IPv4Path", "11.11.11.0", "192.168.50.1", pList[0], bgpMessage2)
- checkBestPathResult("*table.IPv4Path", "22.22.22.0", "192.168.50.1", pList[1], bgpMessage2)
- checkBestPathResult("*table.IPv4Path", "33.33.33.0", "192.168.50.1", pList[2], bgpMessage2)
- checkBestPathResult("*table.IPv4Path", "44.44.44.0", "192.168.50.1", pList[3], bgpMessage2)
- checkBestPathResult("*table.IPv4Path", "55.55.55.0", "192.168.50.1", pList[4], bgpMessage2)
+ checkBestPathResult("*table.IPv4Path", "11.11.11.0/24", "192.168.50.1", pList[0], bgpMessage2)
+ checkBestPathResult("*table.IPv4Path", "22.22.22.0/24", "192.168.50.1", pList[1], bgpMessage2)
+ checkBestPathResult("*table.IPv4Path", "33.33.33.0/24", "192.168.50.1", pList[2], bgpMessage2)
+ checkBestPathResult("*table.IPv4Path", "44.44.44.0/24", "192.168.50.1", pList[3], bgpMessage2)
+ checkBestPathResult("*table.IPv4Path", "55.55.55.0/24", "192.168.50.1", pList[4], bgpMessage2)
pList, wList, err = tm.ProcessUpdate(peer1, bgpMessage3)
assert.Equal(t, 2, len(pList))
@@ -2099,7 +2099,7 @@ func TestProcessBGPUpdate_multiple_nlri_ipv6(t *testing.T) {
assert.Equal(t, reflect.TypeOf(p).String(), expectedType)
checkPattr(m, p)
// check destination
- assert.Equal(t, prefix, p.getPrefix().String())
+ assert.Equal(t, prefix, p.getPrefix())
// check nexthop
assert.Equal(t, nexthop, p.getNexthop().String())
}
@@ -2151,22 +2151,22 @@ func TestProcessBGPUpdate_multiple_nlri_ipv6(t *testing.T) {
assert.Equal(t, 0, len(wList))
assert.NoError(t, err)
- checkBestPathResult("*table.IPv6Path", "2001:123:1210:11::", "2001::192:168:50:1", pList[0], bgpMessage1)
- checkBestPathResult("*table.IPv6Path", "2001:123:1220:11::", "2001::192:168:50:1", pList[1], bgpMessage1)
- checkBestPathResult("*table.IPv6Path", "2001:123:1230:11::", "2001::192:168:50:1", pList[2], bgpMessage1)
- checkBestPathResult("*table.IPv6Path", "2001:123:1240:11::", "2001::192:168:50:1", pList[3], bgpMessage1)
- checkBestPathResult("*table.IPv6Path", "2001:123:1250:11::", "2001::192:168:50:1", pList[4], bgpMessage1)
+ checkBestPathResult("*table.IPv6Path", "2001:123:1210:11::/64", "2001::192:168:50:1", pList[0], bgpMessage1)
+ checkBestPathResult("*table.IPv6Path", "2001:123:1220:11::/64", "2001::192:168:50:1", pList[1], bgpMessage1)
+ checkBestPathResult("*table.IPv6Path", "2001:123:1230:11::/64", "2001::192:168:50:1", pList[2], bgpMessage1)
+ checkBestPathResult("*table.IPv6Path", "2001:123:1240:11::/64", "2001::192:168:50:1", pList[3], bgpMessage1)
+ checkBestPathResult("*table.IPv6Path", "2001:123:1250:11::/64", "2001::192:168:50:1", pList[4], bgpMessage1)
pList, wList, err = tm.ProcessUpdate(peer1, bgpMessage2)
assert.Equal(t, 5, len(pList))
assert.Equal(t, 0, len(wList))
assert.NoError(t, err)
- checkBestPathResult("*table.IPv6Path", "2001:123:1211:11::", "2001::192:168:50:1", pList[0], bgpMessage2)
- checkBestPathResult("*table.IPv6Path", "2001:123:1222:11::", "2001::192:168:50:1", pList[1], bgpMessage2)
- checkBestPathResult("*table.IPv6Path", "2001:123:1233:11::", "2001::192:168:50:1", pList[2], bgpMessage2)
- checkBestPathResult("*table.IPv6Path", "2001:123:1244:11::", "2001::192:168:50:1", pList[3], bgpMessage2)
- checkBestPathResult("*table.IPv6Path", "2001:123:1255:11::", "2001::192:168:50:1", pList[4], bgpMessage2)
+ checkBestPathResult("*table.IPv6Path", "2001:123:1211:11::/64", "2001::192:168:50:1", pList[0], bgpMessage2)
+ checkBestPathResult("*table.IPv6Path", "2001:123:1222:11::/64", "2001::192:168:50:1", pList[1], bgpMessage2)
+ checkBestPathResult("*table.IPv6Path", "2001:123:1233:11::/64", "2001::192:168:50:1", pList[2], bgpMessage2)
+ checkBestPathResult("*table.IPv6Path", "2001:123:1244:11::/64", "2001::192:168:50:1", pList[3], bgpMessage2)
+ checkBestPathResult("*table.IPv6Path", "2001:123:1255:11::/64", "2001::192:168:50:1", pList[4], bgpMessage2)
pList, wList, err = tm.ProcessUpdate(peer1, bgpMessage3)
assert.Equal(t, 2, len(pList))