Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
make test: fix missing log/packet messages
[vpp.git]
/
test
/
test_lb.py
diff --git
a/test/test_lb.py
b/test/test_lb.py
index
9ba3b7f
..
3e7f5e1
100644
(file)
--- a/
test/test_lb.py
+++ b/
test/test_lb.py
@@
-1,5
+1,4
@@
import socket
import socket
-from logging import *
from scapy.layers.inet import IP, UDP
from scapy.layers.inet6 import IPv6
from scapy.layers.inet import IP, UDP
from scapy.layers.inet6 import IPv6
@@
-7,6
+6,7
@@
from scapy.layers.l2 import Ether, GRE
from scapy.packet import Raw
from framework import VppTestCase
from scapy.packet import Raw
from framework import VppTestCase
+from util import ppp
""" TestLB is a subclass of VPPTestCase classes.
""" TestLB is a subclass of VPPTestCase classes.
@@
-57,7
+57,7
@@
class TestLB(VppTestCase):
def tearDown(self):
super(TestLB, self).tearDown()
if not self.vpp_dead:
def tearDown(self):
super(TestLB, self).tearDown()
if not self.vpp_dead:
- info(self.vapi.cli("show lb vip verbose"))
+
self.logger.
info(self.vapi.cli("show lb vip verbose"))
def getIPv4Flow(self, id):
return (IP(dst="90.0.%u.%u" % (id / 255, id % 255),
def getIPv4Flow(self, id):
return (IP(dst="90.0.%u.%u" % (id / 255, id % 255),
@@
-69,6
+69,7
@@
class TestLB(VppTestCase):
UDP(sport=10000 + id, dport=20000 + id))
def generatePackets(self, src_if, isv4):
UDP(sport=10000 + id, dport=20000 + id))
def generatePackets(self, src_if, isv4):
+ self.packet_infos = {}
pkts = []
for pktid in self.packets:
info = self.create_packet_info(src_if.sw_if_index, pktid)
pkts = []
for pktid in self.packets:
info = self.create_packet_info(src_if.sw_if_index, pktid)
@@
-138,8
+139,7
@@
class TestLB(VppTestCase):
self.checkInner(gre, isv4)
load[asid] += 1
except:
self.checkInner(gre, isv4)
load[asid] += 1
except:
- error("Unexpected or invalid packet:")
- p.show()
+ self.logger.error(ppp("Unexpected or invalid packet:", p))
raise
# This is just to roughly check that the balancing algorithm
raise
# This is just to roughly check that the balancing algorithm
@@
-179,10
+179,7
@@
class TestLB(VppTestCase):
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
- # Scapy fails parsing GRE over IPv6.
- # This check is therefore disabled for now.
- # One can easily patch layers/inet6.py to fix the issue.
- # self.checkCapture(gre4=True, isv4=False)
+ self.checkCapture(gre4=True, isv4=False)
finally:
for asid in self.ass:
self.vapi.cli("lb as 2001::/16 10.0.0.%u del" % (asid))
finally:
for asid in self.ass:
self.vapi.cli("lb as 2001::/16 10.0.0.%u del" % (asid))
@@
-199,10
+196,7
@@
class TestLB(VppTestCase):
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
- # Scapy fails parsing GRE over IPv6.
- # This check is therefore disabled for now.
- # One can easily patch layers/inet6.py to fix the issue.
- # self.checkCapture(gre4=False, isv4=True)
+ self.checkCapture(gre4=False, isv4=True)
finally:
for asid in self.ass:
self.vapi.cli("lb as 90.0.0.0/8 2002::%u" % (asid))
finally:
for asid in self.ass:
self.vapi.cli("lb as 90.0.0.0/8 2002::%u" % (asid))
@@
-219,10
+213,7
@@
class TestLB(VppTestCase):
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
- # Scapy fails parsing GRE over IPv6.
- # This check is therefore disabled for now.
- # One can easily patch layers/inet6.py to fix the issue.
- # self.checkCapture(gre4=False, isv4=False)
+ self.checkCapture(gre4=False, isv4=False)
finally:
for asid in self.ass:
self.vapi.cli("lb as 2001::/16 2002::%u del" % (asid))
finally:
for asid in self.ass:
self.vapi.cli("lb as 2001::/16 2002::%u del" % (asid))