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
This commit is contained in:
committed by
Paul Vinciguerra
parent
76a36e83e3
commit
770a0deaad
@@ -197,7 +197,7 @@ class TestAbf(VppTestCase):
|
||||
dst=self.pg0.local_mac) /
|
||||
IP(src="1.1.1.1", dst="1.1.1.2") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
self.send_and_expect(self.pg0, p_1*NUM_PKTS, self.pg1)
|
||||
|
||||
#
|
||||
@@ -240,7 +240,7 @@ class TestAbf(VppTestCase):
|
||||
dst=self.pg1.local_mac) /
|
||||
IP(src="1.1.1.1", dst="1.1.1.2") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
self.send_and_expect(self.pg1, p_2 * NUM_PKTS, self.pg3)
|
||||
|
||||
#
|
||||
@@ -318,7 +318,7 @@ class TestAbf(VppTestCase):
|
||||
dst=self.pg0.local_mac) /
|
||||
IPv6(src="2001::2", dst="2001::1") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# packets are dropped because there is no route to the policy's
|
||||
|
||||
@@ -417,7 +417,7 @@ class Flowprobe(MethodHolder):
|
||||
src=self.pg7.remote_mac) /
|
||||
IP(src=self.pg7.remote_ip4, dst="9.0.0.100") /
|
||||
TCP(sport=1234, dport=4321, flags=80) /
|
||||
Raw('\xa5' * 100))]
|
||||
Raw(b'\xa5' * 100))]
|
||||
|
||||
nowUTC = int(time.time())
|
||||
nowUNIX = nowUTC+2208988800
|
||||
|
||||
+112
-112
File diff suppressed because it is too large
Load Diff
@@ -202,7 +202,7 @@ class TestIgmp(VppTestCase):
|
||||
IP(src=self.pg0.remote_ip4, dst='224.0.0.1', tos=0xc0) /
|
||||
IGMPv3(type="Membership Query", mrcode=100) /
|
||||
IGMPv3mq(gaddr="0.0.0.0") /
|
||||
Raw('\x00' * 10))
|
||||
Raw(b'\x00' * 10))
|
||||
|
||||
self.send(self.pg0, p_g)
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ class TestL3xc(VppTestCase):
|
||||
dst=self.pg0.local_mac) /
|
||||
IP(src="1.1.1.1", dst="1.1.1.2") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
# self.send_and_expect(self.pg0, p_1*NUM_PKTS, self.pg1)
|
||||
|
||||
p_2 = []
|
||||
@@ -141,7 +141,7 @@ class TestL3xc(VppTestCase):
|
||||
dst=self.pg0.local_mac) /
|
||||
IP(src="1.1.1.1", dst="1.1.1.2") /
|
||||
UDP(sport=1000 + ii, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
self.send_and_expect_load_balancing(self.pg2, p_2,
|
||||
[self.pg3, self.pg4, self.pg5])
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
#
|
||||
|
||||
+3
-3
@@ -1755,11 +1755,11 @@ class BFDFIBTestCase(VppTestCase):
|
||||
p = [(Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
|
||||
IPv6(src="3001::1", dst="2001::1") /
|
||||
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="3001::1", dst="2002::1") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))]
|
||||
Raw(b'\xa5' * 100))]
|
||||
|
||||
# A recursive and a non-recursive route via a next-hop that
|
||||
# will have a BFD session
|
||||
@@ -1884,7 +1884,7 @@ class BFDTunTestCase(VppTestCase):
|
||||
p = [(Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
|
||||
IP(src=self.pg0.remote_ip4, dst=gre_if.remote_ip4) /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))]
|
||||
Raw(b'\xa5' * 100))]
|
||||
|
||||
# session is up - traffic passes
|
||||
bfd_session_up(self)
|
||||
|
||||
+9
-9
@@ -75,13 +75,13 @@ class TestDVR(VppTestCase):
|
||||
IP(src=any_src_addr,
|
||||
dst=ip_non_tag_bridged) /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
pkt_tag = (Ether(src=self.pg0.remote_mac,
|
||||
dst=self.loop0.local_mac) /
|
||||
IP(src=any_src_addr,
|
||||
dst=ip_tag_bridged) /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# Two sub-interfaces so we can test VLAN tag push/pop
|
||||
@@ -158,7 +158,7 @@ class TestDVR(VppTestCase):
|
||||
IP(src=any_src_addr,
|
||||
dst=ip_tag_bridged) /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
rx = self.send_and_expect(self.pg2,
|
||||
pkt_tag_to_tag * NUM_PKTS,
|
||||
@@ -175,7 +175,7 @@ class TestDVR(VppTestCase):
|
||||
IP(src=any_src_addr,
|
||||
dst=ip_non_tag_bridged) /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
rx = self.send_and_expect(self.pg2,
|
||||
pkt_tag_to_non_tag * NUM_PKTS,
|
||||
@@ -270,33 +270,33 @@ class TestDVR(VppTestCase):
|
||||
IP(src="2.2.2.2",
|
||||
dst="1.1.1.1") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
pkt_to_tag = (Ether(src=self.pg0.remote_mac,
|
||||
dst=self.pg2.remote_mac) /
|
||||
IP(src="2.2.2.2",
|
||||
dst="1.1.1.2") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
pkt_from_tag = (Ether(src=self.pg3.remote_mac,
|
||||
dst=self.pg2.remote_mac) /
|
||||
Dot1Q(vlan=93) /
|
||||
IP(src="2.2.2.2",
|
||||
dst="1.1.1.1") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
pkt_from_to_tag = (Ether(src=self.pg3.remote_mac,
|
||||
dst=self.pg2.remote_mac) /
|
||||
Dot1Q(vlan=93) /
|
||||
IP(src="2.2.2.2",
|
||||
dst="1.1.1.2") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
pkt_bcast = (Ether(src=self.pg0.remote_mac,
|
||||
dst="ff:ff:ff:ff:ff:ff") /
|
||||
IP(src="2.2.2.2",
|
||||
dst="255.255.255.255") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# A couple of sub-interfaces for tags
|
||||
|
||||
+17
-17
@@ -1469,7 +1469,7 @@ class IPv6NDProxyTest(TestIPv6ND):
|
||||
IPv6(dst=self.pg0._remote_hosts[2].ip6,
|
||||
src=self.pg0.remote_ip6) /
|
||||
inet6.UDP(sport=10000, dport=20000) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
self.pg0.add_stream(t)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
@@ -1531,7 +1531,7 @@ class IPv6NDProxyTest(TestIPv6ND):
|
||||
IPv6(dst=self.pg0._remote_hosts[2].ip6,
|
||||
src=self.pg0._remote_hosts[3].ip6) /
|
||||
inet6.UDP(sport=10000, dport=20000) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
self.pg2.add_stream(t2)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
@@ -1619,7 +1619,7 @@ class TestIPNull(VppTestCase):
|
||||
dst=self.pg0.local_mac) /
|
||||
IPv6(src=self.pg0.remote_ip6, dst="2001::1") /
|
||||
inet6.UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# A route via IP NULL that will reply with ICMP unreachables
|
||||
@@ -1718,12 +1718,12 @@ class TestIPDisabled(VppTestCase):
|
||||
dst=self.pg1.local_mac) /
|
||||
IPv6(src="2001::1", dst=self.pg0.remote_ip6) /
|
||||
inet6.UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
pm = (Ether(src=self.pg1.remote_mac,
|
||||
dst=self.pg1.local_mac) /
|
||||
IPv6(src="2001::1", dst="ffef::1") /
|
||||
inet6.UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# PG1 does not forward IP traffic
|
||||
@@ -1834,7 +1834,7 @@ class TestIP6LoadBalance(VppTestCase):
|
||||
port_ip_hdr = (
|
||||
IPv6(dst="3000::1", src="3000:1::1") /
|
||||
inet6.UDP(sport=1234, dport=1234 + ii) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
port_ip_pkts.append((Ether(src=self.pg0.remote_mac,
|
||||
dst=self.pg0.local_mac) /
|
||||
port_ip_hdr))
|
||||
@@ -1856,7 +1856,7 @@ class TestIP6LoadBalance(VppTestCase):
|
||||
src_ip_hdr = (
|
||||
IPv6(dst="3000::1", src="3000:1::%d" % ii) /
|
||||
inet6.UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
src_ip_pkts.append((Ether(src=self.pg0.remote_mac,
|
||||
dst=self.pg0.local_mac) /
|
||||
src_ip_hdr))
|
||||
@@ -1954,13 +1954,13 @@ class TestIP6LoadBalance(VppTestCase):
|
||||
src="4000:1::1") /
|
||||
inet6.UDP(sport=1234,
|
||||
dport=1234 + ii) /
|
||||
Raw('\xa5' * 100)))
|
||||
Raw(b'\xa5' * 100)))
|
||||
src_pkts.append((Ether(src=self.pg0.remote_mac,
|
||||
dst=self.pg0.local_mac) /
|
||||
IPv6(dst="4000::1",
|
||||
src="4000:1::%d" % ii) /
|
||||
inet6.UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100)))
|
||||
Raw(b'\xa5' * 100)))
|
||||
|
||||
route_3000_2 = VppIpRoute(self, "3000::2", 128,
|
||||
[VppRoutePath(self.pg3.remote_ip6,
|
||||
@@ -2000,7 +2000,7 @@ class TestIP6LoadBalance(VppTestCase):
|
||||
src="6000:1::1") /
|
||||
inet6.UDP(sport=1234,
|
||||
dport=1234 + ii) /
|
||||
Raw('\xa5' * 100)))
|
||||
Raw(b'\xa5' * 100)))
|
||||
|
||||
route_5000_2 = VppIpRoute(self, "5000::2", 128,
|
||||
[VppRoutePath(self.pg3.remote_ip6,
|
||||
@@ -2054,7 +2054,7 @@ class TestIP6Punt(VppTestCase):
|
||||
IPv6(src=self.pg0.remote_ip6,
|
||||
dst=self.pg0.local_ip6) /
|
||||
inet6.TCP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
pkts = p * 1025
|
||||
|
||||
@@ -2221,12 +2221,12 @@ class TestIPDeag(VppTestCase):
|
||||
dst=self.pg0.local_mac) /
|
||||
IPv6(src="5::5", dst="1::1") /
|
||||
inet6.TCP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
p_src = (Ether(src=self.pg0.remote_mac,
|
||||
dst=self.pg0.local_mac) /
|
||||
IPv6(src="2::2", dst="1::2") /
|
||||
inet6.TCP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
pkts_dst = p_dst * 257
|
||||
pkts_src = p_src * 257
|
||||
|
||||
@@ -2268,7 +2268,7 @@ class TestIPDeag(VppTestCase):
|
||||
dst=self.pg0.local_mac) /
|
||||
IPv6(src="3::4", dst="3::3") /
|
||||
inet6.TCP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
self.send_and_assert_no_replies(self.pg0, p_l * 257,
|
||||
"IP lookup loop")
|
||||
@@ -2312,7 +2312,7 @@ class TestIP6Input(VppTestCase):
|
||||
dst=self.pg1.remote_ip6,
|
||||
hlim=1) /
|
||||
inet6.UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
rx = self.send_and_expect(self.pg0, p_version * NUM_PKTS, self.pg0)
|
||||
rx = rx[0]
|
||||
@@ -2351,7 +2351,7 @@ class TestIP6Input(VppTestCase):
|
||||
dst=dst or self.pg1.remote_ip6,
|
||||
version=3) /
|
||||
l4 /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
self.send_and_assert_no_replies(self.pg0, p_version * NUM_PKTS,
|
||||
remark=msg or "",
|
||||
@@ -2365,7 +2365,7 @@ class TestIP6Input(VppTestCase):
|
||||
IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6) /
|
||||
IPv6ExtHdrHopByHop() /
|
||||
inet6.UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
self.pg0.add_stream(p)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
|
||||
@@ -100,7 +100,7 @@ class TestIPMcast(VppTestCase):
|
||||
UDP(sport=1234, dport=1234))
|
||||
if not payload_size:
|
||||
payload_size = 64 - len(p)
|
||||
p = p / Raw('\xa5' * payload_size)
|
||||
p = p / Raw(b'\xa5' * payload_size)
|
||||
|
||||
for i in range(0, N_PKTS_IN_STREAM):
|
||||
pkts.append(p)
|
||||
@@ -847,7 +847,7 @@ class TestIPMcast(VppTestCase):
|
||||
GRE() /
|
||||
IP(src="1.1.1.1", dst="232.2.2.2") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\a5' * 64)) * 63
|
||||
Raw(b'\a5' * 64)) * 63
|
||||
|
||||
self.vapi.cli("clear trace")
|
||||
self.pg1.add_stream(tx)
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -80,7 +80,7 @@ class TestL2Flood(VppTestCase):
|
||||
src="00:00:de:ad:be:ef") /
|
||||
IP(src="10.10.10.10", dst="1.1.1.1") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# input on pg0 expect copies on pg1->11
|
||||
@@ -180,7 +180,7 @@ class TestL2Flood(VppTestCase):
|
||||
src="00:00:de:ad:be:ef") /
|
||||
IP(src="10.10.10.10", dst="1.1.1.1") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# input on pg0 expect copies on pg1
|
||||
@@ -217,12 +217,12 @@ class TestL2Flood(VppTestCase):
|
||||
src="00:00:de:ad:be:ef") /
|
||||
IP(src="10.10.10.10", dst="1.1.1.1") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
p_bm = (Ether(dst="ff:ff:ff:ff:ff:ff",
|
||||
src="00:00:de:ad:be:ef") /
|
||||
IP(src="10.10.10.10", dst="1.1.1.1") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# input on pg0, expected copies on pg1->4
|
||||
|
||||
+10
-10
@@ -1547,7 +1547,7 @@ class TestMPLSDisabled(VppTestCase):
|
||||
MPLS(label=32, ttl=64) /
|
||||
IPv6(src="2001::1", dst=self.pg0.remote_ip6) /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# A simple MPLS xconnect - eos label in label out
|
||||
@@ -1703,7 +1703,7 @@ class TestMPLSPIC(VppTestCase):
|
||||
src=self.pg2.remote_mac) /
|
||||
IP(src=self.pg2.remote_ip4, dst=dst) /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# Send the packet stream (one pkt to each VPN route)
|
||||
@@ -1825,7 +1825,7 @@ class TestMPLSPIC(VppTestCase):
|
||||
MPLS(label=local_label, ttl=64) /
|
||||
IP(src=self.pg0.remote_ip4, dst=dst) /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# Send the packet stream (one pkt to each VPN route)
|
||||
@@ -1947,7 +1947,7 @@ class TestMPLSPIC(VppTestCase):
|
||||
MPLS(label=local_label, ttl=64) /
|
||||
IPv6(src=self.pg0.remote_ip6, dst=dst) /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
self.logger.info(self.vapi.cli("sh ip6 fib %s" % dst))
|
||||
|
||||
self.pg0.add_stream(pkts)
|
||||
@@ -2130,7 +2130,7 @@ class TestMPLSL2(VppTestCase):
|
||||
src="00:00:de:ad:be:ef") /
|
||||
IP(src="10.10.10.10", dst="11.11.11.11") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
tx0 = pcore * NUM_PKTS
|
||||
rx0 = self.send_and_expect(self.pg0, tx0, self.pg1)
|
||||
@@ -2215,12 +2215,12 @@ class TestMPLSL2(VppTestCase):
|
||||
src="00:00:de:ad:be:ef") /
|
||||
IP(src="10.10.10.10", dst="11.11.11.11") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
p_cust2 = (Ether(dst="00:00:de:ad:ba:b2",
|
||||
src="00:00:de:ad:be:ef") /
|
||||
IP(src="10.10.10.10", dst="11.11.11.12") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
p_core1 = (Ether(dst=self.pg0.local_mac,
|
||||
src=self.pg0.remote_mac) /
|
||||
MPLS(label=55, ttl=64) /
|
||||
@@ -2228,16 +2228,16 @@ class TestMPLSL2(VppTestCase):
|
||||
dst="00:00:de:ad:be:ef") /
|
||||
IP(dst="10.10.10.10", src="11.11.11.11") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
p_core2 = (Ether(dst=self.pg0.local_mac,
|
||||
src=self.pg0.remote_mac) /
|
||||
MPLS(label=56, ttl=64) /
|
||||
Raw('\x01' * 4) / # PW CW
|
||||
Raw(b'\x01' * 4) / # PW CW
|
||||
Ether(src="00:00:de:ad:ba:b2",
|
||||
dst="00:00:de:ad:be:ef") /
|
||||
IP(dst="10.10.10.10", src="11.11.11.12") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
#
|
||||
# The BD is learning, so send in one of each packet to learn
|
||||
|
||||
@@ -946,7 +946,7 @@ class ARPTestCase(VppTestCase):
|
||||
dst=self.pg0.local_mac) /
|
||||
IP(src=self.pg0.remote_ip4, dst="10.0.0.1") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
self.pg0.add_stream(p)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+3
-3
@@ -114,7 +114,7 @@ class TestPipe(VppTestCase):
|
||||
IP(src="1.1.1.1",
|
||||
dst="1.1.1.2") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
self.send_and_expect(self.pg0, p * NUM_PKTS, self.pg1)
|
||||
self.send_and_expect(self.pg1, p * NUM_PKTS, self.pg0)
|
||||
@@ -200,7 +200,7 @@ class TestPipe(VppTestCase):
|
||||
IP(src="1.1.1.2",
|
||||
dst="1.1.1.1") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
# bind the pipe ends to the correct tables
|
||||
self.vapi.sw_interface_set_table(pipes[1].west, 0, 2)
|
||||
@@ -221,7 +221,7 @@ class TestPipe(VppTestCase):
|
||||
IP(src="1.1.1.1",
|
||||
dst="1.1.1.2") /
|
||||
UDP(sport=1234, dport=1234) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
self.send_and_expect(self.pg3, p_west * NUM_PKTS, self.pg2)
|
||||
|
||||
#
|
||||
|
||||
+5
-5
@@ -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)
|
||||
|
||||
+1
-1
@@ -236,7 +236,7 @@ class TestVxlan(BridgeDomain, VppTestCase):
|
||||
frame = (Ether(src='00:00:00:00:00:02', dst='00:00:00:00:00:01') /
|
||||
IP(src='4.3.2.1', dst='1.2.3.4') /
|
||||
UDP(sport=20000, dport=10000) /
|
||||
Raw('\xa5' * 1450))
|
||||
Raw(b'\xa5' * 1450))
|
||||
|
||||
self.pg1.add_stream([frame])
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class TestVxlanGbp(VppTestCase):
|
||||
return (Ether(src='00:00:00:00:00:01', dst='00:00:00:00:00:02') /
|
||||
IP(src='1.2.3.4', dst='4.3.2.1') /
|
||||
UDP(sport=10000, dport=20000) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
@property
|
||||
def frame_reply(self):
|
||||
@@ -32,7 +32,7 @@ class TestVxlanGbp(VppTestCase):
|
||||
return (Ether(src='00:00:00:00:00:02', dst='00:00:00:00:00:01') /
|
||||
IP(src='4.3.2.1', dst='1.2.3.4') /
|
||||
UDP(sport=20000, dport=10000) /
|
||||
Raw('\xa5' * 100))
|
||||
Raw(b'\xa5' * 100))
|
||||
|
||||
def encapsulate(self, pkt, vni):
|
||||
"""
|
||||
@@ -258,7 +258,7 @@ class TestVxlanGbp(VppTestCase):
|
||||
frame = (Ether(src='00:00:00:00:00:02', dst='00:00:00:00:00:01') /
|
||||
IP(src='4.3.2.1', dst='1.2.3.4') /
|
||||
UDP(sport=20000, dport=10000) /
|
||||
Raw('\xa5' * 1450))
|
||||
Raw(b'\xa5' * 1450))
|
||||
|
||||
self.pg1.add_stream([frame])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user