mirror of https://github.com/apache/jclouds.git
updated template builders for current images
This commit is contained in:
parent
95753e5695
commit
208c474969
|
@ -52,11 +52,13 @@ public class CloudServersUKTemplateBuilderLiveTest extends BaseTemplateBuilderLi
|
||||||
public boolean apply(OsFamilyVersion64Bit input) {
|
public boolean apply(OsFamilyVersion64Bit input) {
|
||||||
switch (input.family) {
|
switch (input.family) {
|
||||||
case UBUNTU:
|
case UBUNTU:
|
||||||
return !(input.version.startsWith("12.04") || input.version.startsWith("11.10")) && input.is64Bit;
|
return (input.version.equals("") || input.version.equals("10.04") || input.version.startsWith("11"))
|
||||||
|
&& input.is64Bit;
|
||||||
case DEBIAN:
|
case DEBIAN:
|
||||||
return input.is64Bit && !input.version.matches("[56].0");
|
return input.is64Bit && !input.version.matches("[56].0");
|
||||||
case CENTOS:
|
case CENTOS:
|
||||||
return !(input.version.matches("5.[0237]") || input.version.equals("6.0")) && input.is64Bit;
|
return (input.version.equals("") || input.version.equals("5.6") || input.version.equals("6.0"))
|
||||||
|
&& input.is64Bit;
|
||||||
case WINDOWS:
|
case WINDOWS:
|
||||||
return input.version.equals("2008 SP2") || input.version.equals("")
|
return input.version.equals("2008 SP2") || input.version.equals("")
|
||||||
|| (input.version.equals("2008 R2") && input.is64Bit);
|
|| (input.version.equals("2008 R2") && input.is64Bit);
|
||||||
|
@ -72,7 +74,7 @@ public class CloudServersUKTemplateBuilderLiveTest extends BaseTemplateBuilderLi
|
||||||
public void testTemplateBuilder() {
|
public void testTemplateBuilder() {
|
||||||
Template defaultTemplate = this.context.getComputeService().templateBuilder().build();
|
Template defaultTemplate = this.context.getComputeService().templateBuilder().build();
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "11.04");
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "11.10");
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
||||||
assertEquals(defaultTemplate.getLocation().getId(), provider);
|
assertEquals(defaultTemplate.getLocation().getId(), provider);
|
||||||
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
|
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
|
||||||
|
|
|
@ -52,11 +52,13 @@ public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLi
|
||||||
public boolean apply(OsFamilyVersion64Bit input) {
|
public boolean apply(OsFamilyVersion64Bit input) {
|
||||||
switch (input.family) {
|
switch (input.family) {
|
||||||
case UBUNTU:
|
case UBUNTU:
|
||||||
return !(input.version.startsWith("12.04") || input.version.startsWith("11.10")) && input.is64Bit;
|
return (input.version.equals("") || input.version.equals("10.04") || input.version.startsWith("11"))
|
||||||
|
&& input.is64Bit;
|
||||||
case DEBIAN:
|
case DEBIAN:
|
||||||
return input.is64Bit && !input.version.matches("[56].0");
|
return input.is64Bit && !input.version.matches("[56].0");
|
||||||
case CENTOS:
|
case CENTOS:
|
||||||
return !(input.version.matches("5.[0237]") || input.version.equals("6.0")) && input.is64Bit;
|
return (input.version.equals("") || input.version.equals("5.6") || input.version.equals("6.0"))
|
||||||
|
&& input.is64Bit;
|
||||||
case WINDOWS:
|
case WINDOWS:
|
||||||
return input.version.equals("2008 SP2") || input.version.equals("")
|
return input.version.equals("2008 SP2") || input.version.equals("")
|
||||||
|| (input.version.equals("2008 R2") && input.is64Bit);
|
|| (input.version.equals("2008 R2") && input.is64Bit);
|
||||||
|
@ -72,7 +74,7 @@ public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLi
|
||||||
public void testTemplateBuilder() {
|
public void testTemplateBuilder() {
|
||||||
Template defaultTemplate = this.context.getComputeService().templateBuilder().build();
|
Template defaultTemplate = this.context.getComputeService().templateBuilder().build();
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "11.04");
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "11.10");
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
||||||
assertEquals(defaultTemplate.getLocation().getId(), provider);
|
assertEquals(defaultTemplate.getLocation().getId(), provider);
|
||||||
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
|
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
|
||||||
|
|
|
@ -53,18 +53,16 @@ public class SlicehostTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTes
|
||||||
public boolean apply(OsFamilyVersion64Bit input) {
|
public boolean apply(OsFamilyVersion64Bit input) {
|
||||||
switch (input.family) {
|
switch (input.family) {
|
||||||
case UBUNTU:
|
case UBUNTU:
|
||||||
return !(input.version.startsWith("11.10") || input.version.equals("8.04") || (input.version
|
return (input.version.equals("") || input.version.equals("10.04") || input.version.startsWith("11"))
|
||||||
.equals("11.04") && !input.is64Bit));
|
&& input.is64Bit;
|
||||||
case DEBIAN:
|
case DEBIAN:
|
||||||
return !(input.version.equals("6.0") && !input.is64Bit);
|
return input.is64Bit;
|
||||||
case RHEL:
|
|
||||||
return input.version.equals("") && input.is64Bit;
|
|
||||||
case CENTOS:
|
case CENTOS:
|
||||||
return input.version.equals("") || input.version.matches("5.[45]")
|
return (input.version.equals("") || input.version.matches("5.[0456]") || input.version.equals("6.0"))
|
||||||
|| (input.version.matches("5.[06]") && input.is64Bit);
|
&& input.is64Bit;
|
||||||
case WINDOWS:
|
case WINDOWS:
|
||||||
return input.version.equals("") || (input.version.equals("2008 SP2") && !input.is64Bit)
|
return input.version.equals("2008 SP2") || input.version.equals("")
|
||||||
|| input.version.equals("") || (input.version.equals("2008 R2") && input.is64Bit);
|
|| ((input.version.equals("2003") || input.version.equals("2008 R2")) && input.is64Bit);
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -73,10 +71,15 @@ public class SlicehostTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void testFromTemplate() {
|
||||||
|
// TODO: multiple servers match
|
||||||
|
}
|
||||||
|
|
||||||
@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(), "11.04");
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "11.10");
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
||||||
assertEquals(getCores(defaultTemplate.getHardware()), 0.25d);
|
assertEquals(getCores(defaultTemplate.getHardware()), 0.25d);
|
||||||
|
|
Loading…
Reference in New Issue