use of com.emc.storageos.db.client.model.ProtectionSystem in project coprhd-controller by CoprHD.
the class RecoverPointSchedulerTest method fireProtectionPlacementRulesCDPNoCGAvailability.
@Test
public void fireProtectionPlacementRulesCDPNoCGAvailability() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException, SecurityException, NoSuchMethodException {
ProtectionSystem ps = this.buildProtectionSystemNoCGAvailability();
RPProtectionRecommendation ppm1 = new RPProtectionRecommendation();
fillRecommendationObject(ppm1, ps, "1", "1", nh1, nh1, pool1, pool1, 1);
RPProtectionRecommendation ppm2 = new RPProtectionRecommendation();
fillRecommendationObject(ppm2, ps, "1", "1", nh1, nh1, pool1, pool2, 1);
RPProtectionRecommendation ppm3 = new RPProtectionRecommendation();
fillRecommendationObject(ppm3, ps, "1", "1", nh1, nh1, pool2, pool1, 1);
RPProtectionRecommendation ppm4 = new RPProtectionRecommendation();
fillRecommendationObject(ppm4, ps, "1", "1", nh1, nh1, pool2, pool2, 1);
assertTrue(!invokeFireProtectionPlacementRules(ps, ppm1, 1));
assertTrue(!invokeFireProtectionPlacementRules(ps, ppm2, 1));
assertTrue(!invokeFireProtectionPlacementRules(ps, ppm3, 1));
assertTrue(!invokeFireProtectionPlacementRules(ps, ppm4, 1));
}
use of com.emc.storageos.db.client.model.ProtectionSystem in project coprhd-controller by CoprHD.
the class RecoverPointSchedulerTest method fireProtectionPlacementRulesCDPMixedProtectionSystems.
@Test
public void fireProtectionPlacementRulesCDPMixedProtectionSystems() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException, SecurityException, NoSuchMethodException {
ProtectionSystem ps1 = this.buildProtectionSystemWithCapacity();
ProtectionSystem ps2 = this.buildProtectionSystemNoCGAvailability();
RPProtectionRecommendation ppm1 = new RPProtectionRecommendation();
fillRecommendationObject(ppm1, ps1, "1", "1", nh1, nh1, pool1, pool1, 1);
RPProtectionRecommendation ppm2 = new RPProtectionRecommendation();
fillRecommendationObject(ppm2, ps2, "1", "1", nh2, nh2, poolA, poolB, 1);
RPProtectionRecommendation ppm3 = new RPProtectionRecommendation();
fillRecommendationObject(ppm3, ps2, "1", "1", nh2, nh2, poolA, poolA, 1);
RPProtectionRecommendation ppm4 = new RPProtectionRecommendation();
fillRecommendationObject(ppm4, ps2, "1", "1", nh2, nh2, poolB, poolB, 1);
assertTrue(invokeFireProtectionPlacementRules(ps1, ppm1, 1));
assertTrue(!invokeFireProtectionPlacementRules(ps2, ppm2, 1));
assertTrue(!invokeFireProtectionPlacementRules(ps2, ppm3, 1));
assertTrue(!invokeFireProtectionPlacementRules(ps2, ppm4, 1));
}
use of com.emc.storageos.db.client.model.ProtectionSystem in project coprhd-controller by CoprHD.
the class RecoverPointSchedulerTest method buildProtectionSystemNoCGAvailability.
private ProtectionSystem buildProtectionSystemNoCGAvailability() {
ProtectionSystem ps = new ProtectionSystem();
ps.setId(URI.create("PSURI_NOCG"));
// set the stats
ps.setCgCapacity(312L);
ps.setCgCount(312L);
ps.setLabel("rp_protection_system_no_cg_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", "512");
siteVolCount.put("2", "512");
ps.setSiteVolumeCapacity(new StringMap(siteVolCapacity));
ps.setSiteVolumeCount(new StringMap(siteVolCount));
return ps;
}
use of com.emc.storageos.db.client.model.ProtectionSystem in project coprhd-controller by CoprHD.
the class RecoverPointSchedulerTest method fireProtectionPlacementRulesCLRSite1NoCapacityMultiVolumeTest.
@Test
public void fireProtectionPlacementRulesCLRSite1NoCapacityMultiVolumeTest() 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", "510");
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, 2);
RPProtectionRecommendation ppm4 = new RPProtectionRecommendation();
fillRecommendationObject(ppm4, ps, "1", "2", nh1, nh2, pool3, poolB, 4);
assertTrue(invokeFireProtectionPlacementRules(ps, ppm1, 1));
assertTrue(invokeFireProtectionPlacementRules(ps, ppm2, 1));
assertTrue(!invokeFireProtectionPlacementRules(ps, ppm3, 2));
assertTrue(!invokeFireProtectionPlacementRules(ps, ppm4, 4));
}
use of com.emc.storageos.db.client.model.ProtectionSystem in project coprhd-controller by CoprHD.
the class RecoverPointSchedulerTest method buildProtectionSystemWithNoCapacitySite1.
private ProtectionSystem buildProtectionSystemWithNoCapacitySite1() {
ProtectionSystem ps = new ProtectionSystem();
ps.setId(URI.create("PSURI_NOCAPACITYSITE1"));
// set the stats
ps.setCgCapacity(312L);
ps.setCgCount(12L);
ps.setLabel("rp_protection_system_no_capacity_site1");
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", "512");
siteVolCount.put("2", "100");
ps.setSiteVolumeCapacity(new StringMap(siteVolCapacity));
ps.setSiteVolumeCount(new StringMap(siteVolCount));
return ps;
}
Aggregations