#3806 Fix responder-get-domains-tests
Opened 4 months ago by pbrezina. Modified 4 months ago

New sbus implementation broke responder-get-domains-tests and we could not find how to fix it in time. The test affected are parse_inp_call_dp and parse_inp_call_attach.

This is the possible solution but for some reason the __wrap function was not called even though it should be.

diff --git a/Makefile.am b/Makefile.am
index 89011ea41..bf53fd9f9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2718,6 +2718,8 @@ responder_get_domains_tests_SOURCES = \
 responder_get_domains_tests_CFLAGS = \
     $(AM_CFLAGS)
 responder_get_domains_tests_LDFLAGS = \
+    -Wl,-wrap,sss_dp_get_domains_send \
+    -Wl,-wrap,sss_dp_get_domains_recv \
     -Wl,-wrap,sss_parse_name_for_domains \
     -Wl,-wrap,sss_ncache_reset_repopulate_permanent
 responder_get_domains_tests_LDADD = \
diff --git a/src/tests/cmocka/test_responder_common.c b/src/tests/cmocka/test_responder_common.c
index f75bb6f4f..05760046c 100644
--- a/src/tests/cmocka/test_responder_common.c
+++ b/src/tests/cmocka/test_responder_common.c
@@ -35,6 +35,30 @@

 #define NAME "username"

+struct tevent_req *
+__wrap_sss_dp_get_domains_send(TALLOC_CTX *mem_ctx,
+                               struct resp_ctx *rctx,
+                               bool force,
+                               const char *hint)
+{
+    errno_t ret;
+    puts("CALLING WRAPPER SEND");
+
+    ret = sss_resp_populate_cr_domains(rctx);
+    if (ret != EOK) {
+        return NULL;
+    }
+
+    return test_req_succeed_send(mem_ctx, rctx->ev);
+}
+
+errno_t
+__wrap_sss_dp_get_domains_recv(struct tevent_req *req)
+{
+    puts("CALLING WRAPPER RECV");
+    return test_request_recv(req);
+}
+

Login to comment on this ticket.

Metadata