summaryrefslogtreecommitdiffstats
path: root/test/vpp_pg_interface.py
diff options
context:
space:
mode:
authorJan <jgelety@cisco.com>2016-12-08 13:10:03 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2017-01-11 11:57:39 +0000
commite546d3b0f739d35ec2e4702181d99ff4190e8b46 (patch)
treea2f0595c9706b750ed79b0ddfd945c7af62a05a1 /test/vpp_pg_interface.py
parent8cb07c9237787e66921f252be2ed2aa5557769c4 (diff)
test: ip4 vrf instances multi-context test (CSIT-492)
- add/delete IPv4 VRF instances and verify results by parsing output of ip_fib_dump API command and by traffic Change-Id: I61ed5013adca29afd00b942f65be7bf964f38d85 Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'test/vpp_pg_interface.py')
-rw-r--r--test/vpp_pg_interface.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/vpp_pg_interface.py b/test/vpp_pg_interface.py
index b5929a4b29f..eeb9c1a5cb0 100644
--- a/test/vpp_pg_interface.py
+++ b/test/vpp_pg_interface.py
@@ -145,7 +145,7 @@ class VppPGInterface(VppInterface):
output = rdpcap(self.out_path)
self.test.logger.debug("Capture has %s packets" % len(output.res))
except:
- self.test.logger.debug("Exception in scapy.rdpcap(%s): %s" %
+ self.test.logger.debug("Exception in scapy.rdpcap (%s): %s" %
(self.out_path, format_exc()))
return None
before = len(output.res)
@@ -182,7 +182,7 @@ class VppPGInterface(VppInterface):
if expected_count == 0:
raise Exception(
"Internal error, expected packet count for %s is 0!" % name)
- self.test.logger.debug("Expecting to capture %s(%s) packets on %s" % (
+ self.test.logger.debug("Expecting to capture %s (%s) packets on %s" % (
expected_count, based_on, name))
while remaining_time > 0:
before = time.time()
@@ -213,22 +213,20 @@ class VppPGInterface(VppInterface):
try:
capture = self.get_capture(
0, remark=remark, filter_out_fn=filter_out_fn)
- if capture:
- if len(capture.res) == 0:
- # junk filtered out, we're good
- return
- self.test.logger.error(
- ppc("Unexpected packets captured:", capture))
+ if not capture:
+ # junk filtered out, we're good
+ return
+ self.test.logger.error(
+ ppc("Unexpected packets captured:", capture))
except:
pass
if remark:
raise AssertionError(
- "Non-empty capture file present for interface %s(%s)" %
+ "Non-empty capture file present for interface %s (%s)" %
(self.name, remark))
else:
- raise AssertionError(
- "Non-empty capture file present for interface %s" %
- self.name)
+ raise AssertionError("Capture file present for interface %s" %
+ self.name)
def wait_for_capture_file(self, timeout=1):
"""