SshMachineLocationIntegrationTest: change unreachable ip

Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/33dd48c2
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/33dd48c2
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/33dd48c2

Branch: refs/heads/master
Commit: 33dd48c2d2ae743756e68b94ad5099f098cf1014
Parents: 171843e
Author: Aled Sage <aled.s...@gmail.com>
Authored: Thu Dec 1 15:52:34 2016 +0000
Committer: Aled Sage <aled.s...@gmail.com>
Committed: Thu Dec 1 15:52:34 2016 +0000

----------------------------------------------------------------------
 .../ssh/SshMachineLocationIntegrationTest.java        | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/33dd48c2/core/src/test/java/org/apache/brooklyn/location/ssh/SshMachineLocationIntegrationTest.java
----------------------------------------------------------------------
diff --git 
a/core/src/test/java/org/apache/brooklyn/location/ssh/SshMachineLocationIntegrationTest.java
 
b/core/src/test/java/org/apache/brooklyn/location/ssh/SshMachineLocationIntegrationTest.java
index 081d0a8..d0214fd 100644
--- 
a/core/src/test/java/org/apache/brooklyn/location/ssh/SshMachineLocationIntegrationTest.java
+++ 
b/core/src/test/java/org/apache/brooklyn/location/ssh/SshMachineLocationIntegrationTest.java
@@ -185,14 +185,18 @@ public class SshMachineLocationIntegrationTest extends 
SshMachineLocationTest {
         }
     }
 
-    // Note: on some (home/airport) networks, `ssh 123.123.123.123` hangs 
seemingly forever.
-    // Make sure we fail, waiting for longer than the 70 second TCP timeout.
+    // See http://superuser.com/a/698251/497648 for choice of unreachable IP.
+    // Even with 240.0.0.0, it takes a long time (75 seconds in office 
network).
+    //
+    // Previously, "123.123.123.123" would seemingly hang on some 
(home/airport) networks.
+    // Times out (with 123.123.123.123) in 2m7s on Ubuntu Vivid (syn retries 
set to 6)
     //
-    // Times out in 2m7s on Ubuntu Vivid (syn retries set to 6)
+    // Make sure we fail, waiting for longer than the 70 second TCP timeout.
     @Test(groups = "Integration")
     public void testIsSshableWhenFalse() throws Exception {
-        byte[] unreachableIp = new byte[] {123,123,123,123};
-        final SshMachineLocation unreachableHost = new 
SshMachineLocation(MutableMap.of("address", 
InetAddress.getByAddress("unreachablename", unreachableIp)));
+        String unreachableIp = "240.0.0.0";
+        final SshMachineLocation unreachableHost = new 
SshMachineLocation(MutableMap.of("address", 
InetAddress.getByName(unreachableIp)));
+        System.out.println(unreachableHost.getAddress());
         Asserts.assertReturnsEventually(new Runnable() {
             public void run() {
                 assertFalse(unreachableHost.isSshable());

Reply via email to