When the tcpdump capture is empty and there are no grep_filters available
the processing of dump file will incorrectly report one captured packet.
The fix is to remove empty line that is returned by readline() on EOF
from the processing.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
test_modules/PacketAssert.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test_modules/PacketAssert.py b/test_modules/PacketAssert.py
index 404f371..b0a7101 100644
--- a/test_modules/PacketAssert.py
+++ b/test_modules/PacketAssert.py
@@ -125,7 +125,8 @@ class PacketAssert(TestGeneric):
break
line = line.strip("\n")
- self._process_captured_line(line)
+ if len(line) != 0:
+ self._process_captured_line(line)
tcpdump_file.close()
os.remove(tcpdump_file.name)
--
1.8.3.1