mirror of https://github.com/apache/jclouds.git
Issue 487: terremark hostnames are predictable
This commit is contained in:
parent
6b9c68039b
commit
f42b550015
|
@ -248,15 +248,6 @@ public abstract class BaseComputeServiceLiveTest {
|
|||
assert good.identity != null : nodes;
|
||||
assert good.credential != null : nodes;
|
||||
|
||||
OperatingSystem os = node.getOperatingSystem();
|
||||
try {
|
||||
Map<? extends NodeMetadata, ExecResponse> responses = runScriptWithCreds(group, os, new Credentials(
|
||||
good.identity, "romeo"));
|
||||
assert false : "shouldn't pass with a bad password\n" + responses;
|
||||
} catch (RunScriptOnNodesException e) {
|
||||
assert getRootCause(e).getMessage().contains("Auth fail") : e;
|
||||
}
|
||||
|
||||
for (Entry<? extends NodeMetadata, ExecResponse> response : client.runScriptOnNodesMatching(
|
||||
runningInGroup(group), Statements.exec("hostname"),
|
||||
overrideCredentialsWith(good).wrapInInitScript(false).runAsRoot(false)).entrySet()){
|
||||
|
@ -267,6 +258,16 @@ public abstract class BaseComputeServiceLiveTest {
|
|||
ExecResponse response = client.runScriptOnNode(node.getId(), "hostname", wrapInInitScript(false)
|
||||
.runAsRoot(false));
|
||||
checkResponseEqualsHostname(response, node);
|
||||
OperatingSystem os = node.getOperatingSystem();
|
||||
|
||||
// test bad password
|
||||
try {
|
||||
Map<? extends NodeMetadata, ExecResponse> responses = runScriptWithCreds(group, os, new Credentials(
|
||||
good.identity, "romeo"));
|
||||
assert responses.size() == 0 : "shouldn't pass with a bad password\n" + responses;
|
||||
} catch (RunScriptOnNodesException e) {
|
||||
assert getRootCause(e).getMessage().contains("Auth fail") : e;
|
||||
}
|
||||
|
||||
runScriptWithCreds(group, os, good);
|
||||
|
||||
|
|
Loading…
Reference in New Issue