use of com.netflix.simianarmy.chaos.TestChaosMonkeyContext in project SimianArmy by Netflix.
the class TestCloudFormationChaosMonkey method testGetEffectiveProbability.
@Test
public void testGetEffectiveProbability() {
TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("cloudformation.properties");
CloudFormationChaosMonkey chaos = new CloudFormationChaosMonkey(ctx);
InstanceGroup group1 = new BasicInstanceGroup("new-group-TestGroup1-XCFNFNFNF", TestChaosMonkeyContext.CrawlerTypes.TYPE_D, "region", Collections.<TagDescription>emptyList());
assertEquals(1.0, chaos.getEffectiveProbability(group1));
}
use of com.netflix.simianarmy.chaos.TestChaosMonkeyContext in project SimianArmy by Netflix.
the class TestCloudFormationChaosMonkey method testNoSuffixInstanceGroup.
@Test
public void testNoSuffixInstanceGroup() {
TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("disabled.properties");
CloudFormationChaosMonkey chaos = new CloudFormationChaosMonkey(ctx);
InstanceGroup group = new BasicInstanceGroup("new-group-TestGroup-XCFNFNFNF", TestChaosMonkeyContext.CrawlerTypes.TYPE_D, "region", Collections.<TagDescription>emptyList());
InstanceGroup newGroup = chaos.noSuffixInstanceGroup(group);
assertEquals(newGroup.name(), "new-group-TestGroup");
}
use of com.netflix.simianarmy.chaos.TestChaosMonkeyContext in project SimianArmy by Netflix.
the class TestBasicChaosMonkey method testMandatoryTerminationNotDefined.
@Test
public void testMandatoryTerminationNotDefined() {
TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("mandatoryTerminationNotDefined.properties");
ChaosMonkey chaos = new BasicChaosMonkey(ctx);
chaos.start();
chaos.stop();
Assert.assertEquals(ctx.selectedOn().size(), 1);
Assert.assertEquals(ctx.terminated().size(), 0);
}
use of com.netflix.simianarmy.chaos.TestChaosMonkeyContext in project SimianArmy by Netflix.
the class TestBasicChaosMonkey method testMaxTerminationCountPerDayAsNegative.
@Test
public void testMaxTerminationCountPerDayAsNegative() {
TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("terminationPerDayAsNegative.properties");
ChaosMonkey chaos = new BasicChaosMonkey(ctx);
chaos.start();
chaos.stop();
Assert.assertEquals(ctx.selectedOn().size(), 0);
Assert.assertEquals(ctx.terminated().size(), 0);
}
use of com.netflix.simianarmy.chaos.TestChaosMonkeyContext in project SimianArmy by Netflix.
the class TestBasicChaosMonkey method testEnabledB.
@Test
public void testEnabledB() {
TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("enabledB.properties");
ChaosMonkey chaos = new BasicChaosMonkey(ctx);
chaos.start();
chaos.stop();
List<InstanceGroup> selectedOn = ctx.selectedOn();
List<String> terminated = ctx.terminated();
Assert.assertEquals(selectedOn.size(), 2);
Assert.assertEquals(selectedOn.get(0).type(), TestChaosMonkeyContext.CrawlerTypes.TYPE_B);
Assert.assertEquals(selectedOn.get(0).name(), "name2");
Assert.assertEquals(selectedOn.get(1).type(), TestChaosMonkeyContext.CrawlerTypes.TYPE_B);
Assert.assertEquals(selectedOn.get(1).name(), "name3");
Assert.assertEquals(terminated.size(), 0, "nothing terminated");
}
Aggregations