summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-06-24 13:18:17 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-07-17 15:01:51 +0200
commita7401bf72db3a6eb62b1628f9dd141f7118e3510 (patch)
tree764f60db4b140b6b492cc8b1d951dbe1bf8607a3 /src
parent66874e623df479d91476fa539a69075953a6cde3 (diff)
downloadsssd-a7401bf72db3a6eb62b1628f9dd141f7118e3510.tar.gz
sssd-a7401bf72db3a6eb62b1628f9dd141f7118e3510.tar.bz2
sssd-a7401bf72db3a6eb62b1628f9dd141f7118e3510.zip
dyndns timeout test: catch SIGCHLD handler events
https://fedorahosted.org/sssd/ticket/1992 dyndns test will crash with this patch
Diffstat (limited to 'src')
-rw-r--r--src/tests/cmocka/test_dyndns.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tests/cmocka/test_dyndns.c b/src/tests/cmocka/test_dyndns.c
index f804d792..f819dc9a 100644
--- a/src/tests/cmocka/test_dyndns.c
+++ b/src/tests/cmocka/test_dyndns.c
@@ -279,6 +279,18 @@ void dyndns_test_timeout(void **state)
/* Wait until the test finishes with EIO (child error) */
ret = test_ev_loop(dyndns_test_ctx->tctx);
+
+ /* The event queue may not be empty. We need to make sure that all events
+ * are processed. Unfortunately, tevent_loop_wait() contains a bug that
+ * prevents exiting the loop even if there are no remaining events, thus
+ * we have to use tevent_loop_once().
+ *
+ * FIXME: use tevent_loop_wait() when the bug is fixed
+ * https://bugzilla.samba.org/show_bug.cgi?id=10012
+ */
+ tevent_loop_once(dyndns_test_ctx->tctx->ev); /* SIGCHLD handler */
+ tevent_loop_once(dyndns_test_ctx->tctx->ev); /* nsupdate_child_handler */
+
DEBUG(SSSDBG_TRACE_LIBS,
("Child request returned [%d]: %s\n", ret, strerror(ret)));
assert_int_equal(ret, ERR_DYNDNS_TIMEOUT);