diff --git a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java index cf238072e5..0578a01812 100644 --- a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java @@ -67,7 +67,7 @@ import com.google.inject.Injector; import com.google.inject.Module; /** - * + * * @author Adrian Cole */ @Test(groups = "live", enabled = true, sequential = true, testName = "compute.ComputeServiceLiveTest") @@ -119,7 +119,13 @@ public abstract class BaseComputeServiceLiveTest { abstract protected Module getSshModule(); - @Test(enabled = true) + public void testTemplateMatch() throws Exception { + template = buildTemplate(client.templateBuilder()); + Template toMatch = client.templateBuilder().imageId(template.getImage().getId()).build(); + assertEquals(toMatch, template); + } + + @Test(dependsOnMethods = "testTemplateMatch") public void testCreate() throws Exception { try { client.destroyNodesWithTag(tag); @@ -130,11 +136,8 @@ public abstract class BaseComputeServiceLiveTest { } template = buildTemplate(client.templateBuilder()); - template - .getOptions() - .installPrivateKey(keyPair.get("private")) - .authorizePublicKey(keyPair.get("public")) - .runScript(buildScript().getBytes()); + template.getOptions().installPrivateKey(keyPair.get("private")).authorizePublicKey( + keyPair.get("public")).runScript(buildScript().getBytes()); nodes = Sets.newTreeSet(client.runNodesWithTag(tag, 2, template).values()); assertEquals(nodes.size(), 2); checkNodes(); @@ -170,17 +173,16 @@ public abstract class BaseComputeServiceLiveTest { protected abstract Template buildTemplate(TemplateBuilder templateBuilder); protected String buildScript() { - return - new StringBuilder()// - .append("echo nameserver 208.67.222.222 >> /etc/resolv.conf\n")// - .append("cp /etc/apt/sources.list /etc/apt/sources.list.old\n")// - .append( - "sed 's~us.archive.ubuntu.com~mirror.anl.gov/pub~g' /etc/apt/sources.list.old >/etc/apt/sources.list\n")// - .append("apt-get update\n")// - .append("apt-get install -f -y --force-yes openjdk-6-jdk\n")// - .append("wget -qO/usr/bin/runurl run.alestic.com/runurl\n")// - .append("chmod 755 /usr/bin/runurl\n")// - .toString(); + return new StringBuilder()// + .append("echo nameserver 208.67.222.222 >> /etc/resolv.conf\n")// + .append("cp /etc/apt/sources.list /etc/apt/sources.list.old\n")// + .append( + "sed 's~us.archive.ubuntu.com~mirror.anl.gov/pub~g' /etc/apt/sources.list.old >/etc/apt/sources.list\n")// + .append("apt-get update\n")// + .append("apt-get install -f -y --force-yes openjdk-6-jdk\n")// + .append("wget -qO/usr/bin/runurl run.alestic.com/runurl\n")// + .append("chmod 755 /usr/bin/runurl\n")// + .toString(); } @Test(enabled = true, dependsOnMethods = "testCreate") diff --git a/gogrid/src/test/java/org/jclouds/gogrid/GoGridComputeServiceLiveTest.java b/gogrid/src/test/java/org/jclouds/gogrid/GoGridComputeServiceLiveTest.java index 98c1de878e..ed77be3ea7 100644 --- a/gogrid/src/test/java/org/jclouds/gogrid/GoGridComputeServiceLiveTest.java +++ b/gogrid/src/test/java/org/jclouds/gogrid/GoGridComputeServiceLiveTest.java @@ -55,15 +55,13 @@ public class GoGridComputeServiceLiveTest extends BaseComputeServiceLiveTest { @Override public String buildScript() { return new StringBuilder() - // .append("echo nameserver 208.67.222.222 >> /etc/resolv.conf\n") - // .append("echo \"[jdkrepo]\" >> /etc/yum.repos.d/CentOS-Base.repo\n") .append("echo \"name=jdkrepository\" >> /etc/yum.repos.d/CentOS-Base.repo\n") .append( "echo \"baseurl=http://ec2-us-east-mirror.rightscale.com/epel/5/i386/\" >> /etc/yum.repos.d/CentOS-Base.repo\n") .append("echo \"enabled=1\" >> /etc/yum.repos.d/CentOS-Base.repo\n") - .append("yum -y install java-1.6.0-openjdk\n") + .append("yum --nogpgcheck -y install java-1.6.0-openjdk\n") .append( "echo \"export PATH=\\\"/usr/lib/jvm/jre-1.6.0-openjdk/bin/:\\$PATH\\\"\" >> /root/.bashrc\n") .toString();