From e546d3b0f739d35ec2e4702181d99ff4190e8b46 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 8 Dec 2016 13:10:03 +0100 Subject: 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 --- test/vpp_pg_interface.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'test/vpp_pg_interface.py') diff --git a/test/vpp_pg_interface.py b/test/vpp_pg_interface.py index b5929a4b..eeb9c1a5 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): """ -- cgit 1.2.3-korg