summaryrefslogtreecommitdiffhomepage
path: root/table/path_test.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-03 23:05:23 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-04 20:30:51 +0900
commit52ddad958f10ae9ea7ab8c40130825c903d08c52 (patch)
tree4097992e648a41e75928e89dad134ff67abfff37 /table/path_test.go
parenta3cb22a9027b4fd9f360f873b976472aad4ae173 (diff)
table: remove Path's source version
Even if a connection with peer is down and up, table code gets BGPmessages belonging the first connection before the event of the peer down in order. So we don't need source version stuff inherent from Ryu BGP code. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/path_test.go')
-rw-r--r--table/path_test.go34
1 files changed, 9 insertions, 25 deletions
diff --git a/table/path_test.go b/table/path_test.go
index feed46ed..b913520f 100644
--- a/table/path_test.go
+++ b/table/path_test.go
@@ -13,14 +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(), true, pathP[0].getPathAttrs(), pathP[0].getMedSetByTargetNeighbor())
+ ipv4p := NewIPv4Path(pathP[0].getSource(), pathP[0].getNlri(), 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(), true, pathP[0].getPathAttrs(), pathP[0].getMedSetByTargetNeighbor())
+ ipv6p := NewIPv6Path(pathP[0].getSource(), pathP[0].getNlri(), true, pathP[0].getPathAttrs(), pathP[0].getMedSetByTargetNeighbor())
assert.NotNil(t, ipv6p)
}
@@ -41,7 +41,7 @@ func TestPathIPv4GetDefault(t *testing.T) {
}
func TestPathIPv6SetDefault(t *testing.T) {
- pd := &PathDefault{sourceVerNum: 4}
+ pd := &PathDefault{}
ipv6p := &IPv6Path{}
ipv6p.setPathDefault(pd)
r_pd := ipv6p.getPathDefault()
@@ -49,7 +49,7 @@ func TestPathIPv6SetDefault(t *testing.T) {
}
func TestPathIPv6GetDefault(t *testing.T) {
- pd := &PathDefault{sourceVerNum: 5}
+ pd := &PathDefault{}
ipv6p := &IPv6Path{}
ipv6p.setPathDefault(pd)
r_pd := ipv6p.getPathDefault()
@@ -64,7 +64,7 @@ func TestPathGetRouteFamily(t *testing.T) {
func TestPathSetSource(t *testing.T) {
pd := &PathDefault{}
- pr := &PeerInfo{AS: 65000, VersionNum: 4}
+ pr := &PeerInfo{AS: 65000}
pd.setSource(pr)
r_pr := pd.getSource()
assert.Equal(t, r_pr, pr)
@@ -72,7 +72,7 @@ func TestPathSetSource(t *testing.T) {
func TestPathGetSource(t *testing.T) {
pd := &PathDefault{}
- pr := &PeerInfo{AS: 65001, VersionNum: 4}
+ pr := &PeerInfo{AS: 65001}
pd.setSource(pr)
r_pr := pd.getSource()
assert.Equal(t, r_pr, pr)
@@ -94,22 +94,6 @@ func TestPathgetNexthop(t *testing.T) {
assert.Equal(t, nh, ip)
}
-func TestPathSetSourceVerNum(t *testing.T) {
- pd := &PathDefault{}
- svn := 4
- pd.setSourceVerNum(svn)
- r_svn := pd.getSourceVerNum()
- assert.Equal(t, r_svn, svn)
-}
-
-func TestPathGetSourceVerNum(t *testing.T) {
- pd := &PathDefault{}
- svn := 5
- pd.setSourceVerNum(svn)
- r_svn := pd.getSourceVerNum()
- assert.Equal(t, r_svn, svn)
-}
-
func TestPathSetWithdraw(t *testing.T) {
pd := &PathDefault{}
wd := true
@@ -182,9 +166,9 @@ func TestPathGetAttribute(t *testing.T) {
}
func PathCreatePeer() []*PeerInfo {
- peerP1 := &PeerInfo{VersionNum: 4, AS: 65000}
- peerP2 := &PeerInfo{VersionNum: 4, AS: 65001}
- peerP3 := &PeerInfo{VersionNum: 4, AS: 65002}
+ peerP1 := &PeerInfo{AS: 65000}
+ peerP2 := &PeerInfo{AS: 65001}
+ peerP3 := &PeerInfo{AS: 65002}
peerP := []*PeerInfo{peerP1, peerP2, peerP3}
return peerP
}