aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/svs/test
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 /src/plugins/svs/test
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 'src/plugins/svs/test')
-rw-r--r--src/plugins/svs/test/test_svs.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/plugins/svs/test/test_svs.py b/src/plugins/svs/test/test_svs.py
index 6d3b72e744d..ec986370895 100644
--- a/src/plugins/svs/test/test_svs.py
+++ b/src/plugins/svs/test/test_svs.py
@@ -70,27 +70,27 @@ class TestSVS(VppTestCase):
pkts_0 = [(Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
IP(src="1.1.1.1", dst=self.pg1.remote_ip4) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100)),
+ Raw(b'\xa5' * 100)),
(Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
IP(src="2.2.2.2", dst=self.pg2.remote_ip4) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100)),
+ Raw(b'\xa5' * 100)),
(Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
IP(src="3.3.3.3", dst=self.pg3.remote_ip4) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100))]
+ Raw(b'\xa5' * 100))]
pkts_1 = [(Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) /
IP(src="1.1.1.1", dst=self.pg1.remote_ip4) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100)),
+ Raw(b'\xa5' * 100)),
(Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) /
IP(src="2.2.2.2", dst=self.pg2.remote_ip4) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100)),
+ Raw(b'\xa5' * 100)),
(Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) /
IP(src="3.3.3.3", dst=self.pg3.remote_ip4) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100))]
+ Raw(b'\xa5' * 100))]
#
# before adding the SVS config all these packets are dropped when
@@ -143,13 +143,13 @@ class TestSVS(VppTestCase):
p = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
IP(src=self.pg0.remote_ip4, dst=self.pg0.remote_ip4) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100))
+ Raw(b'\xa5' * 100))
self.send_and_expect(self.pg0, p * NUM_PKTS, self.pg0)
p = (Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) /
IP(src=self.pg1.remote_ip4, dst=self.pg1.remote_ip4) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100))
+ Raw(b'\xa5' * 100))
self.send_and_expect(self.pg1, p * NUM_PKTS, self.pg1)
#
@@ -197,27 +197,27 @@ class TestSVS(VppTestCase):
pkts_0 = [(Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
IPv6(src="2001:1::1", dst=self.pg1.remote_ip6) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100)),
+ Raw(b'\xa5' * 100)),
(Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
IPv6(src="2001:2::1", dst=self.pg2.remote_ip6) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100)),
+ Raw(b'\xa5' * 100)),
(Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
IPv6(src="2001:3::1", dst=self.pg3.remote_ip6) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100))]
+ Raw(b'\xa5' * 100))]
pkts_1 = [(Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) /
IPv6(src="2001:1::1", dst=self.pg1.remote_ip6) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100)),
+ Raw(b'\xa5' * 100)),
(Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) /
IPv6(src="2001:2::1", dst=self.pg2.remote_ip6) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100)),
+ Raw(b'\xa5' * 100)),
(Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) /
IPv6(src="2001:3::1", dst=self.pg3.remote_ip6) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100))]
+ Raw(b'\xa5' * 100))]
#
# before adding the SVS config all these packets are dropped when
@@ -273,13 +273,13 @@ class TestSVS(VppTestCase):
p = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
IPv6(src=self.pg0.remote_ip6, dst=self.pg0.remote_ip6) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100))
+ Raw(b'\xa5' * 100))
self.send_and_expect(self.pg0, p * NUM_PKTS, self.pg0)
p = (Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) /
IPv6(src=self.pg1.remote_ip6, dst=self.pg1.remote_ip6) /
UDP(sport=1234, dport=1234) /
- Raw('\xa5' * 100))
+ Raw(b'\xa5' * 100))
self.send_and_expect(self.pg1, p * NUM_PKTS, self.pg1)
#