[Twisted-Python] RFC: IPv6 multicast join/ticket 6597

Jason Litzinger jlitzingerdev at gmail.com
Thu Aug 4 22:29:23 MDT 2016


> By default, the "multicast" flag is not enabled for the loopback interface
> on Linux. Does running "ip link set dev lo multicast on" help here?
> (Although requiring this would then be rather problematic for testing, as
> doing this in containerized environments and restricted environments like
> Travis is presumably impossible)
It didn't seem to.  Despite the subject, I'll focus on the existing,
IPv4 tests, rather than the new tests I'm writing (to eliminate any
issues in my code, though the change didn't help there either).

When I run with at least one interface up, my results for `./bin/trial
twisted` at SHA baba4c661a6606a56d8dab053cfe7b336a3c593e are:
PASSED (skips=2140, successes=9472)

When I take disconnect my wireless, and manually take down my lxr
interface, `ip link` shows:
1: lo: <LOOPBACK,MULTICAST,UP,LOWER_UP> mtu 65536 qdisc noqueue state
UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc
pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether <removed> brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state
DOWN mode DORMANT group default qlen 1000
    link/ether <removed> brd ff:ff:ff:ff:ff:ff
4: lxcbr0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN
mode DEFAULT group default qlen 1000
    link/ether <removed> brd ff:ff:ff:ff:ff:ff

And the results of `./bin/trial` are:
FAILED (skips=2212, failures=3, errors=8, successes=9393)

Specific to multicast, one of the errors is:
Traceback (most recent call last):
Failure: twisted.internet.error.MulticastJoinError:
('\xe1\x00\x00\xfa', '\x00\x00\x00\x00', 19, 'No such device')

twisted.test.test_udp.MulticastTests.test_multicast

However, I can eliminate the error for test_multicast with the
following patch, and this works even when multicast is not explicitly
enabled on the loopback.

diff --git a/twisted/test/test_udp.py b/twisted/test/test_udp.py
index 6cf4583..79fd9d0 100644
--- a/twisted/test/test_udp.py
+++ b/twisted/test/test_udp.py
@@ -623,10 +623,10 @@ class MulticastTests(unittest.TestCase):
         received from it.
         """
         c = Server()
-        p = reactor.listenMulticast(0, c)
+        p = reactor.listenMulticast(0, c, interface="127.0.0.1")
         addr = self.server.transport.getHost()

-        joined = self.server.transport.joinGroup("225.0.0.250")
+        joined = self.server.transport.joinGroup("225.0.0.250",
interface="127.0.0.1")

         def cbJoined(ignored):
             d = self.server.packetReceived = Deferred()


Unfortunately, a similar change on my IPv6 code didn't yield the
results I was hoping for, but, I assume that's my problem.

Is there interest in a separate patch for these tests?  I assume a new ticket?

Thanks,
-Jason Litzinger




More information about the Twisted-Python mailing list