Ignore this patch... I already found the proper solution to the problem.
On Fri, Jul 18, 2014 at 04:42:16PM +0200, olichtne(a)redhat.com wrote:
From: Ondrej Lichtner <olichtne(a)redhat.com>
This patch fixes the issue of tcpdump not returning any output when
lnst-slave is running as a daemon. We're not exactly sure what causes
this problem but setting the file mode to 'a' seems to solve the issue.
Thanks to Artem Savkov for proposing this workaround.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
test_modules/PacketAssert.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/test_modules/PacketAssert.py b/test_modules/PacketAssert.py
index 0611179..3fb8293 100644
@@ -81,7 +81,9 @@ class PacketAssert(TestGeneric):
""" Start tcpdump in the background """
cmd = self._cmd
- tcpdump_file = tempfile.NamedTemporaryFile(delete=False)
+ #setting the mode to 'a' is temporary, the default mode 'w'
+ #when lnst-slave is running as a daemon, but we don't know why exactly
+ tcpdump_file = tempfile.NamedTemporaryFile(mode='a+b', delete=False)
self._tcpdump_capture_file = tcpdump_file.name
proc = subprocess.Popen(cmd, shell=True, stdout=tcpdump_file,