[lnst] TestPacketAssert: fix line processing bug

Jiří Pírko jirka at fedoraproject.org
Fri May 3 09:24:00 UTC 2013


commit 547e493a484d16df72a929c99332663ad5b6e1fb
Author: Ondrej Lichtner <olichtne at redhat.com>
Date:   Thu Apr 25 16:09:16 2013 +0200

    TestPacketAssert: fix line processing bug
    
    The last two lines from tcpdump were not being processed due to a bug in
    the handling loop. This commit fixes that.
    
    Signed-off-by: Ondrej Lichtner <olichtne at redhat.com>

 test_modules/TestPacketAssert.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/test_modules/TestPacketAssert.py b/test_modules/TestPacketAssert.py
index 32884a4..0466c20 100644
--- a/test_modules/TestPacketAssert.py
+++ b/test_modules/TestPacketAssert.py
@@ -58,6 +58,8 @@ class TestPacketAssert(TestGeneric):
                 self.line = next_line
             else:
                 self.line += next_line
+        if self.line != "":
+            self._process_captured_line(self.line)
 
 
     def _prepare_grep_filters(self):
@@ -152,6 +154,9 @@ class TestPacketAssert(TestGeneric):
             else:
                 self.line += next_line
 
+        if self.line != "":
+            self._process_captured_line(self.line)
+
         logging.info("Capturing finished. Received %d packets", self._num_recv)
         res = {"received": self._num_recv,
                "min": self._min_cond,


More information about the LNST-developers mailing list