Search in sources :

Example 81 with ProtectionSystem

use of com.emc.storageos.db.client.model.ProtectionSystem in project coprhd-controller by CoprHD.

the class RecoverPointSchedulerTest method fireProtectionPlacementRulesCLRValidTest.

@Test
public void fireProtectionPlacementRulesCLRValidTest() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException, SecurityException, NoSuchMethodException {
    ProtectionSystem ps = buildProtectionSystemWithCapacity();
    RPProtectionRecommendation ppm1 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm1, ps, "1", "2", nh1, nh2, pool1, poolA, 1);
    RPProtectionRecommendation ppm2 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm2, ps, "1", "2", nh1, nh2, pool1, poolB, 1);
    RPProtectionRecommendation ppm3 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm3, ps, "1", "2", nh1, nh2, pool2, poolA, 1);
    RPProtectionRecommendation ppm4 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm4, ps, "1", "2", nh1, nh2, pool3, poolB, 1);
    assertTrue(invokeFireProtectionPlacementRules(ps, ppm1, 1));
    assertTrue(invokeFireProtectionPlacementRules(ps, ppm2, 1));
    assertTrue(invokeFireProtectionPlacementRules(ps, ppm3, 1));
    assertTrue(invokeFireProtectionPlacementRules(ps, ppm4, 1));
}
Also used : RPProtectionRecommendation(com.emc.storageos.volumecontroller.RPProtectionRecommendation) ProtectionSystem(com.emc.storageos.db.client.model.ProtectionSystem) Test(org.junit.Test)

Example 82 with ProtectionSystem

use of com.emc.storageos.db.client.model.ProtectionSystem in project coprhd-controller by CoprHD.

the class RecoverPointSchedulerTest method buildProtectionSystemWithCapacity.

private ProtectionSystem buildProtectionSystemWithCapacity() {
    ProtectionSystem ps = new ProtectionSystem();
    ps.setId(URI.create("PSURI_CAPACITY"));
    // set the stats
    ps.setCgCapacity(312L);
    ps.setCgCount(12L);
    ps.setLabel("rp_protection_system_capacity");
    Map<String, String> siteVolCapacity = new HashMap<String, String>();
    siteVolCapacity.put("1", "512");
    siteVolCapacity.put("2", "512");
    Map<String, String> siteVolCount = new HashMap<String, String>();
    siteVolCount.put("1", "100");
    siteVolCount.put("2", "100");
    ps.setSiteVolumeCapacity(new StringMap(siteVolCapacity));
    ps.setSiteVolumeCount(new StringMap(siteVolCount));
    return ps;
}
Also used : StringMap(com.emc.storageos.db.client.model.StringMap) HashMap(java.util.HashMap) ProtectionSystem(com.emc.storageos.db.client.model.ProtectionSystem)

Example 83 with ProtectionSystem

use of com.emc.storageos.db.client.model.ProtectionSystem in project coprhd-controller by CoprHD.

the class RecoverPointSchedulerTest method fireProtectionPlacementRulesCRRSite1NoCapacityTest.

@Test
public void fireProtectionPlacementRulesCRRSite1NoCapacityTest() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException, SecurityException, NoSuchMethodException {
    ProtectionSystem ps = buildProtectionSystemWithCapacity();
    // set the remote site vol capacity to 1 less than full.
    ps.getSiteVolumeCount().remove("1");
    ps.getSiteVolumeCount().put("1", "512");
    RPProtectionRecommendation ppm1 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm1, ps, "1", "2", nh1, nh2, pool1, poolA, 1);
    RPProtectionRecommendation ppm2 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm2, ps, "1", "2", nh1, nh2, pool1, poolB, 1);
    RPProtectionRecommendation ppm3 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm3, ps, "1", "2", nh1, nh2, pool2, poolA, 1);
    RPProtectionRecommendation ppm4 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm4, ps, "1", "2", nh1, nh2, pool3, poolB, 1);
    assertTrue(!invokeFireProtectionPlacementRules(ps, ppm1, 1));
    assertTrue(!invokeFireProtectionPlacementRules(ps, ppm2, 1));
    assertTrue(!invokeFireProtectionPlacementRules(ps, ppm3, 1));
    assertTrue(!invokeFireProtectionPlacementRules(ps, ppm4, 1));
}
Also used : RPProtectionRecommendation(com.emc.storageos.volumecontroller.RPProtectionRecommendation) ProtectionSystem(com.emc.storageos.db.client.model.ProtectionSystem) Test(org.junit.Test)

Example 84 with ProtectionSystem

use of com.emc.storageos.db.client.model.ProtectionSystem in project coprhd-controller by CoprHD.

the class RecoverPointSchedulerTest method fireProtectionPlacementRulesCRRSite2NoCapacityTest.

@Test
public void fireProtectionPlacementRulesCRRSite2NoCapacityTest() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException, SecurityException, NoSuchMethodException {
    ProtectionSystem ps = buildProtectionSystemWithCapacity();
    // set the remote site vol capacity to 1 less than full.
    ps.getSiteVolumeCount().remove("2");
    ps.getSiteVolumeCount().put("2", "511");
    RPProtectionRecommendation ppm1 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm1, ps, "1", "2", nh1, nh2, pool1, poolA, 1);
    RPProtectionRecommendation ppm2 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm2, ps, "1", "2", nh1, nh2, pool1, poolB, 1);
    RPProtectionRecommendation ppm3 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm3, ps, "1", "2", nh1, nh2, pool2, poolA, 1);
    RPProtectionRecommendation ppm4 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm4, ps, "1", "2", nh1, nh2, pool3, poolB, 1);
    assertTrue(!invokeFireProtectionPlacementRules(ps, ppm1, 1));
    assertTrue(!invokeFireProtectionPlacementRules(ps, ppm2, 1));
    assertTrue(!invokeFireProtectionPlacementRules(ps, ppm3, 1));
    assertTrue(!invokeFireProtectionPlacementRules(ps, ppm4, 1));
}
Also used : RPProtectionRecommendation(com.emc.storageos.volumecontroller.RPProtectionRecommendation) ProtectionSystem(com.emc.storageos.db.client.model.ProtectionSystem) Test(org.junit.Test)

Example 85 with ProtectionSystem

use of com.emc.storageos.db.client.model.ProtectionSystem in project coprhd-controller by CoprHD.

the class RecoverPointSchedulerTest method fireProtectionPlacementRulesCRRValidCapacityTest.

@Test
public void fireProtectionPlacementRulesCRRValidCapacityTest() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException, SecurityException, NoSuchMethodException {
    ProtectionSystem ps = buildProtectionSystemWithCapacity();
    RPProtectionRecommendation ppm1 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm1, ps, "1", "2", nh1, nh2, pool1, poolA, 1);
    RPProtectionRecommendation ppm2 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm2, ps, "1", "2", nh1, nh2, pool1, poolB, 1);
    RPProtectionRecommendation ppm3 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm3, ps, "1", "2", nh1, nh2, pool2, poolA, 1);
    RPProtectionRecommendation ppm4 = new RPProtectionRecommendation();
    fillRecommendationObject(ppm4, ps, "1", "2", nh1, nh2, pool3, poolB, 1);
    assertTrue(invokeFireProtectionPlacementRules(ps, ppm1, 1));
    assertTrue(invokeFireProtectionPlacementRules(ps, ppm2, 1));
    assertTrue(invokeFireProtectionPlacementRules(ps, ppm3, 1));
    assertTrue(invokeFireProtectionPlacementRules(ps, ppm4, 1));
}
Also used : RPProtectionRecommendation(com.emc.storageos.volumecontroller.RPProtectionRecommendation) ProtectionSystem(com.emc.storageos.db.client.model.ProtectionSystem) Test(org.junit.Test)

Aggregations

ProtectionSystem (com.emc.storageos.db.client.model.ProtectionSystem)120 URI (java.net.URI)57 ArrayList (java.util.ArrayList)52 NamedURI (com.emc.storageos.db.client.model.NamedURI)44 Volume (com.emc.storageos.db.client.model.Volume)44 HashMap (java.util.HashMap)32 StringSet (com.emc.storageos.db.client.model.StringSet)30 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)28 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)25 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)25 ControllerException (com.emc.storageos.volumecontroller.ControllerException)25 RPProtectionRecommendation (com.emc.storageos.volumecontroller.RPProtectionRecommendation)25 URISyntaxException (java.net.URISyntaxException)25 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)24 RecoverPointException (com.emc.storageos.recoverpoint.exceptions.RecoverPointException)24 InternalServerErrorException (com.emc.storageos.svcs.errorhandling.resources.InternalServerErrorException)24 WorkflowException (com.emc.storageos.workflow.WorkflowException)24 Test (org.junit.Test)24 FunctionalAPIActionFailedException_Exception (com.emc.fapiclient.ws.FunctionalAPIActionFailedException_Exception)23 FunctionalAPIInternalError_Exception (com.emc.fapiclient.ws.FunctionalAPIInternalError_Exception)23