updated cloudsigma tests

This commit is contained in:
Adrian Cole 2012-09-16 23:39:55 -07:00
parent bff49f8311
commit 3d2504e1e4
2 changed files with 28 additions and 21 deletions

View File

@ -25,12 +25,13 @@ import org.jclouds.sshj.config.SshjSshClientModule;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Module; import com.google.inject.Module;
/** /**
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live") @Test(groups = "live", testName = "CloudSigmaComputeServiceLiveTest")
public class CloudSigmaComputeServiceLiveTest extends BaseComputeServiceLiveTest { public class CloudSigmaComputeServiceLiveTest extends BaseComputeServiceLiveTest {
public CloudSigmaComputeServiceLiveTest() { public CloudSigmaComputeServiceLiveTest() {
@ -46,14 +47,21 @@ public class CloudSigmaComputeServiceLiveTest extends BaseComputeServiceLiveTest
@Override @Override
protected void checkUserMetadataInNodeEquals(NodeMetadata node, ImmutableMap<String, String> userMetadata) { protected void checkUserMetadataInNodeEquals(NodeMetadata node, ImmutableMap<String, String> userMetadata) {
assert node.getUserMetadata().equals(ImmutableMap.<String, String> of()) : String.format( assert node.getUserMetadata().equals(ImmutableMap.<String, String> of()) : String.format(
"node userMetadata did not match %s %s", userMetadata, node); "node userMetadata did not match %s %s", userMetadata, node);
} }
// cloudsigma does not support tags
@Override
protected void checkTagsInNodeEquals(final NodeMetadata node, final ImmutableSet<String> tags) {
assert node.getTags().equals(ImmutableSet.<String> of()) : String.format("node tags did not match %s %s", tags,
node);
}
protected void checkResponseEqualsHostname(ExecResponse execResponse, NodeMetadata node1) { protected void checkResponseEqualsHostname(ExecResponse execResponse, NodeMetadata node1) {
// hostname is not predictable based on node metadata // hostname is not predictable based on node metadata
assert execResponse.getOutput().trim().equals("ubuntu"); assert execResponse.getOutput().trim().equals("ubuntu");
} }
@Override @Override
public void testOptionToNotBlock() { public void testOptionToNotBlock() {
// start call has to block until we have a pool of reserved pre-cloned drives. // start call has to block until we have a pool of reserved pre-cloned drives.

View File

@ -51,23 +51,22 @@ public class CloudSigmaLasVegasTemplateBuilderLiveTest extends BaseTemplateBuild
@Override @Override
public boolean apply(OsFamilyVersion64Bit input) { public boolean apply(OsFamilyVersion64Bit input) {
switch (input.family) { switch (input.family) {
case UBUNTU: case UBUNTU:
return (input.version.equals("11.04") && input.is64Bit) return (ImmutableSet.of("11.04", "10.10").contains(input.version) && input.is64Bit)
|| (input.version.equals("11.10") && !input.is64Bit) || input.version.equals("") || (input.version.equals("11.10") && !input.is64Bit) || input.version.equals("")
|| input.version.equals("10.04"); || input.version.equals("10.04") || input.version.equals("12.04");
case SOLARIS: case SOLARIS:
return input.version.equals("") && input.is64Bit; return (input.version.equals("") || input.version.equals("10")) && input.is64Bit;
case DEBIAN: case DEBIAN:
return false; return input.version.equals("") || (input.version.equals("5.0") && !input.is64Bit)
case CENTOS: || (input.version.equals("6.0") && input.is64Bit);
return (input.version.equals("") || input.version.equals("5.7") || input.version.equals("6.0")) case CENTOS:
&& input.is64Bit; return (input.version.equals("") || input.version.equals("5.5") || input.version.equals("5.7") || input.version
case WINDOWS: .equals("6.0")) && input.is64Bit;
return (input.version.equals("2008 R2") || (input.version.equals("2003") || input.version.equals("")) case WINDOWS:
&& input.is64Bit) return input.version.equals("2008") || input.version.equals("2003") || input.version.equals("");
|| (input.version.equals("") && !input.is64Bit); default:
default: return false;
return false;
} }
} }