fixed templates in rimu

This commit is contained in:
Adrian Cole 2011-04-01 11:39:42 -07:00
parent 9bb3e4d041
commit 84a84f481f
3 changed files with 25 additions and 20 deletions

View File

@ -92,7 +92,7 @@ public class RimuHostingClientLiveTest {
public void testPricingPlans() {
Set<? extends PricingPlan> plans = connection.getPricingPlanList();
for (PricingPlan plan : plans) {
if (plan.getId().equalsIgnoreCase("miro1")) {
if (plan.getId().equalsIgnoreCase("MIRO4B")) {
assertTrue(true);
return;
}

View File

@ -19,12 +19,7 @@
package org.jclouds.rimuhosting.miro.compute;
import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
import static org.testng.Assert.assertEquals;
import org.jclouds.compute.BaseComputeServiceLiveTest;
import org.jclouds.compute.domain.OsFamily;
import org.jclouds.compute.domain.Template;
import org.jclouds.ssh.jsch.config.JschSshClientModule;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@ -44,17 +39,6 @@ public class RimuHostingComputeServiceLiveTest extends BaseComputeServiceLiveTes
group = "rimuhosting.jclouds";
}
@Test
public void testTemplateBuilder() {
Template defaultTemplate = client.templateBuilder().build();
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), false);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "10.04");
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(defaultTemplate.getLocation().getId(), "DCDALLAS");
assertEquals(defaultTemplate.getHardware().getProviderId(), "MIRO4B");
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
}
@Override
protected JschSshClientModule getSshModule() {
return new JschSshClientModule();

View File

@ -19,11 +19,15 @@
package org.jclouds.rimuhosting.miro.compute;
import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
import static org.testng.Assert.assertEquals;
import java.util.Set;
import org.jclouds.compute.BaseTemplateBuilderLiveTest;
import org.jclouds.compute.domain.OsFamily;
import org.jclouds.compute.domain.OsFamilyVersion64Bit;
import org.jclouds.compute.domain.Template;
import org.testng.annotations.Test;
import com.google.common.base.Predicate;
@ -46,14 +50,31 @@ public class RimuHostingTemplateBuilderLiveTest extends BaseTemplateBuilderLiveT
@Override
public boolean apply(OsFamilyVersion64Bit input) {
return input.family != OsFamily.UBUNTU || //
Float.parseFloat(input.version) > 10.04 || //
(!(input.is64Bit) && Float.parseFloat(input.version) < 8.10);
switch (input.family) {
case UBUNTU:
// support for all ubuntu w/empty version and 10.04 & 10.10
return !(input.version.equals("") || input.version.startsWith("10."));
case CENTOS:
return !input.version.equals("");
default:
return true;
}
}
};
}
@Test
public void testTemplateBuilder() {
Template defaultTemplate = context.getComputeService().templateBuilder().build();
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "10.04");
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(defaultTemplate.getLocation().getId(), "DCDALLAS");
assertEquals(defaultTemplate.getHardware().getProviderId(), "MIRO4B");
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
}
@Override
protected Set<String> getIso3166Codes() {
return ImmutableSet.<String> of("NZ-AUK", "US-TX", "AU-NSW", "GB-LND");