=doc #16262 do not bind udp test to docker interfaces
This commit is contained in:
parent
9e8d77133a
commit
c85b4d4a80
2 changed files with 11 additions and 4 deletions
|
|
@ -35,7 +35,9 @@ public class JavaUdpMulticastTest {
|
||||||
for (Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); interfaces.hasMoreElements() && ipv6Iface == null;) {
|
for (Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); interfaces.hasMoreElements() && ipv6Iface == null;) {
|
||||||
NetworkInterface interf = interfaces.nextElement();
|
NetworkInterface interf = interfaces.nextElement();
|
||||||
// awdl0 is a special interface on OSX that we cannot use
|
// awdl0 is a special interface on OSX that we cannot use
|
||||||
if (!interf.getDisplayName().equals("awdl0")) {
|
if (!interf.getDisplayName().equals("awdl0") &&
|
||||||
|
// we do not want to use virtual docker interfaces
|
||||||
|
!interf.getDisplayName().contains("docker")) {
|
||||||
for (Enumeration<InetAddress> addresses = interf.getInetAddresses(); addresses.hasMoreElements() && ipv6Iface == null; ) {
|
for (Enumeration<InetAddress> addresses = interf.getInetAddresses(); addresses.hasMoreElements() && ipv6Iface == null; ) {
|
||||||
InetAddress address = addresses.nextElement();
|
InetAddress address = addresses.nextElement();
|
||||||
if (address instanceof Inet6Address) {
|
if (address instanceof Inet6Address) {
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,15 @@ class ScalaUdpMulticastSpec extends TestKit(ActorSystem("ScalaUdpMulticastSpec")
|
||||||
|
|
||||||
"listener" should {
|
"listener" should {
|
||||||
"send message back to sink" in {
|
"send message back to sink" in {
|
||||||
val Some(ipv6Iface) = NetworkInterface.getNetworkInterfaces.collectFirst {
|
|
||||||
// awdl0 is a special interface on OSX that we cannot use
|
def okInterfaceToUse(iface: NetworkInterface): Boolean = {
|
||||||
case iface if iface.getInetAddresses.exists(_.isInstanceOf[Inet6Address]) && iface.getDisplayName != "awdl0" => iface
|
iface.getInetAddresses.exists(_.isInstanceOf[Inet6Address]) &&
|
||||||
|
// awdl0 is a special interface on OSX that we cannot use
|
||||||
|
iface.getDisplayName != "awdl0" &&
|
||||||
|
// we do not want to use virtual docker interfaces
|
||||||
|
!iface.getDisplayName.contains("docker")
|
||||||
}
|
}
|
||||||
|
val Some(ipv6Iface) = NetworkInterface.getNetworkInterfaces.find(okInterfaceToUse)
|
||||||
|
|
||||||
// host assigned link local multicast address http://tools.ietf.org/html/rfc3307#section-4.3.2
|
// host assigned link local multicast address http://tools.ietf.org/html/rfc3307#section-4.3.2
|
||||||
// generate a random 32 bit multicast address with the high order bit set
|
// generate a random 32 bit multicast address with the high order bit set
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue