From 71dd766227332c5f191788ee8d5d6dedd3771c19 Mon Sep 17 00:00:00 2001 From: Josef Cacek Date: Mon, 22 Aug 2016 13:44:19 +0200 Subject: [PATCH] Docker live test fix - SshToCustomPortLiveTest didn't work for remote docker endpoints due to wrong port number used --- .../jclouds/docker/compute/SshToCustomPortLiveTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apis/docker/src/test/java/org/jclouds/docker/compute/SshToCustomPortLiveTest.java b/apis/docker/src/test/java/org/jclouds/docker/compute/SshToCustomPortLiveTest.java index 23f3838f2a..2e815a4488 100644 --- a/apis/docker/src/test/java/org/jclouds/docker/compute/SshToCustomPortLiveTest.java +++ b/apis/docker/src/test/java/org/jclouds/docker/compute/SshToCustomPortLiveTest.java @@ -121,7 +121,7 @@ public class SshToCustomPortLiveTest extends BaseComputeServiceContextLiveTest { String nodeId = null; try { NodeMetadata node = Iterables - .getOnlyElement(view.getComputeService().createNodesInGroup("ssh-test", 1, template)); + .getOnlyElement(view.getComputeService().createNodesInGroup("ssh-net-host", 1, template)); nodeId = node.getId(); ExecResponse response = view.getComputeService().runScriptOnNode(nodeId, "sh -c 'echo hello && sleep 0.2'", wrapInInitScript(false)); @@ -152,7 +152,7 @@ public class SshToCustomPortLiveTest extends BaseComputeServiceContextLiveTest { String nodeId = null; try { NodeMetadata node = Iterables - .getOnlyElement(view.getComputeService().createNodesInGroup("ssh-test-advanced", 1, template)); + .getOnlyElement(view.getComputeService().createNodesInGroup("ssh-net-bridge", 1, template)); nodeId = node.getId(); ExecResponse response = view.getComputeService().runScriptOnNode(nodeId, "sh -c 'true'", @@ -214,8 +214,8 @@ public class SshToCustomPortLiveTest extends BaseComputeServiceContextLiveTest { protected void configure() { bind(LoginPortForContainer.class).toInstance(new LoginPortForContainer() { @Override - public Optional apply(Container input) { - return Optional.of(SSH_PORT); + public Optional apply(Container container) { + return Optional.of(container.name().contains("ssh-net-bridge") ? SSH_PORT_BRIDGE : SSH_PORT); } }); }