Mon, Feb 23, 2015 at 01:39:29PM CET, olichtne(a)redhat.com wrote:
From: Ondrej Lichtner <olichtne(a)redhat.com>
This commit also changes the method wait_on_interrupt provided for test
modules. Previously it was bound to usage coupled with the
I don't think that it __WAS__ bound previously, the method should be still
the counterpart to set_handle_intr(). I still don't see the reason why you
want to remove it. It's a valid mean to do synchronization from within the task.
The valid use case for this is when you want to compare data before and
after another <run> takes place, that's what PktCounter is doing.
<example>
MyModule(TestsCommon):
def run():
# I'm interested in synchronization within task
self.set_handle_intr()
# save state before sync point
state1 = state.dump()
# now wait for 'intr' in lnst recipe
# this blocks
self.wait_on_interrupt()
# save state after sync point
state2 = state.dump()
# process the monitor output
if state.compare(state1, state2):
self.set_fail()
else:
self.set_pass()
</example>
set_handle_intr signal handler. Now the method is standalone changes
your SIGINT signal handler only for the duration of the method. This
makes the method set_handle_intr obsolete so it was removed.