mirror of https://github.com/apache/jclouds.git
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:
parent
9d305c95a9
commit
99f201f0f8
|
@ -72,7 +72,7 @@ public abstract class BaseComputeServiceLiveTest {
|
|||
protected String service;
|
||||
protected SshClient.Factory sshFactory;
|
||||
protected RunNodeOptions options = RunNodeOptions.Builder.openPorts(22);
|
||||
private String nodeName;
|
||||
protected String nodeName;
|
||||
|
||||
private RetryablePredicate<InetSocketAddress> socketTester;
|
||||
private CreateNodeResponse node;
|
||||
|
@ -85,7 +85,7 @@ public abstract class BaseComputeServiceLiveTest {
|
|||
@BeforeGroups(groups = { "live" })
|
||||
public void setupClient() throws InterruptedException, ExecutionException, TimeoutException,
|
||||
IOException {
|
||||
nodeName = checkNotNull(service, "service");
|
||||
if (nodeName == null) nodeName = checkNotNull(service, "service");
|
||||
user = checkNotNull(System.getProperty("jclouds.test.user"), "jclouds.test.user");
|
||||
password = checkNotNull(System.getProperty("jclouds.test.key"), "jclouds.test.key");
|
||||
context = new ComputeServiceContextFactory().createContext(service, user, password,
|
||||
|
@ -135,7 +135,7 @@ public abstract class BaseComputeServiceLiveTest {
|
|||
node = client.runNode(nodeName, template, options);
|
||||
assertNotNull(node.getId());
|
||||
assertNotNull(node.getName());
|
||||
assertEquals(node.getPublicAddresses().size(), 1);
|
||||
assert node.getPublicAddresses().size() >= 1: "no public ips in" + node;
|
||||
assertNotNull(node.getCredentials());
|
||||
if (node.getCredentials().account != null) {
|
||||
assertNotNull(node.getCredentials().account);
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit;
|
|||
* @see RimuHostingAsyncClient
|
||||
* @see <a href="TODO: insert URL of client documentation" />
|
||||
*/
|
||||
@Timeout(duration = 10, timeUnit = TimeUnit.MINUTES)
|
||||
@Timeout(duration = 40, timeUnit = TimeUnit.MINUTES)
|
||||
public interface RimuHostingClient {
|
||||
|
||||
SortedSet<Image> getImageList();
|
||||
|
|
|
@ -93,12 +93,12 @@ public class RimuHostingComputeService implements ComputeService {
|
|||
public CreateNodeResponse runNode(String name, Template template, RunNodeOptions options) {
|
||||
NewServerResponse serverResponse = client.createServer(name, checkNotNull(template.getImage()
|
||||
.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
|
||||
// need a
|
||||
// real
|
||||
// state!
|
||||
ImmutableList.<InetAddress> of(),// no real useful data here..
|
||||
getPublicAddresses(serverResponse.getServer()),// no real useful data here..
|
||||
ImmutableList.<InetAddress> of(), new Credentials("root", serverResponse
|
||||
.getNewInstanceRequest().getCreateOptions().getPassword()), ImmutableMap
|
||||
.<String, String> of());
|
||||
|
|
|
@ -72,15 +72,16 @@ public class RimuHostingClientLiveTest {
|
|||
@Test
|
||||
public void testLifeCycle() {
|
||||
//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();
|
||||
//Now we have the server, lets restart it
|
||||
assertNotNull(server.getId());
|
||||
ServerInfo serverInfo = connection.restartServer(server.getId());
|
||||
connection.destroyServer(server.getId());
|
||||
|
||||
//Should be running now.
|
||||
assertEquals(serverInfo.getState(), RunningState.RUNNING);
|
||||
assertEquals(server.getName(),"test.jclouds.org");
|
||||
assertEquals(server.getName(),"test.ivan.api.com");
|
||||
assertEquals(server.getImageId(), "lenny");
|
||||
connection.destroyServer(server.getId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class RimuHostingComputeClientLiveTest {
|
|||
public void testPowerOn() throws InterruptedException, ExecutionException, TimeoutException,
|
||||
IOException {
|
||||
String imageId = "lenny";
|
||||
String serverName = "test.jclouds.org";
|
||||
String serverName = "test.compute.jclouds.org";
|
||||
String planId = "MIRO1B";
|
||||
|
||||
id = client.start(serverName, planId, imageId);
|
||||
|
|
|
@ -36,10 +36,11 @@ public class RimuHostingComputeServiceLiveTest extends BaseComputeServiceLiveTes
|
|||
@Override
|
||||
public void setServiceDefaults() {
|
||||
service = "rimuhosting";
|
||||
nodeName = "rimuhosting.jclouds";
|
||||
}
|
||||
|
||||
protected Template buildTemplate(TemplateBuilder templateBuilder) {
|
||||
return templateBuilder.osFamily(UBUNTU).smallest().build();
|
||||
return templateBuilder.osFamily(UBUNTU).sizeId("MIRO1B").build();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue