Skip to content
Snippets Groups Projects
Commit b22332fd authored by Josh Brooks's avatar Josh Brooks
Browse files

Remove tests of no longer existing funcitons

parent e472274f
No related branches found
No related tags found
No related merge requests found
...@@ -395,106 +395,6 @@ func TestHostPool_CheckReplace(t *testing.T) { ...@@ -395,106 +395,6 @@ func TestHostPool_CheckReplace(t *testing.T) {
} }
// TODO: Adapt to new methods
// Happy path
//func TestHostPool_PruneHostPool(t *testing.T) {
// manager := newMockManager()
// testNdf := getTestNdf(t)
// newIndex := uint32(20)
// params := DefaultPoolParams()
// params.PoolSize = uint32(len(testNdf.Gateways))
// rng := csprng.NewSystemRNG()
//
// // Construct a manager (bypass business logic in constructor)
// hostPool := &HostPool{
// manager: manager,
// hostList: make([]*connect.Host, newIndex+1),
// hostMap: make(map[id.ID]uint32),
// ndf: testNdf,
// poolParams: params,
// rng: rng,
// }
//
// // Pull all gateways from ndf into host manager
// hostList := make([]*connect.Host, 0)
// for _, gw := range testNdf.Gateways {
//
// gwId, err := id.Unmarshal(gw.ID)
// if err != nil {
// t.Errorf("Failed to unmarshal ID in mock ndf: %v", err)
// }
// // Add mock gateway to manager
// h, err := manager.AddHost(gwId, "", nil, connect.GetDefaultHostParams())
// if err != nil {
// t.Errorf("Could not add mock host to manager: %v", err)
// t.FailNow()
// }
//
// hostList = append(hostList, h)
//
// }
//
// // Construct a host past the error threshold
// errorThresholdIndex := 0
// overThreshold := params.ErrThreshold + 25
// hostList[errorThresholdIndex].SetMetricsTesting(connect.NewMetricTesting(overThreshold, t), t)
// oldHost := hostList[0]
//
// // Call prune host pool
// err := hostPool.pruneHostPool()
// if err != nil {
// t.Errorf("Unexpected error in happy path: %v", err)
// }
//
// // Check that the host map has been properly updated
// for _, h := range hostList {
// _, ok := hostPool.hostMap[*h.GetId()]
// if !ok {
// t.Errorf("Gateway %s was not placed in host map after pruning", h.GetId().String())
// }
// }
//
// // Check that the host list has been has been properly updated
// // at the index with a host past the error threshold
// retrievedHost := hostPool.hostList[errorThresholdIndex]
// if reflect.DeepEqual(oldHost, retrievedHost) {
// t.Errorf("Expected host list to have it's bad host replaced. " +
// "Contains old host information after pruning")
// }
//
//}
//
//// Error path: not enough gateways in ndf compared to
//// required pool size
//func TestHostPool_PruneHostPool_Error(t *testing.T) {
// manager := newMockManager()
// testNdf := getTestNdf(t)
// newIndex := uint32(20)
// params := DefaultPoolParams()
//
// // Trigger the case where the Ndf doesn't have enough gateways
// params.PoolSize = uint32(len(testNdf.Gateways)) + 1
// rng := csprng.NewSystemRNG()
//
// // Construct a manager (bypass business logic in constructor)
// hostPool := &HostPool{
// manager: manager,
// hostList: make([]*connect.Host, newIndex+1),
// hostMap: make(map[id.ID]uint32),
// ndf: testNdf,
// poolParams: params,
// rng: rng,
// }
//
// // Call prune
// err := hostPool.pruneHostPool()
// if err == nil {
// t.Errorf("Gateways should not be available: " +
// "not enough gateways in ndf compared to param's pool size")
// }
//
//}
// Unit test // Unit test
func TestHostPool_UpdateNdf(t *testing.T) { func TestHostPool_UpdateNdf(t *testing.T) {
manager := newMockManager() manager := newMockManager()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment