summaryrefslogtreecommitdiffstats
path: root/src/tests/common_tev.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-03-26 16:49:26 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-05-03 20:22:29 +0200
commit9cb46bc62f22e0104f1b41a423b014c281ef5fc2 (patch)
tree375254d502d24d51072cf9668fe3a09977ce1edc /src/tests/common_tev.c
parentc080a11e9e88f35e40aff4e476cabbd971833019 (diff)
downloadsssd-9cb46bc62f22e0104f1b41a423b014c281ef5fc2.tar.gz
sssd-9cb46bc62f22e0104f1b41a423b014c281ef5fc2.tar.xz
sssd-9cb46bc62f22e0104f1b41a423b014c281ef5fc2.zip
Refactor dynamic DNS updates
Provides two new layers instead of the previous IPA specific layer: 1) dp_dyndns.c -- a very generic dyndns layer on the DP level. Its purpose it to make it possible for any back end to use dynamic DNS updates. 2) sdap_dyndns.c -- a wrapper around dp_dyndns.c that utilizes some LDAP-specific features like autodetecting the address from the LDAP connection. Also converts the dyndns code to new specific error codes.
Diffstat (limited to 'src/tests/common_tev.c')
-rw-r--r--src/tests/common_tev.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/tests/common_tev.c b/src/tests/common_tev.c
index e9db8d053..81b97d331 100644
--- a/src/tests/common_tev.c
+++ b/src/tests/common_tev.c
@@ -26,6 +26,31 @@
#include "tests/common.h"
+struct sss_test_ctx *
+create_ev_test_ctx(TALLOC_CTX *mem_ctx)
+{
+ struct sss_test_ctx *test_ctx;
+
+ test_ctx = talloc_zero(mem_ctx, struct sss_test_ctx);
+ if (test_ctx == NULL) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed\n"));
+ goto fail;
+ }
+
+ /* Create an event context */
+ test_ctx->ev = tevent_context_init(test_ctx);
+ if (test_ctx->ev == NULL) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_context_init failed\n"));
+ goto fail;
+ }
+
+ return test_ctx;
+
+fail:
+ talloc_free(test_ctx);
+ return NULL;
+}
+
struct tevent_req *
test_request_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, errno_t err)
{