diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-16 17:45:48 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-16 17:45:48 +0900 |
commit | bd82fbdeb6250b2e8f4c18f1792a38a7a5109fad (patch) | |
tree | 5b595f157183fe023fd258b63c429005b5b69750 /table/table_test.go | |
parent | c391a5615462d6b98eecb01b8392b580f76127a3 (diff) |
table: remove CoreService, Neighbors, and Commons structures
No need.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/table_test.go')
-rw-r--r-- | table/table_test.go | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/table/table_test.go b/table/table_test.go index 715177dc..35eddea9 100644 --- a/table/table_test.go +++ b/table/table_test.go @@ -16,24 +16,20 @@ package table import ( - //"fmt" "github.com/osrg/gobgp/packet" "github.com/stretchr/testify/assert" - //"net" "testing" ) func TestTableCreateDestDefault(t *testing.T) { - coreService := &CoreService{CommonConf: &Commons{}, NeighborsConf: &Neighbors{}} - td := NewTableDefault(0, coreService) + td := NewTableDefault(0) nlri := bgp.NewNLRInfo(24, "13.2.3.1") cd := td.createDest(nlri) assert.Nil(t, cd) } func TestTableTableKeyDefault(t *testing.T) { - coreService := &CoreService{CommonConf: &Commons{}, NeighborsConf: &Neighbors{}} - td := NewTableDefault(0, coreService) + td := NewTableDefault(0) nlri := bgp.NewNLRInfo(24, "13.2.3.1") tk := td.tableKey(nlri) assert.Nil(t, tk) @@ -43,8 +39,7 @@ func TestTableInsertSentRoute(t *testing.T) { peerT := TableCreatePeer() msgT := TableCreateMSG(peerT) pathT := TableCreatePath(msgT) - coreService := &CoreService{CommonConf: &Commons{}, NeighborsConf: &Neighbors{}} - ipv4t := NewIPv4Table(0, coreService) + ipv4t := NewIPv4Table(0) for _, path := range pathT { tableKey := ipv4t.tableKey(path.getNlri()) dest := ipv4t.createDest(path.getNlri()) @@ -62,8 +57,7 @@ func TestTableCleanupPathsForPeer(t *testing.T) { peerT := TableCreatePeer() msgT := TableCreateMSG(peerT) pathT := TableCreatePath(msgT) - coreService := &CoreService{CommonConf: &Commons{}, NeighborsConf: &Neighbors{}} - ipv4t := NewIPv4Table(0, coreService) + ipv4t := NewIPv4Table(0) for _, path := range pathT { tableKey := ipv4t.tableKey(path.getNlri()) dest := ipv4t.createDest(path.getNlri()) @@ -82,8 +76,7 @@ func TestTableDeleteDestByNlri(t *testing.T) { peerT := TableCreatePeer() msgT := TableCreateMSG(peerT) pathT := TableCreatePath(msgT) - coreService := &CoreService{CommonConf: &Commons{}, NeighborsConf: &Neighbors{}} - ipv4t := NewIPv4Table(0, coreService) + ipv4t := NewIPv4Table(0) for _, path := range pathT { tableKey := ipv4t.tableKey(path.getNlri()) dest := ipv4t.createDest(path.getNlri()) @@ -99,8 +92,7 @@ func TestTableDeleteDest(t *testing.T) { peerT := TableCreatePeer() msgT := TableCreateMSG(peerT) pathT := TableCreatePath(msgT) - coreService := &CoreService{CommonConf: &Commons{}, NeighborsConf: &Neighbors{}} - ipv4t := NewIPv4Table(0, coreService) + ipv4t := NewIPv4Table(0) for _, path := range pathT { tableKey := ipv4t.tableKey(path.getNlri()) dest := ipv4t.createDest(path.getNlri()) @@ -115,24 +107,16 @@ func TestTableDeleteDest(t *testing.T) { } func TestTableGetRouteFamily(t *testing.T) { - coreService := &CoreService{CommonConf: &Commons{}, NeighborsConf: &Neighbors{}} - ipv4t := NewIPv4Table(0, coreService) + ipv4t := NewIPv4Table(0) rf := ipv4t.getRoutefamily() assert.Equal(t, rf, RF_IPv4_UC) } -func TestTableGetCoreService(t *testing.T) { - coreService := &CoreService{CommonConf: &Commons{}, NeighborsConf: &Neighbors{}} - ipv4t := NewIPv4Table(0, coreService) - cs := ipv4t.getCoreService() - assert.Equal(t, cs, coreService) -} func TestTableSetDestinations(t *testing.T) { peerT := TableCreatePeer() msgT := TableCreateMSG(peerT) pathT := TableCreatePath(msgT) - coreService := &CoreService{CommonConf: &Commons{}, NeighborsConf: &Neighbors{}} - ipv4t := NewIPv4Table(0, coreService) + ipv4t := NewIPv4Table(0) destinations := make(map[string]Destination) for _, path := range pathT { tableKey := ipv4t.tableKey(path.getNlri()) @@ -147,8 +131,7 @@ func TestTableGetDestinations(t *testing.T) { peerT := DestCreatePeer() msgT := DestCreateMSG(peerT) pathT := DestCreatePath(msgT) - coreService := &CoreService{CommonConf: &Commons{}, NeighborsConf: &Neighbors{}} - ipv4t := NewIPv4Table(0, coreService) + ipv4t := NewIPv4Table(0) destinations := make(map[string]Destination) for _, path := range pathT { tableKey := ipv4t.tableKey(path.getNlri()) |