Updates live tests and template builder settings for compute

This commit is contained in:
Zack Shoylev 2015-07-14 01:26:42 -05:00
parent 2c1ca89e1a
commit a472a878b0
6 changed files with 13 additions and 13 deletions

View File

@ -87,7 +87,7 @@ public final class ComputeServiceConstants {
@Named(OS_VERSION_MAP_JSON) @Named(OS_VERSION_MAP_JSON)
// TODO: switch this to read from resource, failing back to string // TODO: switch this to read from resource, failing back to string
// constant on classpath problem // constant on classpath problem
public String osVersionMapJson = "{\"suse\":{\"\":\"\",\"11\":\"11\",\"11 SP1\":\"11 SP1\"},\"debian\":{\"\":\"\",\"lenny\":\"5.0\",\"6\":\"6.0\",\"squeeze\":\"6.0\"},\"centos\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\",\"5.6\":\"5.6\",\"5.7\":\"5.7\",\"6\":\"6.0\",\"6.0\":\"6.0\",\"6.2\":\"6.2\",\"6.3\":\"6.3\",\"6.4\":\"6.4\",\"6.5\":\"6.5\",\"6.6\":\"6.6\",\"7.0\":\"7.0\"},\"rhel\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\",\"5.6\":\"5.6\",\"5.7\":\"5.7\",\"6\":\"6.0\",\"6.0\":\"6.0\",\"6.1\":\"6.1\",\"6.3\":\"6.3\",\"6.4\":\"6.4\",\"6.5\":\"6.5\",\"6.6\":\"6.6\",\"7.0\":\"7.0\"},\"solaris\":{\"\":\"\",\"10\":\"10\"},\"ubuntu\":{\"\":\"\",\"hardy\":\"8.04\",\"karmic\":\"9.10\",\"lucid\":\"10.04\",\"10.04.1\":\"10.04\",\"maverick\":\"10.10\",\"natty\":\"11.04\",\"oneiric\":\"11.10\",\"precise\":\"12.04\",\"quantal\":\"12.10\",\"raring\":\"13.04\",\"saucy\":\"13.10\",\"trusty\":\"14.04\",\"utopic\":\"14.10\"},\"windows\":{\"\":\"\",\"7\":\"7\",\"2003\":\"2003\",\"2003 Standard\":\"2003\",\"2003 R2\":\"2003 R2\",\"2008\":\"2008\",\"2008 Web\":\"2008\",\"2008 Server\":\"2008\",\"Server 2008\":\"2008\",\"2008 R1\":\"2008 R1\",\"2008 R2\":\"2008 R2\",\"Server 2008 R2\":\"2008 R2\",\"2008 Server R2\":\"2008 R2\",\"2008 SP2\":\"2008 SP2\",\"Server 2008 SP2\":\"2008 SP2\"}}"; public String osVersionMapJson = "{\"suse\":{\"\":\"\",\"11\":\"11\",\"11 SP1\":\"11 SP1\"},\"debian\":{\"\":\"\",\"lenny\":\"5.0\",\"6\":\"6.0\",\"squeeze\":\"6.0\"},\"centos\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\",\"5.6\":\"5.6\",\"5.7\":\"5.7\",\"6\":\"6.0\",\"6.0\":\"6.0\",\"6.2\":\"6.2\",\"6.3\":\"6.3\",\"6.4\":\"6.4\",\"6.5\":\"6.5\",\"6.6\":\"6.6\",\"7.0\":\"7.0\"},\"rhel\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\",\"5.6\":\"5.6\",\"5.7\":\"5.7\",\"6\":\"6.0\",\"6.0\":\"6.0\",\"6.1\":\"6.1\",\"6.3\":\"6.3\",\"6.4\":\"6.4\",\"6.5\":\"6.5\",\"6.6\":\"6.6\",\"7.0\":\"7.0\"},\"solaris\":{\"\":\"\",\"10\":\"10\"},\"ubuntu\":{\"\":\"\",\"hardy\":\"8.04\",\"karmic\":\"9.10\",\"lucid\":\"10.04\",\"10.04.1\":\"10.04\",\"maverick\":\"10.10\",\"natty\":\"11.04\",\"oneiric\":\"11.10\",\"precise\":\"12.04\",\"quantal\":\"12.10\",\"raring\":\"13.04\",\"saucy\":\"13.10\",\"trusty\":\"14.04\",\"utopic\":\"14.10\",\"vivid\":\"15.04\",\"wily\":\"15.10\"},\"windows\":{\"\":\"\",\"7\":\"7\",\"2003\":\"2003\",\"2003 Standard\":\"2003\",\"2003 R2\":\"2003 R2\",\"2008\":\"2008\",\"2008 Web\":\"2008\",\"2008 Server\":\"2008\",\"Server 2008\":\"2008\",\"2008 R1\":\"2008 R1\",\"2008 R2\":\"2008 R2\",\"Server 2008 R2\":\"2008 R2\",\"2008 Server R2\":\"2008 R2\",\"2008 SP2\":\"2008 SP2\",\"Server 2008 SP2\":\"2008 SP2\"}}";
} }
@Singleton @Singleton

View File

@ -83,8 +83,8 @@ public abstract class BaseTemplateBuilderLiveTest extends BaseComputeServiceCont
@Test @Test
public void testDefaultTemplateBuilder() throws IOException { public void testDefaultTemplateBuilder() throws IOException {
Template defaultTemplate = view.getComputeService().templateBuilder().build(); Template defaultTemplate = view.getComputeService().templateBuilder().build();
assert defaultTemplate.getImage().getOperatingSystem().getVersion().matches("\\d\\d\\.\\d\\d") : defaultTemplate assertTrue(defaultTemplate.getImage().getOperatingSystem().getVersion().matches("\\d\\d\\.\\d\\d"),
.getImage().getOperatingSystem().getVersion(); "Version mismatch, expected dd.dd, found: " + defaultTemplate.getImage().getOperatingSystem().getVersion());
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()), 1.0d); assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);

View File

@ -68,7 +68,7 @@ public class CloudServersUKProviderMetadata extends BaseProviderMetadata {
properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS); properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS);
properties.setProperty(PROPERTY_REGIONS, "LON"); properties.setProperty(PROPERTY_REGIONS, "LON");
properties.setProperty(PROPERTY_REGION + ".LON." + ISO3166_CODES, "GB-SLG"); properties.setProperty(PROPERTY_REGION + ".LON." + ISO3166_CODES, "GB-SLG");
properties.setProperty(TEMPLATE, "imageNameMatches=.*Ubuntu 14\\.10.*"); properties.setProperty(TEMPLATE, "imageNameMatches=.*Ubuntu.*");
return properties; return properties;
} }

View File

@ -19,6 +19,7 @@ package org.jclouds.rackspace.cloudservers.uk.compute;
import static org.jclouds.compute.util.ComputeServiceUtils.getCores; import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull; import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
import java.util.Set; import java.util.Set;
@ -41,9 +42,8 @@ public class CloudServersUKTemplateBuilderLiveTest extends BaseTemplateBuilderLi
public void testTemplateBuilder() { public void testTemplateBuilder() {
Template defaultTemplate = this.view.getComputeService().templateBuilder().build(); Template defaultTemplate = this.view.getComputeService().templateBuilder().build();
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "12.10");
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(defaultTemplate.getImage().getName(), "Ubuntu 12.10 (Quantal Quetzal)"); assertTrue(defaultTemplate.getImage().getName().contains("Ubuntu"));
assertEquals(defaultTemplate.getImage().getDefaultCredentials().getUser(), "root"); assertEquals(defaultTemplate.getImage().getDefaultCredentials().getUser(), "root");
assertEquals(defaultTemplate.getLocation().getId(), "LON"); assertEquals(defaultTemplate.getLocation().getId(), "LON");
assertEquals(defaultTemplate.getImage().getLocation().getId(), "LON"); assertEquals(defaultTemplate.getImage().getLocation().getId(), "LON");

View File

@ -72,7 +72,7 @@ public class CloudServersUSProviderMetadata extends BaseProviderMetadata {
properties.setProperty(PROPERTY_REGION + ".IAD." + ISO3166_CODES, "US-VA"); properties.setProperty(PROPERTY_REGION + ".IAD." + ISO3166_CODES, "US-VA");
properties.setProperty(PROPERTY_REGION + ".SYD." + ISO3166_CODES, "AU-NSW"); properties.setProperty(PROPERTY_REGION + ".SYD." + ISO3166_CODES, "AU-NSW");
properties.setProperty(PROPERTY_REGION + ".HKG." + ISO3166_CODES, "HK"); properties.setProperty(PROPERTY_REGION + ".HKG." + ISO3166_CODES, "HK");
properties.setProperty(TEMPLATE, "imageNameMatches=.*Ubuntu 14\\.10.*"); properties.setProperty(TEMPLATE, "imageNameMatches=.*Ubuntu.*");
return properties; return properties;
} }

View File

@ -19,6 +19,7 @@ package org.jclouds.rackspace.cloudservers.us.compute;
import static org.jclouds.compute.util.ComputeServiceUtils.getCores; import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull; import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
import java.util.Set; import java.util.Set;
@ -41,9 +42,8 @@ public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLi
public void testTemplateBuilder() { public void testTemplateBuilder() {
Template defaultTemplate = this.view.getComputeService().templateBuilder().build(); Template defaultTemplate = this.view.getComputeService().templateBuilder().build();
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "14.10");
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(defaultTemplate.getImage().getName(), "Ubuntu 14.10 (Utopic Unicorn) (PVHVM)"); assertTrue(defaultTemplate.getImage().getName().contains("Ubuntu"));
assertEquals(defaultTemplate.getImage().getDefaultCredentials().getUser(), "root"); assertEquals(defaultTemplate.getImage().getDefaultCredentials().getUser(), "root");
assertEquals(defaultTemplate.getLocation().getId(), "SYD"); assertEquals(defaultTemplate.getLocation().getId(), "SYD");
assertEquals(defaultTemplate.getImage().getLocation().getId(), "SYD"); assertEquals(defaultTemplate.getImage().getLocation().getId(), "SYD");