X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_igmp.py;fp=test%2Ftest_igmp.py;h=68a3e4e41f3ab9b9d61adbf081a50400ce974bab;hb=01b0a05e4ffc9e84eeedf15919c1a320daec4e91;hp=017382d3b5b15479c1a75a37fd10645db4243af9;hpb=1671d3be382fc8690f24d3569733f3dcf96cf011;p=vpp.git diff --git a/test/test_igmp.py b/test/test_igmp.py index 017382d3b5b..68a3e4e41f3 100644 --- a/test/test_igmp.py +++ b/test/test_igmp.py @@ -2,7 +2,7 @@ import unittest -from scapy.layers.l2 import Ether +from scapy.layers.l2 import Ether, Raw from scapy.layers.inet import IP, IPOption from scapy.contrib.igmpv3 import IGMPv3, IGMPv3gr, IGMPv3mq, IGMPv3mr @@ -194,12 +194,15 @@ class TestIgmp(VppTestCase): # # Send a general query (to the all router's address) - # expect VPP to respond with a membership report + # expect VPP to respond with a membership report. + # Pad the query with 0 - some devices in the big wild + # internet are prone to this. # p_g = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) / IP(src=self.pg0.remote_ip4, dst='224.0.0.1', tos=0xc0) / IGMPv3(type="Membership Query", mrcode=100) / - IGMPv3mq(gaddr="0.0.0.0")) + IGMPv3mq(gaddr="0.0.0.0") / + Raw('\x00' * 10)) self.send(self.pg0, p_g) @@ -240,6 +243,19 @@ class TestIgmp(VppTestCase): self.verify_report(capture[0], [IgmpRecord(h1.sg, "Mode Is Include")]) + # + # A group and source specific query that reports more sources + # than the packet actually has. + # + p_gs2 = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) / + IP(src=self.pg0.remote_ip4, dst='239.1.1.1', tos=0xc0, + options=[IPOption(copy_flag=1, optclass="control", + option="router_alert")]) / + IGMPv3(type="Membership Query", mrcode=100) / + IGMPv3mq(gaddr="239.1.1.1", numsrc=4, srcaddrs=["1.1.1.1"])) + + self.send_and_assert_no_replies(self.pg0, p_gs2, timeout=10) + # # A group and source specific query, with the source NOT matching # the source VPP has. There should be no response.