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_p2p_ethernet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/test_p2p_ethernet.py') diff --git a/test/test_p2p_ethernet.py b/test/test_p2p_ethernet.py index 7a8c56092fb..7cc6cdce485 100644 --- a/test/test_p2p_ethernet.py +++ b/test/test_p2p_ethernet.py @@ -172,7 +172,7 @@ class P2PEthernetIPV6(VppTestCase): pkt_size = random.choice(self.pg_if_packet_sizes) p = Ether(src=src_mac, dst=dst_mac) p /= IPv6(src=src_ip, dst=dst_ip) - p /= (UDP(sport=1234, dport=4321) / Raw('\xa5' * 20)) + p /= (UDP(sport=1234, dport=4321) / Raw(b'\xa5' * 20)) self.extend_packet(p, pkt_size) return p @@ -199,7 +199,7 @@ class P2PEthernetIPV6(VppTestCase): src=self.pg1.remote_mac) / IPv6(src="3001::1", dst="8000::100") / UDP(sport=1234, dport=1234) / - Raw('\xa5' * 100))] + Raw(b'\xa5' * 100))] self.send_packets(self.pg1, self.pg0) self.logger.info("FFP_TEST_FINISH_0001") @@ -375,7 +375,7 @@ class P2PEthernetIPV4(VppTestCase): pkt_size = random.choice(self.pg_if_packet_sizes) p = Ether(src=src_mac, dst=dst_mac) p /= IP(src=src_ip, dst=dst_ip) - p /= (UDP(sport=1234, dport=4321) / Raw('\xa5' * 20)) + p /= (UDP(sport=1234, dport=4321) / Raw(b'\xa5' * 20)) self.extend_packet(p, pkt_size) return p -- cgit 1.2.3-korg