summaryrefslogtreecommitdiffstats
path: root/test/test_udp.py
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-01-08 04:41:42 -0800
committerDave Wallace <dwallacelf@gmail.com>2018-01-09 17:01:21 +0000
commit2b97ac55edc5ba9fadf987d1c787102786ea8c4d (patch)
tree26d52dbbe7d6c748cac8e08aa2a801a3d16562d3 /test/test_udp.py
parent12bf52bae2a608a34a73222dedbb5e4a441055c7 (diff)
test: consolidate the multiple versions of send_and_*
Change-Id: I7fa7d0ebf73dab8264a2e5ddbd412600d78ead05 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 52fae862646e25bac6d1cd11b9fc7ac77299bc25)
Diffstat (limited to 'test/test_udp.py')
-rw-r--r--test/test_udp.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/test/test_udp.py b/test/test_udp.py
index 7853ac3b3f4..68b023c5e2f 100644
--- a/test/test_udp.py
+++ b/test/test_udp.py
@@ -79,14 +79,6 @@ class TestUdpEncap(VppTestCase):
self.assertEqual(rx.dst, tx[IPv6].dst)
self.assertEqual(rx.hlim, tx[IPv6].hlim)
- def send_and_expect(self, input, output, pkts):
- self.vapi.cli("clear trace")
- input.add_stream(pkts)
- self.pg_enable_capture(self.pg_interfaces)
- self.pg_start()
- rx = output.get_capture(len(pkts))
- return rx
-
def test_udp_encap(self):
""" UDP Encap test
"""
@@ -159,7 +151,7 @@ class TestUdpEncap(VppTestCase):
IP(src="2.2.2.2", dst="1.1.0.1") /
UDP(sport=1234, dport=1234) /
Raw('\xa5' * 100))
- rx = self.send_and_expect(self.pg0, self.pg0, p_4o4*65)
+ rx = self.send_and_expect(self.pg0, p_4o4*65, self.pg0)
for p in rx:
self.validate_outer4(p, udp_encap_0)
p = IP(p["UDP"].payload.load)
@@ -173,7 +165,7 @@ class TestUdpEncap(VppTestCase):
IP(src="2.2.2.2", dst="1.1.2.1") /
UDP(sport=1234, dport=1234) /
Raw('\xa5' * 100))
- rx = self.send_and_expect(self.pg0, self.pg2, p_4o6*65)
+ rx = self.send_and_expect(self.pg0, p_4o6*65, self.pg2)
for p in rx:
self.validate_outer6(p, udp_encap_2)
p = IP(p["UDP"].payload.load)
@@ -187,7 +179,7 @@ class TestUdpEncap(VppTestCase):
IPv6(src="2001::100", dst="2001::1") /
UDP(sport=1234, dport=1234) /
Raw('\xa5' * 100))
- rx = self.send_and_expect(self.pg0, self.pg1, p_6o4*65)
+ rx = self.send_and_expect(self.pg0, p_6o4*65, self.pg1)
for p in rx:
self.validate_outer4(p, udp_encap_1)
p = IPv6(p["UDP"].payload.load)
@@ -201,7 +193,7 @@ class TestUdpEncap(VppTestCase):
IPv6(src="2001::100", dst="2001::3") /
UDP(sport=1234, dport=1234) /
Raw('\xa5' * 100))
- rx = self.send_and_expect(self.pg0, self.pg3, p_6o6*65)
+ rx = self.send_and_expect(self.pg0, p_6o6*65, self.pg3)
for p in rx:
self.validate_outer6(p, udp_encap_3)
p = IPv6(p["UDP"].payload.load)
@@ -224,7 +216,7 @@ class TestUdpEncap(VppTestCase):
IP(src="2.2.2.2", dst="1.1.2.22") /
UDP(sport=1234, dport=1234) /
Raw('\xa5' * 100))
- rx = self.send_and_expect(self.pg0, self.pg1, p_4omo4*65)
+ rx = self.send_and_expect(self.pg0, p_4omo4*65, self.pg1)
for p in rx:
self.validate_outer4(p, udp_encap_1)
p = MPLS(p["UDP"].payload.load)