Skip to content

Commit

Permalink
Handle multiple loopback addresses (elastic#45901)
Browse files Browse the repository at this point in the history
AbstractSimpleTransportTestCase.testTransportProfilesWithPortAndHost
expects a host to only have a single IPv4 loopback address, which isn't
necessarily the case. Allow for >= 1 address.
  • Loading branch information
pugnascotia committed Aug 28, 2019
1 parent 9e14ffa commit 09df441
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2533,7 +2533,7 @@ public void testTransportProfilesWithPortAndHost() {
assertTrue(profileBoundAddresses.get("some_profile").publishAddress().getPort() < 9000);
assertTrue(profileBoundAddresses.get("some_other_profile").publishAddress().getPort() >= 8700);
assertTrue(profileBoundAddresses.get("some_other_profile").publishAddress().getPort() < 8800);
assertEquals(profileBoundAddresses.get("some_profile").boundAddresses().length, 1);
assertTrue(profileBoundAddresses.get("some_profile").boundAddresses().length >= 1);
if (doIPV6) {
assertTrue(profileBoundAddresses.get("some_other_profile").boundAddresses().length >= 2);
int ipv4 = 0;
Expand All @@ -2550,7 +2550,7 @@ public void testTransportProfilesWithPortAndHost() {
assertTrue("num ipv4 is wrong: " + ipv4, ipv4 >= 1);
assertTrue("num ipv6 is wrong: " + ipv6, ipv6 >= 1);
} else {
assertEquals(profileBoundAddresses.get("some_other_profile").boundAddresses().length, 1);
assertTrue(profileBoundAddresses.get("some_other_profile").boundAddresses().length >= 1);
}
assertTrue(profileBoundAddresses.get("some_other_profile").publishAddress().address().getAddress() instanceof Inet4Address);
}
Expand Down

0 comments on commit 09df441

Please sign in to comment.