summaryrefslogtreecommitdiffstats
path: root/test/test_ipsec_tun_if_esp.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-11-07 13:52:21 +0100
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2019-11-08 13:25:56 +0000
commit770a0deaadfb2d26cbc5da05f84578a7bd92e9d2 (patch)
treedf34de2e51331ab7ae868ecc7f253469f8448981 /test/test_ipsec_tun_if_esp.py
parent76a36e83e39cbf7828a647d8afadfaef642e1c84 (diff)
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 <ot@cisco.com> Change-Id: I3cba5c1486e436a3ca8aa10a7b393da75aa9f6b9
Diffstat (limited to 'test/test_ipsec_tun_if_esp.py')
-rw-r--r--test/test_ipsec_tun_if_esp.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/test_ipsec_tun_if_esp.py b/test/test_ipsec_tun_if_esp.py
index 971ec79fd67..b61e0ef5a62 100644
--- a/test/test_ipsec_tun_if_esp.py
+++ b/test/test_ipsec_tun_if_esp.py
@@ -534,7 +534,7 @@ class TestIpsecGreTebIfEsp(TemplateIpsec,
Ether(dst=self.omac) /
IP(src="1.1.1.1", dst="1.1.1.2") /
UDP(sport=1144, dport=2233) /
- Raw('X' * payload_size))
+ Raw(b'X' * payload_size))
for i in range(count)]
def gen_pkts(self, sw_intf, src, dst, count=1,
@@ -542,7 +542,7 @@ class TestIpsecGreTebIfEsp(TemplateIpsec,
return [Ether(dst=self.omac) /
IP(src="1.1.1.1", dst="1.1.1.2") /
UDP(sport=1144, dport=2233) /
- Raw('X' * payload_size)
+ Raw(b'X' * payload_size)
for i in range(count)]
def verify_decrypted(self, p, rxs):
@@ -640,7 +640,7 @@ class TestIpsecGreIfEsp(TemplateIpsec,
IP(src=self.pg1.local_ip4,
dst=self.pg1.remote_ip4) /
UDP(sport=1144, dport=2233) /
- Raw('X' * payload_size))
+ Raw(b'X' * payload_size))
for i in range(count)]
def gen_pkts(self, sw_intf, src, dst, count=1,
@@ -648,7 +648,7 @@ class TestIpsecGreIfEsp(TemplateIpsec,
return [Ether(src=sw_intf.remote_mac, dst=sw_intf.local_mac) /
IP(src="1.1.1.1", dst="1.1.1.2") /
UDP(sport=1144, dport=2233) /
- Raw('X' * payload_size)
+ Raw(b'X' * payload_size)
for i in range(count)]
def verify_decrypted(self, p, rxs):
@@ -935,7 +935,7 @@ class TestIpsec4TunProtectTun(TemplateIpsec,
dst=sw_intf.local_ip4) /
IP(src=src, dst=dst) /
UDP(sport=1144, dport=2233) /
- Raw('X' * payload_size))
+ Raw(b'X' * payload_size))
for i in range(count)]
def gen_pkts(self, sw_intf, src, dst, count=1,
@@ -943,7 +943,7 @@ class TestIpsec4TunProtectTun(TemplateIpsec,
return [Ether(src=sw_intf.remote_mac, dst=sw_intf.local_mac) /
IP(src=src, dst=dst) /
UDP(sport=1144, dport=2233) /
- Raw('X' * payload_size)
+ Raw(b'X' * payload_size)
for i in range(count)]
def verify_decrypted(self, p, rxs):
@@ -1230,7 +1230,7 @@ class TestIpsec6TunProtectTun(TemplateIpsec,
dst=sw_intf.local_ip6) /
IPv6(src=src, dst=dst) /
UDP(sport=1166, dport=2233) /
- Raw('X' * payload_size))
+ Raw(b'X' * payload_size))
for i in range(count)]
def gen_pkts6(self, sw_intf, src, dst, count=1,
@@ -1238,7 +1238,7 @@ class TestIpsec6TunProtectTun(TemplateIpsec,
return [Ether(src=sw_intf.remote_mac, dst=sw_intf.local_mac) /
IPv6(src=src, dst=dst) /
UDP(sport=1166, dport=2233) /
- Raw('X' * payload_size)
+ Raw(b'X' * payload_size)
for i in range(count)]
def verify_decrypted6(self, p, rxs):