summaryrefslogtreecommitdiffhomepage
path: root/table/table_manager_test.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-06 17:05:18 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-06 17:05:18 +0900
commit162a6137ac625552c5e248fa36d56edf89ddd06c (patch)
tree065dbcda7eb30202dbd1c59caeaf00699d951aef /table/table_manager_test.go
parenta085ce2d338e9a79b98d0f9ea24c5b80bccdf0e1 (diff)
table: NewTableManager takes route families
NewTableManager creates tables for only specified route families. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/table_manager_test.go')
-rw-r--r--table/table_manager_test.go48
1 files changed, 24 insertions, 24 deletions
diff --git a/table/table_manager_test.go b/table/table_manager_test.go
index 24c506d4..601a292a 100644
--- a/table/table_manager_test.go
+++ b/table/table_manager_test.go
@@ -67,7 +67,7 @@ func peerR3() *PeerInfo {
// test best path calculation and check the result path is from R1
func TestProcessBGPUpdate_0_select_onlypath_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_0_select_onlypath_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_0_select_onlypath_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
bgpMessage := update_fromR1()
peer := peerR1()
@@ -118,7 +118,7 @@ func TestProcessBGPUpdate_0_select_onlypath_ipv4(t *testing.T) {
// test best path calculation and check the result path is from R1
func TestProcessBGPUpdate_0_select_onlypath_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_0_select_onlypath_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_0_select_onlypath_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
bgpMessage := update_fromR1_ipv6()
peer := peerR1()
@@ -170,7 +170,7 @@ func TestProcessBGPUpdate_0_select_onlypath_ipv6(t *testing.T) {
// test: compare localpref
func TestProcessBGPUpdate_1_select_high_localpref_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_1_select_high_localpref_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_1_select_high_localpref_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
var err error
// low localpref message
@@ -254,7 +254,7 @@ func TestProcessBGPUpdate_1_select_high_localpref_ipv4(t *testing.T) {
func TestProcessBGPUpdate_1_select_high_localpref_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_1_select_high_localpref_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_1_select_high_localpref_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
var err error
origin1 := bgp.NewPathAttributeOrigin(0)
@@ -342,7 +342,7 @@ func TestProcessBGPUpdate_1_select_high_localpref_ipv6(t *testing.T) {
// test: compare localOrigin
func TestProcessBGPUpdate_2_select_local_origin_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_2_select_local_origin_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_2_select_local_origin_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
var err error
// low localpref message
@@ -428,7 +428,7 @@ func TestProcessBGPUpdate_2_select_local_origin_ipv4(t *testing.T) {
func TestProcessBGPUpdate_2_select_local_origin_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_2_select_local_origin_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_2_select_local_origin_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
var err error
origin1 := bgp.NewPathAttributeOrigin(0)
@@ -519,7 +519,7 @@ func TestProcessBGPUpdate_2_select_local_origin_ipv6(t *testing.T) {
// test: compare AS_PATH
func TestProcessBGPUpdate_3_select_aspath_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_3_select_aspath_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_3_select_aspath_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
var err error
bgpMessage1 := update_fromR2viaR1()
@@ -576,7 +576,7 @@ func TestProcessBGPUpdate_3_select_aspath_ipv4(t *testing.T) {
func TestProcessBGPUpdate_3_select_aspath_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_3_select_aspath_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_3_select_aspath_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
var err error
bgpMessage1 := update_fromR2viaR1_ipv6()
@@ -635,7 +635,7 @@ func TestProcessBGPUpdate_3_select_aspath_ipv6(t *testing.T) {
// test: compare Origin
func TestProcessBGPUpdate_4_select_low_origin_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_4_select_low_origin_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_4_select_low_origin_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
var err error
// low origin message
@@ -719,7 +719,7 @@ func TestProcessBGPUpdate_4_select_low_origin_ipv4(t *testing.T) {
func TestProcessBGPUpdate_4_select_low_origin_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_4_select_low_origin_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_4_select_low_origin_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
var err error
origin1 := bgp.NewPathAttributeOrigin(1)
@@ -807,7 +807,7 @@ func TestProcessBGPUpdate_4_select_low_origin_ipv6(t *testing.T) {
// test: compare MED
func TestProcessBGPUpdate_5_select_low_med_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_5_select_low_med_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_5_select_low_med_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
var err error
// low origin message
@@ -891,7 +891,7 @@ func TestProcessBGPUpdate_5_select_low_med_ipv4(t *testing.T) {
func TestProcessBGPUpdate_5_select_low_med_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_5_select_low_med_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_5_select_low_med_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
var err error
origin1 := bgp.NewPathAttributeOrigin(0)
@@ -979,7 +979,7 @@ func TestProcessBGPUpdate_5_select_low_med_ipv6(t *testing.T) {
// test: compare AS_NUMBER(prefer eBGP path)
func TestProcessBGPUpdate_6_select_ebgp_path_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_6_select_ebgp_path_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_6_select_ebgp_path_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
tm.localAsn = uint32(65000)
var err error
@@ -1065,7 +1065,7 @@ func TestProcessBGPUpdate_6_select_ebgp_path_ipv4(t *testing.T) {
func TestProcessBGPUpdate_6_select_ebgp_path_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_6_select_ebgp_path_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_6_select_ebgp_path_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
tm.localAsn = uint32(65000)
var err error
@@ -1156,7 +1156,7 @@ func TestProcessBGPUpdate_6_select_ebgp_path_ipv6(t *testing.T) {
// test: compare Router ID
func TestProcessBGPUpdate_7_select_low_routerid_path_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_7_select_low_routerid_path_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_7_select_low_routerid_path_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
tm.localAsn = uint32(65000)
var err error
@@ -1242,7 +1242,7 @@ func TestProcessBGPUpdate_7_select_low_routerid_path_ipv4(t *testing.T) {
func TestProcessBGPUpdate_7_select_low_routerid_path_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_7_select_low_routerid_path_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_7_select_low_routerid_path_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
tm.localAsn = uint32(65000)
var err error
@@ -1331,7 +1331,7 @@ func TestProcessBGPUpdate_7_select_low_routerid_path_ipv6(t *testing.T) {
// test: withdraw and mpunreach path
func TestProcessBGPUpdate_8_withdraw_path_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_8_withdraw_path_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_8_withdraw_path_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
//setLogger(getLogger(log.DebugLevel))
var err error
@@ -1440,7 +1440,7 @@ func TestProcessBGPUpdate_8_withdraw_path_ipv4(t *testing.T) {
// TODO MP_UNREACH
func TestProcessBGPUpdate_8_mpunreach_path_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_8_mpunreach_path_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_8_mpunreach_path_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
var err error
origin1 := bgp.NewPathAttributeOrigin(0)
@@ -1576,7 +1576,7 @@ func TestProcessBGPUpdate_8_mpunreach_path_ipv6(t *testing.T) {
// handle bestpath lost
func TestProcessBGPUpdate_bestpath_lost_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_bestpath_lost_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_bestpath_lost_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
//setLogger(getLogger(log.DebugLevel))
var err error
@@ -1649,7 +1649,7 @@ func TestProcessBGPUpdate_bestpath_lost_ipv4(t *testing.T) {
func TestProcessBGPUpdate_bestpath_lost_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_bestpath_lost_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_bestpath_lost_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
var err error
origin1 := bgp.NewPathAttributeOrigin(0)
@@ -1725,7 +1725,7 @@ func TestProcessBGPUpdate_bestpath_lost_ipv6(t *testing.T) {
// test: implicit withdrawal case
func TestProcessBGPUpdate_implicit_withdrwal_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_implicit_withdrwal_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_implicit_withdrwal_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
//setLogger(getLogger(log.DebugLevel))
var err error
@@ -1811,7 +1811,7 @@ func TestProcessBGPUpdate_implicit_withdrwal_ipv4(t *testing.T) {
func TestProcessBGPUpdate_implicit_withdrwal_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_implicit_withdrwal_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_implicit_withdrwal_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
var err error
origin1 := bgp.NewPathAttributeOrigin(0)
@@ -1924,7 +1924,7 @@ func TestProcessBGPUpdate_implicit_withdrwal_ipv6(t *testing.T) {
// check multiple paths
func TestProcessBGPUpdate_multiple_nlri_ipv4(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_multiple_nlri_ipv4")
+ tm := NewTableManager("TestProcessBGPUpdate_multiple_nlri_ipv4", []bgp.RouteFamily{bgp.RF_IPv4_UC})
//setLogger(getLogger(log.DebugLevel))
var err error
@@ -2054,7 +2054,7 @@ func TestProcessBGPUpdate_multiple_nlri_ipv4(t *testing.T) {
// check multiple paths
func TestProcessBGPUpdate_multiple_nlri_ipv6(t *testing.T) {
- tm := NewTableManager("TestProcessBGPUpdate_multiple_nlri_ipv6")
+ tm := NewTableManager("TestProcessBGPUpdate_multiple_nlri_ipv6", []bgp.RouteFamily{bgp.RF_IPv6_UC})
//setLogger(getLogger(log.DebugLevel))
var err error