Skip to content

Commit

Permalink
Handle multiple loopback addresses (#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 23, 2019
1 parent f378232 commit 0ae0dfc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2528,7 +2528,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 @@ -2545,7 +2545,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 0ae0dfc

Please sign in to comment.