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.go36
1 files changed, 10 insertions, 26 deletions
diff --git a/table/path_test.go b/table/path_test.go
index 98e59092..48dec6fe 100644
--- a/table/path_test.go
+++ b/table/path_test.go
@@ -14,13 +14,13 @@ import (
func TestPathNewIPv4(t *testing.T) {
peerP := PathCreatePeer()
pathP := PathCreatePath(peerP)
- ipv4p := NewPath(pathP[0].GetSource(), pathP[0].GetNlri(), true, pathP[0].GetPathAttrs(), pathP[0].getMedSetByTargetNeighbor(), time.Now(), false)
+ ipv4p := NewPath(pathP[0].GetSource(), pathP[0].GetNlri(), true, pathP[0].GetPathAttrs(), time.Now(), false)
assert.NotNil(t, ipv4p)
}
func TestPathNewIPv6(t *testing.T) {
peerP := PathCreatePeer()
pathP := PathCreatePath(peerP)
- ipv6p := NewPath(pathP[0].GetSource(), pathP[0].GetNlri(), true, pathP[0].GetPathAttrs(), pathP[0].getMedSetByTargetNeighbor(), time.Now(), false)
+ ipv6p := NewPath(pathP[0].GetSource(), pathP[0].GetNlri(), true, pathP[0].GetPathAttrs(), time.Now(), false)
assert.NotNil(t, ipv6p)
}
@@ -49,22 +49,6 @@ func TestPathGetNlri(t *testing.T) {
assert.Equal(t, r_nlri, nlri)
}
-func TestPathSetMedSetByTargetNeighbor(t *testing.T) {
- pd := &Path{}
- msbt := true
- pd.setMedSetByTargetNeighbor(msbt)
- r_msbt := pd.getMedSetByTargetNeighbor()
- assert.Equal(t, r_msbt, msbt)
-}
-
-func TestPathGetMedSetByTargetNeighbor(t *testing.T) {
- pd := &Path{}
- msbt := true
- pd.setMedSetByTargetNeighbor(msbt)
- r_msbt := pd.getMedSetByTargetNeighbor()
- assert.Equal(t, r_msbt, msbt)
-}
-
func TestPathCreatePath(t *testing.T) {
peerP := PathCreatePeer()
msg := updateMsgP1()
@@ -72,7 +56,7 @@ func TestPathCreatePath(t *testing.T) {
nlriList := updateMsgP.NLRI
pathAttributes := updateMsgP.PathAttributes
nlri_info := nlriList[0]
- path := NewPath(peerP[0], nlri_info, false, pathAttributes, false, time.Now(), false)
+ path := NewPath(peerP[0], nlri_info, false, pathAttributes, time.Now(), false)
assert.NotNil(t, path)
}
@@ -117,7 +101,7 @@ func TestASPathLen(t *testing.T) {
update := bgpmsg.Body.(*bgp.BGPUpdate)
UpdatePathAttrs4ByteAs(update)
peer := PathCreatePeer()
- p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, false, time.Now(), false)
+ p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, time.Now(), false)
assert.Equal(10, p.GetAsPathLen())
}
@@ -143,7 +127,7 @@ func TestPathPrependAsnToExistingSeqAttr(t *testing.T) {
update := bgpmsg.Body.(*bgp.BGPUpdate)
UpdatePathAttrs4ByteAs(update)
peer := PathCreatePeer()
- p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, false, time.Now(), false)
+ p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, time.Now(), false)
p.PrependAsn(65000, 1)
assert.Equal([]uint32{65000, 65001, 65002, 65003, 65004, 65005, 0, 0, 0}, p.GetAsSeqList())
@@ -165,7 +149,7 @@ func TestPathPrependAsnToNewAsPathAttr(t *testing.T) {
update := bgpmsg.Body.(*bgp.BGPUpdate)
UpdatePathAttrs4ByteAs(update)
peer := PathCreatePeer()
- p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, false, time.Now(), false)
+ p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, time.Now(), false)
asn := uint32(65000)
p.PrependAsn(asn, 1)
@@ -193,7 +177,7 @@ func TestPathPrependAsnToNewAsPathSeq(t *testing.T) {
update := bgpmsg.Body.(*bgp.BGPUpdate)
UpdatePathAttrs4ByteAs(update)
peer := PathCreatePeer()
- p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, false, time.Now(), false)
+ p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, time.Now(), false)
asn := uint32(65000)
p.PrependAsn(asn, 1)
@@ -223,7 +207,7 @@ func TestPathPrependAsnToEmptyAsPathAttr(t *testing.T) {
update := bgpmsg.Body.(*bgp.BGPUpdate)
UpdatePathAttrs4ByteAs(update)
peer := PathCreatePeer()
- p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, false, time.Now(), false)
+ p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, time.Now(), false)
asn := uint32(65000)
p.PrependAsn(asn, 1)
@@ -259,7 +243,7 @@ func TestPathPrependAsnToFullPathAttr(t *testing.T) {
update := bgpmsg.Body.(*bgp.BGPUpdate)
UpdatePathAttrs4ByteAs(update)
peer := PathCreatePeer()
- p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, false, time.Now(), false)
+ p := NewPath(peer[0], update.NLRI[0], false, update.PathAttributes, time.Now(), false)
expected := []uint32{65000, 65000}
for _, v := range asns {
@@ -288,7 +272,7 @@ func PathCreatePath(peerP []*PeerInfo) []*Path {
nlriList := updateMsgP.NLRI
pathAttributes := updateMsgP.PathAttributes
nlri_info := nlriList[0]
- pathP[i] = NewPath(peerP[i], nlri_info, false, pathAttributes, false, time.Now(), false)
+ pathP[i] = NewPath(peerP[i], nlri_info, false, pathAttributes, time.Now(), false)
}
return pathP
}