From 770a0deaadfb2d26cbc5da05f84578a7bd92e9d2 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Thu, 7 Nov 2019 13:52:21 +0100 Subject: tests: python3 use byte strings in raw() Raw('\xaf) and Raw(b'\xaf) are two quite different things in python 2 versus 3. In most cases this didn't make a difference, apart from those cases where length of payload actually mattered. Type: fix Signed-off-by: Ole Troan Change-Id: I3cba5c1486e436a3ca8aa10a7b393da75aa9f6b9 --- test/test_udp.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/test_udp.py') diff --git a/test/test_udp.py b/test/test_udp.py index 40c814774bf..b22ed44e791 100644 --- a/test/test_udp.py +++ b/test/test_udp.py @@ -169,7 +169,7 @@ class TestUdpEncap(VppTestCase): dst=self.pg0.local_mac) / IP(src="2.2.2.2", dst="1.1.0.1") / UDP(sport=1234, dport=1234) / - Raw('\xa5' * 100)) + Raw(b'\xa5' * 100)) rx = self.send_and_expect(self.pg0, p_4o4*NUM_PKTS, self.pg0) for p in rx: self.validate_outer4(p, udp_encap_0) @@ -184,7 +184,7 @@ class TestUdpEncap(VppTestCase): dst=self.pg0.local_mac) / IP(src="2.2.2.2", dst="1.1.2.1") / UDP(sport=1234, dport=1234) / - Raw('\xa5' * 100)) + Raw(b'\xa5' * 100)) rx = self.send_and_expect(self.pg0, p_4o6*NUM_PKTS, self.pg2) for p in rx: self.validate_outer6(p, udp_encap_2) @@ -199,7 +199,7 @@ class TestUdpEncap(VppTestCase): dst=self.pg0.local_mac) / IPv6(src="2001::100", dst="2001::1") / UDP(sport=1234, dport=1234) / - Raw('\xa5' * 100)) + Raw(b'\xa5' * 100)) rx = self.send_and_expect(self.pg0, p_6o4*NUM_PKTS, self.pg1) for p in rx: self.validate_outer4(p, udp_encap_1) @@ -214,7 +214,7 @@ class TestUdpEncap(VppTestCase): dst=self.pg0.local_mac) / IPv6(src="2001::100", dst="2001::3") / UDP(sport=1234, dport=1234) / - Raw('\xa5' * 100)) + Raw(b'\xa5' * 100)) rx = self.send_and_expect(self.pg0, p_6o6*NUM_PKTS, self.pg3) for p in rx: self.validate_outer6(p, udp_encap_3) @@ -239,7 +239,7 @@ class TestUdpEncap(VppTestCase): dst=self.pg0.local_mac) / IP(src="2.2.2.2", dst="1.1.2.22") / UDP(sport=1234, dport=1234) / - Raw('\xa5' * 100)) + Raw(b'\xa5' * 100)) rx = self.send_and_expect(self.pg0, p_4omo4*NUM_PKTS, self.pg1) for p in rx: self.validate_outer4(p, udp_encap_1) -- cgit 1.2.3-korg