mirror of https://github.com/apache/jclouds.git
comments for failing live tests
fixes in change password test
This commit is contained in:
parent
006d5e0eed
commit
8375791335
|
@ -394,6 +394,7 @@ public class NovaComputeServiceLiveTest extends ComputeBase {
|
||||||
|
|
||||||
@Test(timeOut = 60000)
|
@Test(timeOut = 60000)
|
||||||
public void testListHardwareProfiles() throws Exception {
|
public void testListHardwareProfiles() throws Exception {
|
||||||
|
//TODO: failing, OpenStack returns a hardware with 0 CPU cores
|
||||||
for (Hardware hardware : computeService.listHardwareProfiles()) {
|
for (Hardware hardware : computeService.listHardwareProfiles()) {
|
||||||
assert hardware.getProviderId() != null;
|
assert hardware.getProviderId() != null;
|
||||||
assert getCores(hardware) > 0;
|
assert getCores(hardware) > 0;
|
||||||
|
|
|
@ -20,6 +20,7 @@ package org.jclouds.openstack.nova.live.compute;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
import com.sun.xml.internal.bind.v2.TODO;
|
||||||
import org.jclouds.compute.domain.NodeMetadata;
|
import org.jclouds.compute.domain.NodeMetadata;
|
||||||
import org.jclouds.compute.domain.NodeState;
|
import org.jclouds.compute.domain.NodeState;
|
||||||
import org.testng.annotations.AfterTest;
|
import org.testng.annotations.AfterTest;
|
||||||
|
@ -56,8 +57,9 @@ public class ServiceActionsLiveTest extends ComputeBase {
|
||||||
//testGetNodeMetadata();
|
//testGetNodeMetadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test //Suspend is not supported by the provider yet
|
@Test
|
||||||
public void testSuspendResume() throws Exception {
|
public void testSuspendResume() throws Exception {
|
||||||
|
//TODO: failing, suspend is not supported by the nova provider yet
|
||||||
getDefaultNodeImmediately(group);
|
getDefaultNodeImmediately(group);
|
||||||
computeService.suspendNodesMatching(inGroup(group));
|
computeService.suspendNodesMatching(inGroup(group));
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,8 @@ import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
import com.google.inject.Module;
|
import com.google.inject.Module;
|
||||||
|
import org.jclouds.domain.Credentials;
|
||||||
|
import org.jclouds.http.handlers.BackoffLimitedRetryHandler;
|
||||||
import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
|
import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
|
||||||
import org.jclouds.net.IPSocket;
|
import org.jclouds.net.IPSocket;
|
||||||
import org.jclouds.openstack.nova.NovaClient;
|
import org.jclouds.openstack.nova.NovaClient;
|
||||||
|
@ -32,12 +34,16 @@ import org.jclouds.predicates.RetryablePredicate;
|
||||||
import org.jclouds.predicates.SocketOpen;
|
import org.jclouds.predicates.SocketOpen;
|
||||||
import org.jclouds.rest.RestContextFactory;
|
import org.jclouds.rest.RestContextFactory;
|
||||||
import org.jclouds.ssh.SshClient;
|
import org.jclouds.ssh.SshClient;
|
||||||
|
import org.jclouds.ssh.SshException;
|
||||||
|
import org.jclouds.ssh.jsch.JschSshClient;
|
||||||
import org.jclouds.ssh.jsch.config.JschSshClientModule;
|
import org.jclouds.ssh.jsch.config.JschSshClientModule;
|
||||||
import org.testng.annotations.BeforeTest;
|
import org.testng.annotations.BeforeTest;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static org.jclouds.openstack.nova.live.PropertyHelper.*;
|
import static org.jclouds.openstack.nova.live.PropertyHelper.*;
|
||||||
|
@ -112,4 +118,19 @@ public class ClientBase {
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void awaitForSshPort(String address, Credentials credentials) throws URISyntaxException {
|
||||||
|
IPSocket socket = new IPSocket(address, 22);
|
||||||
|
|
||||||
|
JschSshClient ssh = new JschSshClient(
|
||||||
|
new BackoffLimitedRetryHandler(), socket, 10000, credentials.identity, null, credentials.credential.getBytes());
|
||||||
|
while (true) {
|
||||||
|
try {
|
||||||
|
System.out.println("ping: " + socket);
|
||||||
|
ssh.connect();
|
||||||
|
return;
|
||||||
|
} catch (SshException ignore) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
package org.jclouds.openstack.nova.live.novaclient;
|
package org.jclouds.openstack.nova.live.novaclient;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
import com.sun.xml.internal.bind.v2.TODO;
|
||||||
import org.jclouds.domain.Credentials;
|
import org.jclouds.domain.Credentials;
|
||||||
import org.jclouds.http.HttpResponseException;
|
import org.jclouds.http.HttpResponseException;
|
||||||
import org.jclouds.io.Payload;
|
import org.jclouds.io.Payload;
|
||||||
|
@ -57,6 +58,7 @@ public class NovaClientLiveTest extends ClientBase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testListServersDetail() throws Exception {
|
public void testListServersDetail() throws Exception {
|
||||||
|
//TODO: failing, /v1.1/servers/{server id}/ips URL is not available (issue in the OpenStack)
|
||||||
Set<Server> response = client.listServers(withDetails());
|
Set<Server> response = client.listServers(withDetails());
|
||||||
assert null != response;
|
assert null != response;
|
||||||
long initialContainerCount = response.size();
|
long initialContainerCount = response.size();
|
||||||
|
@ -65,6 +67,7 @@ public class NovaClientLiveTest extends ClientBase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testListImages() throws Exception {
|
public void testListImages() throws Exception {
|
||||||
|
//TODO: failing, image name should not be null (issue in the OpenStack)
|
||||||
Set<Image> response = client.listImages();
|
Set<Image> response = client.listImages();
|
||||||
assert null != response;
|
assert null != response;
|
||||||
long imageCount = response.size();
|
long imageCount = response.size();
|
||||||
|
@ -78,6 +81,7 @@ public class NovaClientLiveTest extends ClientBase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testListImagesDetail() throws Exception {
|
public void testListImagesDetail() throws Exception {
|
||||||
|
//TODO: failing, image name should not be null (issue in the OpenStack)
|
||||||
Set<Image> response = client.listImages(withDetails());
|
Set<Image> response = client.listImages(withDetails());
|
||||||
assert null != response;
|
assert null != response;
|
||||||
long imageCount = response.size();
|
long imageCount = response.size();
|
||||||
|
@ -276,6 +280,8 @@ public class NovaClientLiveTest extends ClientBase {
|
||||||
public void testChangePassword() throws Exception {
|
public void testChangePassword() throws Exception {
|
||||||
int serverId = getDefaultServerImmediately().getId();
|
int serverId = getDefaultServerImmediately().getId();
|
||||||
blockUntilServerActive(serverId);
|
blockUntilServerActive(serverId);
|
||||||
|
blockUntilPublicAddress(serverId);
|
||||||
|
awaitForSshPort(Iterables.get(client.getServer(serverId).getAddresses().getPublicAddresses(), 0).getAddress(), new Credentials("root", keyPair.get("private")));
|
||||||
client.changeAdminPass(serverId, "elmo");
|
client.changeAdminPass(serverId, "elmo");
|
||||||
assertPassword(client.getServer(serverId), "elmo");
|
assertPassword(client.getServer(serverId), "elmo");
|
||||||
|
|
||||||
|
@ -283,6 +289,7 @@ public class NovaClientLiveTest extends ClientBase {
|
||||||
|
|
||||||
@Test(enabled = true, timeOut = 10 * 600 * 1000)
|
@Test(enabled = true, timeOut = 10 * 600 * 1000)
|
||||||
public void testCreateImage() throws Exception {
|
public void testCreateImage() throws Exception {
|
||||||
|
//TODO: failing, create image from instance returns incorrect JSON
|
||||||
Server server = getDefaultServerImmediately();
|
Server server = getDefaultServerImmediately();
|
||||||
Image image = getDefaultImageImmediately(server);
|
Image image = getDefaultImageImmediately(server);
|
||||||
blockUntilImageActive(image.getId());
|
blockUntilImageActive(image.getId());
|
||||||
|
@ -293,6 +300,7 @@ public class NovaClientLiveTest extends ClientBase {
|
||||||
|
|
||||||
@Test(enabled = true, timeOut = 10 * 60 * 1000)
|
@Test(enabled = true, timeOut = 10 * 60 * 1000)
|
||||||
public void testRebuildServer() throws Exception {
|
public void testRebuildServer() throws Exception {
|
||||||
|
//TODO: failing, create image from instance returns incorrect JSON
|
||||||
Server server = getDefaultServerImmediately();
|
Server server = getDefaultServerImmediately();
|
||||||
Image image = getDefaultImageImmediately(server);
|
Image image = getDefaultImageImmediately(server);
|
||||||
client.rebuildServer(server.getId(), new RebuildServerOptions().withImage(String.valueOf(image.getId())));
|
client.rebuildServer(server.getId(), new RebuildServerOptions().withImage(String.valueOf(image.getId())));
|
||||||
|
@ -349,6 +357,7 @@ public class NovaClientLiveTest extends ClientBase {
|
||||||
|
|
||||||
@Test(enabled = true, timeOut = 60000)
|
@Test(enabled = true, timeOut = 60000)
|
||||||
void testDeleteImage() throws Exception {
|
void testDeleteImage() throws Exception {
|
||||||
|
//TODO: failing, create image from instance returns incorrect JSON
|
||||||
Image image = getDefaultImageImmediately(getDefaultServerImmediately());
|
Image image = getDefaultImageImmediately(getDefaultServerImmediately());
|
||||||
client.deleteImage(image.getId());
|
client.deleteImage(image.getId());
|
||||||
assert client.getImage(image.getId()) == null;
|
assert client.getImage(image.getId()) == null;
|
||||||
|
|
Loading…
Reference in New Issue