Because of using os.killpg(), the process group variant of kill, for
background process termination the interrupt handler in PacketAssert
test module lacks its original purpose.
The os.killpg() method sends signal to whole process group including the
tcpdump command running as forked process therefore the interrupt handler
can be removed as it is redundant to send the signal to the process twice.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
test_modules/PacketAssert.py | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/test_modules/PacketAssert.py b/test_modules/PacketAssert.py
index 0611179..404f371 100644
--- a/test_modules/PacketAssert.py
+++ b/test_modules/PacketAssert.py
@@ -36,17 +36,6 @@ class PacketAssert(TestGeneric):
_num_recv = 0
- def _set_interrupt_handler(self):
- signal.signal(signal.SIGINT, self._interrupt_handler)
- signal.signal(signal.SIGTERM, self._interrupt_handler)
-
- def _interrupt_handler(self, signum, frame):
- """ Kill tcpdump when interrupted """
- try:
- self._tcpdump.terminate()
- except OSError:
- raise Exception("Caught exception in interrupt handler")
-
def _prepare_grep_filters(self):
""" Parse `grep_for' test options """
filters = self.get_multi_opt("grep_for")
@@ -107,8 +96,6 @@ class PacketAssert(TestGeneric):
return False
def run(self):
- self._set_interrupt_handler()
-
self._prepare_grep_filters()
self._prepare_conditions()
self._compose_cmd()
--
1.8.1.4
Show replies by date