X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_reassembly.py;h=cb6b8ff5d3f8c036909074ee630864fb041f41e2;hb=18c6cd9aa88aef446d09bfec90d45a24ec6741ef;hp=e9a3af3a0ffed5110326c4e51e92e5b8b89c08f2;hpb=ead1e536d66d83b546528c32e2112085a97c8e13;p=vpp.git diff --git a/test/test_reassembly.py b/test/test_reassembly.py index e9a3af3a0ff..cb6b8ff5d3f 100644 --- a/test/test_reassembly.py +++ b/test/test_reassembly.py @@ -670,6 +670,72 @@ class TestIPv4SVReassembly(VppTestCase): self.assertEqual(sent[IP].dst, recvd[IP].dst) self.assertEqual(sent[Raw].payload, recvd[Raw].payload) + def send_mixed_and_verify_capture(self, traffic): + stream = [] + for t in traffic: + for c in range(t['count']): + stream.append( + (Ether(dst=self.src_if.local_mac, + src=self.src_if.remote_mac) / + IP(id=self.counter, + flags=t['flags'], + src=self.src_if.remote_ip4, + dst=self.dst_if.remote_ip4) / + UDP(sport=1234, dport=5678) / + Raw("abcdef"))) + self.counter = self.counter + 1 + + self.pg_enable_capture() + self.src_if.add_stream(stream) + self.pg_start() + self.logger.debug(self.vapi.ppcli("show ip4-sv-reassembly details")) + self.logger.debug(self.vapi.ppcli("show buffers")) + self.logger.debug(self.vapi.ppcli("show trace")) + self.dst_if.get_capture(len(stream)) + + def test_mixed(self): + """ mixed traffic correctly passes through SVR """ + self.counter = 1 + + self.send_mixed_and_verify_capture([{'count': 1, 'flags': ''}]) + self.send_mixed_and_verify_capture([{'count': 2, 'flags': ''}]) + self.send_mixed_and_verify_capture([{'count': 3, 'flags': ''}]) + self.send_mixed_and_verify_capture([{'count': 8, 'flags': ''}]) + self.send_mixed_and_verify_capture([{'count': 257, 'flags': ''}]) + + self.send_mixed_and_verify_capture([{'count': 1, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture([{'count': 2, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture([{'count': 3, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture([{'count': 8, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture([{'count': 257, 'flags': 'MF'}]) + + self.send_mixed_and_verify_capture( + [{'count': 1, 'flags': ''}, {'count': 1, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 2, 'flags': ''}, {'count': 2, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 3, 'flags': ''}, {'count': 3, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 8, 'flags': ''}, {'count': 8, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 129, 'flags': ''}, {'count': 129, 'flags': 'MF'}]) + + self.send_mixed_and_verify_capture( + [{'count': 1, 'flags': ''}, {'count': 1, 'flags': 'MF'}, + {'count': 1, 'flags': ''}, {'count': 1, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 2, 'flags': ''}, {'count': 2, 'flags': 'MF'}, + {'count': 2, 'flags': ''}, {'count': 2, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 3, 'flags': ''}, {'count': 3, 'flags': 'MF'}, + {'count': 3, 'flags': ''}, {'count': 3, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 8, 'flags': ''}, {'count': 8, 'flags': 'MF'}, + {'count': 8, 'flags': ''}, {'count': 8, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 65, 'flags': ''}, {'count': 65, 'flags': 'MF'}, + {'count': 65, 'flags': ''}, {'count': 65, 'flags': 'MF'}]) + class TestIPv4MWReassembly(VppTestCase): """ IPv4 Reassembly (multiple workers) """