mirror of https://github.com/apache/jclouds.git
fixed templates in rimu
This commit is contained in:
parent
9bb3e4d041
commit
84a84f481f
|
@ -92,7 +92,7 @@ public class RimuHostingClientLiveTest {
|
||||||
public void testPricingPlans() {
|
public void testPricingPlans() {
|
||||||
Set<? extends PricingPlan> plans = connection.getPricingPlanList();
|
Set<? extends PricingPlan> plans = connection.getPricingPlanList();
|
||||||
for (PricingPlan plan : plans) {
|
for (PricingPlan plan : plans) {
|
||||||
if (plan.getId().equalsIgnoreCase("miro1")) {
|
if (plan.getId().equalsIgnoreCase("MIRO4B")) {
|
||||||
assertTrue(true);
|
assertTrue(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,12 +19,7 @@
|
||||||
|
|
||||||
package org.jclouds.rimuhosting.miro.compute;
|
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.BaseComputeServiceLiveTest;
|
||||||
import org.jclouds.compute.domain.OsFamily;
|
|
||||||
import org.jclouds.compute.domain.Template;
|
|
||||||
import org.jclouds.ssh.jsch.config.JschSshClientModule;
|
import org.jclouds.ssh.jsch.config.JschSshClientModule;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -44,17 +39,6 @@ public class RimuHostingComputeServiceLiveTest extends BaseComputeServiceLiveTes
|
||||||
group = "rimuhosting.jclouds";
|
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
|
@Override
|
||||||
protected JschSshClientModule getSshModule() {
|
protected JschSshClientModule getSshModule() {
|
||||||
return new JschSshClientModule();
|
return new JschSshClientModule();
|
||||||
|
|
|
@ -19,11 +19,15 @@
|
||||||
|
|
||||||
package org.jclouds.rimuhosting.miro.compute;
|
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 java.util.Set;
|
||||||
|
|
||||||
import org.jclouds.compute.BaseTemplateBuilderLiveTest;
|
import org.jclouds.compute.BaseTemplateBuilderLiveTest;
|
||||||
import org.jclouds.compute.domain.OsFamily;
|
import org.jclouds.compute.domain.OsFamily;
|
||||||
import org.jclouds.compute.domain.OsFamilyVersion64Bit;
|
import org.jclouds.compute.domain.OsFamilyVersion64Bit;
|
||||||
|
import org.jclouds.compute.domain.Template;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
|
@ -46,14 +50,31 @@ public class RimuHostingTemplateBuilderLiveTest extends BaseTemplateBuilderLiveT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(OsFamilyVersion64Bit input) {
|
public boolean apply(OsFamilyVersion64Bit input) {
|
||||||
return input.family != OsFamily.UBUNTU || //
|
switch (input.family) {
|
||||||
Float.parseFloat(input.version) > 10.04 || //
|
case UBUNTU:
|
||||||
(!(input.is64Bit) && Float.parseFloat(input.version) < 8.10);
|
// 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
|
@Override
|
||||||
protected Set<String> getIso3166Codes() {
|
protected Set<String> getIso3166Codes() {
|
||||||
return ImmutableSet.<String> of("NZ-AUK", "US-TX", "AU-NSW", "GB-LND");
|
return ImmutableSet.<String> of("NZ-AUK", "US-TX", "AU-NSW", "GB-LND");
|
||||||
|
|
Loading…
Reference in New Issue