diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2014-03-04 11:03:45 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-03-04 09:39:33 +0000 |
commit | db7943857bbf56812d606a5a204067cd1df40889 (patch) | |
tree | 73b07f55c9acc0416864b972e0ae02504165d8a9 /uitest/src/com/vaadin | |
parent | 372b64b2827b70e15495f1a78e0b94e53a23783e (diff) | |
download | vaadin-framework-db7943857bbf56812d606a5a204067cd1df40889.tar.gz vaadin-framework-db7943857bbf56812d606a5a204067cd1df40889.zip |
Refactored TB3 test ip address whitelisting.
Change-Id: I7f9aae8ed3ea163b19d92caa652313dfc2c4a159
Diffstat (limited to 'uitest/src/com/vaadin')
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java index 543484fc14..400a2fe429 100644 --- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java +++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java @@ -120,20 +120,19 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { Enumeration<NetworkInterface> interfaces = NetworkInterface .getNetworkInterfaces(); while (interfaces.hasMoreElements()) { - NetworkInterface current = interfaces.nextElement(); - if (!current.isUp() || current.isLoopback() - || current.isVirtual()) { + NetworkInterface nwInterface = interfaces.nextElement(); + if (!nwInterface.isUp() || nwInterface.isLoopback() + || nwInterface.isVirtual()) { continue; } - Enumeration<InetAddress> addresses = current.getInetAddresses(); + Enumeration<InetAddress> addresses = nwInterface.getInetAddresses(); while (addresses.hasMoreElements()) { - InetAddress current_addr = addresses.nextElement(); - if (current_addr.isLoopbackAddress()) { + InetAddress address = addresses.nextElement(); + if (address.isLoopbackAddress()) { continue; } - String hostAddress = current_addr.getHostAddress(); - if (hostAddress.startsWith("192.168.")) { - return hostAddress; + if (address.isSiteLocalAddress()) { + return address.getHostAddress(); } } } @@ -142,7 +141,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { } throw new RuntimeException( - "No compatible (192.168.*) ip address found."); + "No compatible (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) ip address found."); } /* |