Signed-off-by: Angus Salkeld <asalk...@redhat.com> --- cts/agents/common_test_agent.c | 13 +++++++++++++ cts/corosync.py | 2 +- 2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/cts/agents/common_test_agent.c b/cts/agents/common_test_agent.c index b3f4e04..5d5f859 100644 --- a/cts/agents/common_test_agent.c +++ b/cts/agents/common_test_agent.c @@ -236,6 +236,12 @@ static int create_server_sockect (int server_port) return listener; } +static int32_t sig_exit_handler (int num, void *data) +{ + qb_loop_stop(poll_handle); + return 0; +} + int test_agent_run(int server_port, ta_do_command_fn func) { int listener; @@ -243,6 +249,13 @@ int test_agent_run(int server_port, ta_do_command_fn func) do_command = func; poll_handle = qb_loop_create (); + qb_loop_signal_add(poll_handle, QB_LOOP_HIGH, + SIGINT, NULL, sig_exit_handler, NULL); + qb_loop_signal_add(poll_handle, QB_LOOP_HIGH, + SIGQUIT, NULL, sig_exit_handler, NULL); + qb_loop_signal_add(poll_handle, QB_LOOP_HIGH, + SIGTERM, NULL, sig_exit_handler, NULL); + listener = create_server_sockect (server_port); qb_loop_poll_add (poll_handle, QB_LOOP_MED, diff --git a/cts/corosync.py b/cts/corosync.py index 8705b8d..7561270 100644 --- a/cts/corosync.py +++ b/cts/corosync.py @@ -435,8 +435,8 @@ class TestAgent(object): def stop(self): '''Tear down (undo) the given ScenarioComponent''' self.env.debug('test agent: stopping %s on node %s' % (self.binary, self.node)) + self.rsh(self.node, "killall " + self.binary + " 2>/dev/null") self.sock.close () - self.rsh(self.node, "killall -9 " + self.binary + " 2>/dev/null") self.started = False def kill(self): -- 1.7.3.1 _______________________________________________ Openais mailing list Openais@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/openais