ec2 test stabilization

This commit is contained in:
Adrian Cole 2011-10-04 02:21:51 -07:00
parent fb86273dd9
commit f326be00f8
4 changed files with 13 additions and 13 deletions

View File

@ -88,7 +88,7 @@ public class AWSEC2TemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
.build();
assert (template.getImage().getProviderId().startsWith("ami-")) : template;
assertEquals(template.getImage().getOperatingSystem().getVersion(), "11.04");
assertEquals(template.getImage().getOperatingSystem().getVersion(), "11.10");
assertEquals(template.getImage().getOperatingSystem().is64Bit(), false);
assertEquals(template.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(template.getImage().getUserMetadata().get("rootDeviceType"), "instance-store");
@ -107,7 +107,7 @@ public class AWSEC2TemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
.build();
assert (template.getImage().getProviderId().startsWith("ami-")) : template;
assertEquals(template.getImage().getOperatingSystem().getVersion(), "11.04");
assertEquals(template.getImage().getOperatingSystem().getVersion(), "11.10");
assertEquals(template.getImage().getOperatingSystem().is64Bit(), false);
assertEquals(template.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(template.getImage().getUserMetadata().get("rootDeviceType"), "instance-store");
@ -183,7 +183,7 @@ public class AWSEC2TemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
fastestTemplate = context.getComputeService().templateBuilder().fastest().build();
assert (fastestTemplate.getImage().getProviderId().startsWith("ami-")) : fastestTemplate;
assertEquals(fastestTemplate.getHardware().getProviderId(), InstanceType.CC1_4XLARGE);
assertEquals(fastestTemplate.getImage().getOperatingSystem().getVersion(), "11.04");
assertEquals(fastestTemplate.getImage().getOperatingSystem().getVersion(), "11.10");
assertEquals(fastestTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(fastestTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(fastestTemplate.getImage().getUserMetadata().get("rootDeviceType"), "ebs");

View File

@ -144,7 +144,7 @@ public class AMIClientLiveTest {
.put("root-device-type", "ebs")//
.build()).ownedBy("137112412989", "099720109477"));
assertNotNull(twoResults);
assertEquals(twoResults.size(), 31);
assertEquals(twoResults.size(), 33);
}
@Test(enabled = false)

View File

@ -132,12 +132,12 @@ public class AWSKeyPairClientLiveTest {
NodeMetadata first = get(nodes, 0);
assert first.getCredentials() != null : first;
assert first.getCredentials().identity != null : first;
assert first.getCredentials().credential == null : first;
AWSRunningInstance instance = getInstance(instanceClient, first.getProviderId());
assert instance.getSpotInstanceRequestId() != null : instance;
assertEquals(instance.getKeyName(), "jclouds#" + group);
assertEquals(first.getCredentials().credential, null);
Map<? extends NodeMetadata, ExecResponse> responses = computeContext.getComputeService()
.runScriptOnNodesMatching(

View File

@ -23,13 +23,11 @@ import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Sets.newTreeSet;
import static org.jclouds.compute.ComputeTestUtils.buildScript;
import static org.jclouds.compute.ComputeTestUtils.setupKeyPair;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.SortedSet;
@ -46,11 +44,14 @@ import org.jclouds.compute.ComputeServiceContext;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.compute.RunNodesException;
import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.compute.domain.OsFamily;
import org.jclouds.compute.domain.Template;
import org.jclouds.compute.predicates.NodePredicates;
import org.jclouds.ec2.domain.InstanceType;
import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.predicates.RetryablePredicate;
import org.jclouds.scriptbuilder.domain.Statements;
import org.jclouds.scriptbuilder.statements.login.AdminAccess;
import org.jclouds.sshj.config.SshjSshClientModule;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeClass;
@ -74,7 +75,6 @@ public class PlacementGroupClientLiveTest {
private RetryablePredicate<PlacementGroup> availableTester;
private RetryablePredicate<PlacementGroup> deletedTester;
private PlacementGroup group;
private Map<String, String> keyPair;
protected String provider = "aws-ec2";
protected String identity;
protected String credential;
@ -109,7 +109,6 @@ public class PlacementGroupClientLiveTest {
Properties overrides = setupProperties();
context = new ComputeServiceContextFactory().createContext(provider,
ImmutableSet.<Module> of(new Log4JLoggingModule(), new SshjSshClientModule()), overrides);
keyPair = setupKeyPair();
client = AWSEC2Client.class.cast(context.getProviderSpecificContext().getApi());
@ -168,15 +167,16 @@ public class PlacementGroupClientLiveTest {
public void testStartCCInstance() throws Exception {
Template template = context.getComputeService().templateBuilder().fastest().osDescriptionMatches(".*/ubuntu-images/.*").osVersionMatches("11.04").build();
Template template = context.getComputeService().templateBuilder().fastest().osFamily(OsFamily.AMZN_LINUX).build();
assert template != null : "The returned template was null, but it should have a value.";
assertEquals(template.getHardware().getProviderId(), InstanceType.CC1_4XLARGE);
assertEquals(template.getImage().getUserMetadata().get("rootDeviceType"), "ebs");
assertEquals(template.getImage().getUserMetadata().get("virtualizationType"), "hvm");
assertEquals(template.getImage().getUserMetadata().get("hypervisor"), "xen");
template.getOptions().overrideLoginCredentialWith(keyPair.get("private"))
.authorizePublicKey(keyPair.get("public")).runScript(buildScript(template.getImage().getOperatingSystem()));
template.getOptions().runScript(
Statements.newStatementList(AdminAccess.standard(),
buildScript(template.getImage().getOperatingSystem())));
String group = PREFIX + "cccluster";
context.getComputeService().destroyNodesMatching(NodePredicates.inGroup(group));