diff --git a/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKTemplateBuilderLiveTest.java b/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKTemplateBuilderLiveTest.java index 39a93439cb..06f8b1e263 100644 --- a/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKTemplateBuilderLiveTest.java +++ b/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKTemplateBuilderLiveTest.java @@ -43,7 +43,7 @@ public class CloudServersUKTemplateBuilderLiveTest extends BaseTemplateBuilderLi public CloudServersUKTemplateBuilderLiveTest() { provider = "cloudservers-uk"; } - + @Override protected Predicate defineUnsupportedOperatingSystems() { return Predicates.not(new Predicate() { @@ -51,15 +51,17 @@ public class CloudServersUKTemplateBuilderLiveTest extends BaseTemplateBuilderLi @Override public boolean apply(OsFamilyVersion64Bit input) { switch (input.family) { - case UBUNTU: - return !(input.version.startsWith("12.04") || input.version.startsWith("11.10")) && input.is64Bit; - case DEBIAN: - return input.is64Bit && !input.version.matches("[56].0"); - case CENTOS: - return !(input.version.matches("5.[0237]") || input.version.equals("6.0")) && input.is64Bit; - case WINDOWS: - return input.version.equals("2008 SP2") || input.version.equals("") - || (input.version.equals("2008 R2") && input.is64Bit); + case UBUNTU: + return (input.version.equals("") || input.version.equals("10.04") || input.version.startsWith("11")) + && input.is64Bit; + case DEBIAN: + return input.is64Bit && !input.version.matches("[56].0"); + case CENTOS: + return (input.version.equals("") || input.version.equals("5.6") || input.version.equals("6.0")) + && input.is64Bit; + case WINDOWS: + return input.version.equals("2008 SP2") || input.version.equals("") + || (input.version.equals("2008 R2") && input.is64Bit); default: return false; } @@ -72,7 +74,7 @@ public class CloudServersUKTemplateBuilderLiveTest extends BaseTemplateBuilderLi public void testTemplateBuilder() { Template defaultTemplate = this.context.getComputeService().templateBuilder().build(); 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.getLocation().getId(), provider); assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); diff --git a/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSTemplateBuilderLiveTest.java b/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSTemplateBuilderLiveTest.java index 56f3d08bea..e9b7d4625d 100644 --- a/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSTemplateBuilderLiveTest.java +++ b/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSTemplateBuilderLiveTest.java @@ -51,15 +51,17 @@ public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLi @Override public boolean apply(OsFamilyVersion64Bit input) { switch (input.family) { - case UBUNTU: - return !(input.version.startsWith("12.04") || input.version.startsWith("11.10")) && input.is64Bit; - case DEBIAN: - return input.is64Bit && !input.version.matches("[56].0"); - case CENTOS: - return !(input.version.matches("5.[0237]") || input.version.equals("6.0")) && input.is64Bit; - case WINDOWS: - return input.version.equals("2008 SP2") || input.version.equals("") - || (input.version.equals("2008 R2") && input.is64Bit); + case UBUNTU: + return (input.version.equals("") || input.version.equals("10.04") || input.version.startsWith("11")) + && input.is64Bit; + case DEBIAN: + return input.is64Bit && !input.version.matches("[56].0"); + case CENTOS: + return (input.version.equals("") || input.version.equals("5.6") || input.version.equals("6.0")) + && input.is64Bit; + case WINDOWS: + return input.version.equals("2008 SP2") || input.version.equals("") + || (input.version.equals("2008 R2") && input.is64Bit); default: return false; } @@ -72,7 +74,7 @@ public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLi public void testTemplateBuilder() { Template defaultTemplate = this.context.getComputeService().templateBuilder().build(); 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.getLocation().getId(), provider); assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); diff --git a/providers/slicehost/src/test/java/org/jclouds/slicehost/compute/SlicehostTemplateBuilderLiveTest.java b/providers/slicehost/src/test/java/org/jclouds/slicehost/compute/SlicehostTemplateBuilderLiveTest.java index 8a42e6c3ea..4b6c1d5dc1 100644 --- a/providers/slicehost/src/test/java/org/jclouds/slicehost/compute/SlicehostTemplateBuilderLiveTest.java +++ b/providers/slicehost/src/test/java/org/jclouds/slicehost/compute/SlicehostTemplateBuilderLiveTest.java @@ -53,18 +53,16 @@ public class SlicehostTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTes public boolean apply(OsFamilyVersion64Bit input) { switch (input.family) { case UBUNTU: - return !(input.version.startsWith("11.10") || input.version.equals("8.04") || (input.version - .equals("11.04") && !input.is64Bit)); + return (input.version.equals("") || input.version.equals("10.04") || input.version.startsWith("11")) + && input.is64Bit; case DEBIAN: - return !(input.version.equals("6.0") && !input.is64Bit); - case RHEL: - return input.version.equals("") && input.is64Bit; + return input.is64Bit; case CENTOS: - return input.version.equals("") || input.version.matches("5.[45]") - || (input.version.matches("5.[06]") && input.is64Bit); + return (input.version.equals("") || input.version.matches("5.[0456]") || input.version.equals("6.0")) + && input.is64Bit; case WINDOWS: - return input.version.equals("") || (input.version.equals("2008 SP2") && !input.is64Bit) - || input.version.equals("") || (input.version.equals("2008 R2") && input.is64Bit); + return input.version.equals("2008 SP2") || input.version.equals("") + || ((input.version.equals("2003") || input.version.equals("2008 R2")) && input.is64Bit); default: return false; } @@ -73,10 +71,15 @@ public class SlicehostTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTes }); } + @Override + public void testFromTemplate() { + // TODO: multiple servers match + } + @Test public void testDefaultTemplateBuilder() throws IOException { 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().getFamily(), OsFamily.UBUNTU); assertEquals(getCores(defaultTemplate.getHardware()), 0.25d);