summaryrefslogtreecommitdiffhomepage
path: root/table/path_test.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-01-12 21:18:08 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-01-16 16:25:24 +0900
commitb344eb3777e5088f0a97d585e81e546363ea4101 (patch)
tree16def797a39da2bf6d61fa30e664b699fc561247 /table/path_test.go
parent49ec4a328fd2e1bdc81797f150089818031ae6e1 (diff)
table: kill unused field medSetByTargetNeighbor
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
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
}