Fixed the compute service live tests for RimuHosting. An invalid name was being used for the server.

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2728 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
ivan@ivan.net.nz 2010-01-25 02:27:08 +00:00
parent 9d305c95a9
commit 99f201f0f8
6 changed files with 13 additions and 11 deletions

View File

@ -72,7 +72,7 @@ public abstract class BaseComputeServiceLiveTest {
protected String service; protected String service;
protected SshClient.Factory sshFactory; protected SshClient.Factory sshFactory;
protected RunNodeOptions options = RunNodeOptions.Builder.openPorts(22); protected RunNodeOptions options = RunNodeOptions.Builder.openPorts(22);
private String nodeName; protected String nodeName;
private RetryablePredicate<InetSocketAddress> socketTester; private RetryablePredicate<InetSocketAddress> socketTester;
private CreateNodeResponse node; private CreateNodeResponse node;
@ -85,7 +85,7 @@ public abstract class BaseComputeServiceLiveTest {
@BeforeGroups(groups = { "live" }) @BeforeGroups(groups = { "live" })
public void setupClient() throws InterruptedException, ExecutionException, TimeoutException, public void setupClient() throws InterruptedException, ExecutionException, TimeoutException,
IOException { IOException {
nodeName = checkNotNull(service, "service"); if (nodeName == null) nodeName = checkNotNull(service, "service");
user = checkNotNull(System.getProperty("jclouds.test.user"), "jclouds.test.user"); user = checkNotNull(System.getProperty("jclouds.test.user"), "jclouds.test.user");
password = checkNotNull(System.getProperty("jclouds.test.key"), "jclouds.test.key"); password = checkNotNull(System.getProperty("jclouds.test.key"), "jclouds.test.key");
context = new ComputeServiceContextFactory().createContext(service, user, password, context = new ComputeServiceContextFactory().createContext(service, user, password,
@ -135,7 +135,7 @@ public abstract class BaseComputeServiceLiveTest {
node = client.runNode(nodeName, template, options); node = client.runNode(nodeName, template, options);
assertNotNull(node.getId()); assertNotNull(node.getId());
assertNotNull(node.getName()); assertNotNull(node.getName());
assertEquals(node.getPublicAddresses().size(), 1); assert node.getPublicAddresses().size() >= 1: "no public ips in" + node;
assertNotNull(node.getCredentials()); assertNotNull(node.getCredentials());
if (node.getCredentials().account != null) { if (node.getCredentials().account != null) {
assertNotNull(node.getCredentials().account); assertNotNull(node.getCredentials().account);

View File

@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit;
* @see RimuHostingAsyncClient * @see RimuHostingAsyncClient
* @see <a href="TODO: insert URL of client documentation" /> * @see <a href="TODO: insert URL of client documentation" />
*/ */
@Timeout(duration = 10, timeUnit = TimeUnit.MINUTES) @Timeout(duration = 40, timeUnit = TimeUnit.MINUTES)
public interface RimuHostingClient { public interface RimuHostingClient {
SortedSet<Image> getImageList(); SortedSet<Image> getImageList();

View File

@ -93,12 +93,12 @@ public class RimuHostingComputeService implements ComputeService {
public CreateNodeResponse runNode(String name, Template template, RunNodeOptions options) { public CreateNodeResponse runNode(String name, Template template, RunNodeOptions options) {
NewServerResponse serverResponse = client.createServer(name, checkNotNull(template.getImage() NewServerResponse serverResponse = client.createServer(name, checkNotNull(template.getImage()
.getId(), "imageId"), checkNotNull(template.getSize().getId(), "sizeId")); .getId(), "imageId"), checkNotNull(template.getSize().getId(), "sizeId"));
return new CreateNodeResponseImpl(null,// dunno why there is no information here.... return new CreateNodeResponseImpl(serverResponse.getServer().getId().toString(),
name, location, null, ImmutableMap.<String, String> of(), NodeState.UNKNOWN,// TODO name, location, null, ImmutableMap.<String, String> of(), NodeState.UNKNOWN,// TODO
// need a // need a
// real // real
// state! // state!
ImmutableList.<InetAddress> of(),// no real useful data here.. getPublicAddresses(serverResponse.getServer()),// no real useful data here..
ImmutableList.<InetAddress> of(), new Credentials("root", serverResponse ImmutableList.<InetAddress> of(), new Credentials("root", serverResponse
.getNewInstanceRequest().getCreateOptions().getPassword()), ImmutableMap .getNewInstanceRequest().getCreateOptions().getPassword()), ImmutableMap
.<String, String> of()); .<String, String> of());

View File

@ -72,15 +72,16 @@ public class RimuHostingClientLiveTest {
@Test @Test
public void testLifeCycle() { public void testLifeCycle() {
//Get the first image, we dont really care what it is in this test. //Get the first image, we dont really care what it is in this test.
NewServerResponse serverResponse = connection.createServer("test.jclouds.org", "lenny", "MIRO1B"); NewServerResponse serverResponse = connection.createServer("test.ivan.api.com", "lenny", "MIRO1B");
Server server = serverResponse.getServer(); Server server = serverResponse.getServer();
//Now we have the server, lets restart it //Now we have the server, lets restart it
assertNotNull(server.getId()); assertNotNull(server.getId());
ServerInfo serverInfo = connection.restartServer(server.getId()); ServerInfo serverInfo = connection.restartServer(server.getId());
connection.destroyServer(server.getId());
//Should be running now. //Should be running now.
assertEquals(serverInfo.getState(), RunningState.RUNNING); assertEquals(serverInfo.getState(), RunningState.RUNNING);
assertEquals(server.getName(),"test.jclouds.org"); assertEquals(server.getName(),"test.ivan.api.com");
assertEquals(server.getImageId(), "lenny"); assertEquals(server.getImageId(), "lenny");
connection.destroyServer(server.getId());
} }
} }

View File

@ -58,7 +58,7 @@ public class RimuHostingComputeClientLiveTest {
public void testPowerOn() throws InterruptedException, ExecutionException, TimeoutException, public void testPowerOn() throws InterruptedException, ExecutionException, TimeoutException,
IOException { IOException {
String imageId = "lenny"; String imageId = "lenny";
String serverName = "test.jclouds.org"; String serverName = "test.compute.jclouds.org";
String planId = "MIRO1B"; String planId = "MIRO1B";
id = client.start(serverName, planId, imageId); id = client.start(serverName, planId, imageId);

View File

@ -36,10 +36,11 @@ public class RimuHostingComputeServiceLiveTest extends BaseComputeServiceLiveTes
@Override @Override
public void setServiceDefaults() { public void setServiceDefaults() {
service = "rimuhosting"; service = "rimuhosting";
nodeName = "rimuhosting.jclouds";
} }
protected Template buildTemplate(TemplateBuilder templateBuilder) { protected Template buildTemplate(TemplateBuilder templateBuilder) {
return templateBuilder.osFamily(UBUNTU).smallest().build(); return templateBuilder.osFamily(UBUNTU).sizeId("MIRO1B").build();
} }
@Override @Override