use of org.apache.whirr.service.DryRunModule.DryRun in project whirr by apache.
the class BaseServiceDryRunTest method launchWithClusterSpec.
protected DryRun launchWithClusterSpec(ClusterSpec clusterSpec) throws IOException, InterruptedException {
ClusterController controller = new ClusterController();
DryRun dryRun = controller.getCompute().apply(clusterSpec).utils().injector().getInstance(DryRun.class);
dryRun.reset();
controller.launchCluster(clusterSpec);
return dryRun;
}
use of org.apache.whirr.service.DryRunModule.DryRun in project whirr by apache.
the class ChefServiceDryRunTest method testChefWithAttributes.
/**
* Tests that a simple recipe (the default recipe in a cookbook without any
* configuration parameters) is correctly loaded and executed.
*/
@Test
public void testChefWithAttributes() throws Exception {
ClusterSpec cookbookWithSpecificRecipe = newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates", "1 chef:java:sun"));
DryRun dryRun = launchWithClusterSpec(cookbookWithSpecificRecipe);
assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
// chef execution with a default cookbook recipe should contain a
// particular string
assertScriptPredicateOnPhase(dryRun, "configure", containsPattern("chef-solo -j /tmp/java::sun"));
}
use of org.apache.whirr.service.DryRunModule.DryRun in project whirr by apache.
the class ChefServiceDryRunTest method testChefOnly.
/**
* Tests that a simple recipe (the default recipe in a cookbook without any
* configuration parameters) is correctly loaded and executed.
*/
@Test
public void testChefOnly() throws Exception {
ClusterSpec chefOnly = newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates", "1 chef"));
DryRun dryRun = launchWithClusterSpec(chefOnly);
assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
// We now have iptables calls by default in the configure phase.
}
use of org.apache.whirr.service.DryRunModule.DryRun in project whirr by apache.
the class KerberosServerDryRunTest method testJavaInstalled.
@Test
public void testJavaInstalled() throws Exception {
DryRun dryRun = launchWithClusterSpec(newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates", "1 " + KerberosServerHandler.ROLE + "+" + KerberosClientHandler.ROLE)));
assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
assertScriptPredicateOnPhase(dryRun, "bootstrap", containsPattern("install_openjdk"));
}
use of org.apache.whirr.service.DryRunModule.DryRun in project whirr by apache.
the class KerberosServerDryRunTest method testKerberosRealm.
@Test
public void testKerberosRealm() throws Exception {
DryRun dryRun = launchWithClusterSpec(newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates", "1 " + KerberosServerHandler.ROLE)));
assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
assertScriptPredicateOnPhase(dryRun, "configure", configurePredicate());
}
Aggregations