Issue 505: update gogrid to use new ubuntu image by default

This commit is contained in:
Adrian Cole 2011-03-11 20:59:05 -08:00
parent beb915424b
commit 35291abba4
4 changed files with 7 additions and 29 deletions

Binary file not shown.

View File

@ -19,7 +19,7 @@
package org.jclouds.gogrid.compute.config; package org.jclouds.gogrid.compute.config;
import static org.jclouds.compute.domain.OsFamily.CENTOS; import static org.jclouds.compute.domain.OsFamily.UBUNTU;
import org.jclouds.compute.config.BaseComputeServiceContextModule; import org.jclouds.compute.config.BaseComputeServiceContextModule;
import org.jclouds.compute.domain.TemplateBuilder; import org.jclouds.compute.domain.TemplateBuilder;
@ -42,6 +42,6 @@ public class GoGridComputeServiceContextModule extends BaseComputeServiceContext
@Override @Override
protected TemplateBuilder provideTemplate(Injector injector, TemplateBuilder template) { protected TemplateBuilder provideTemplate(Injector injector, TemplateBuilder template) {
return template.osFamily(CENTOS).imageNameMatches(".*w/ None.*"); return template.osFamily(UBUNTU).imageNameMatches(".*w/ None.*");
} }
} }

View File

@ -19,16 +19,7 @@
package org.jclouds.gogrid.compute; package org.jclouds.gogrid.compute;
import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
import static org.testng.Assert.assertEquals;
import org.jclouds.compute.BaseComputeServiceLiveTest; import org.jclouds.compute.BaseComputeServiceLiveTest;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.compute.domain.OsFamily;
import org.jclouds.compute.domain.Template;
import org.jclouds.gogrid.GoGridAsyncClient;
import org.jclouds.gogrid.GoGridClient;
import org.jclouds.rest.RestContext;
import org.jclouds.ssh.jsch.config.JschSshClientModule; import org.jclouds.ssh.jsch.config.JschSshClientModule;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -41,24 +32,9 @@ public class GoGridComputeServiceLiveTest extends BaseComputeServiceLiveTest {
provider = "gogrid"; provider = "gogrid";
} }
@Test
public void testTemplateBuilder() {
Template defaultTemplate = client.templateBuilder().build();
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "5.3");
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.CENTOS);
assertEquals(defaultTemplate.getLocation().getId(), "1");
assertEquals(getCores(defaultTemplate.getHardware()), 0.5d);
}
@Override @Override
protected JschSshClientModule getSshModule() { protected JschSshClientModule getSshModule() {
return new JschSshClientModule(); return new JschSshClientModule();
} }
public void testAssignability() throws Exception {
@SuppressWarnings("unused")
RestContext<GoGridClient, GoGridAsyncClient> goGridContext = new ComputeServiceContextFactory().createContext(
provider, identity, credential).getProviderSpecificContext();
}
} }

View File

@ -53,6 +53,8 @@ public class GoGridTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
switch (input.family) { switch (input.family) {
case RHEL: case RHEL:
return !input.version.equals("") && !input.version.equals("5.4"); return !input.version.equals("") && !input.version.equals("5.4");
case UBUNTU:
return !input.version.equals("") && !input.version.equals("10.04");
case CENTOS: case CENTOS:
return !input.version.equals("") && !input.version.equals("5.3"); return !input.version.equals("") && !input.version.equals("5.3");
case WINDOWS: case WINDOWS:
@ -68,14 +70,14 @@ public class GoGridTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
@Test @Test
public void testDefaultTemplateBuilder() throws IOException { public void testDefaultTemplateBuilder() throws IOException {
Template defaultTemplate = context.getComputeService().templateBuilder().build(); Template defaultTemplate = context.getComputeService().templateBuilder().build();
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "5.3"); assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "10.04");
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.CENTOS); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(getCores(defaultTemplate.getHardware()), 0.5d); assertEquals(getCores(defaultTemplate.getHardware()), 0.5d);
} }
@Override @Override
protected Set<String> getIso3166Codes() { protected Set<String> getIso3166Codes() {
return ImmutableSet.<String> of("US-CA","US-VA"); return ImmutableSet.<String> of("US-CA", "US-VA");
} }
} }