Lines Matching refs:dyndns_test_ctx

52 struct dyndns_test_ctx {
63 static struct dyndns_test_ctx *dyndns_test_ctx;
69 switch (dyndns_test_ctx->state) {
183 struct dyndns_test_ctx *ctx =
184 tevent_req_callback_data(req, struct dyndns_test_ctx);
237 check_leaks_push(dyndns_test_ctx);
241 ret = sss_iface_addr_list_get(dyndns_test_ctx, "eth0", &addrlist);
257 assert_true(check_leaks_pop(dyndns_test_ctx) == true);
267 check_leaks_push(dyndns_test_ctx);
271 ret = sss_iface_addr_list_get(dyndns_test_ctx, "eth0", &addrlist);
300 assert_true(check_leaks_pop(dyndns_test_ctx) == true);
308 check_leaks_push(dyndns_test_ctx);
312 ret = sss_iface_addr_list_get(dyndns_test_ctx, "non_existing_interface",
317 assert_true(check_leaks_pop(dyndns_test_ctx) == true);
337 check_leaks_push(dyndns_test_ctx);
344 ret = sss_iface_addr_list_get(dyndns_test_ctx, "eth0", &addrlist);
347 ret = sss_iface_addr_list_as_str_list(dyndns_test_ctx, addrlist, &output);
356 assert_true(check_leaks_pop(dyndns_test_ctx) == true);
366 check_leaks_push(dyndns_test_ctx);
381 ret = sss_get_dualstack_addresses(dyndns_test_ctx,
386 ret = be_nsupdate_create_fwd_msg(dyndns_test_ctx, NULL, NULL, "bran_stark",
401 ret = be_nsupdate_create_fwd_msg(dyndns_test_ctx, "North", "Winterfell",
419 ret = be_nsupdate_create_fwd_msg(dyndns_test_ctx, "North", NULL,
436 ret = be_nsupdate_create_fwd_msg(dyndns_test_ctx, NULL, "Winterfell",
454 ret = be_nsupdate_create_fwd_msg(dyndns_test_ctx, NULL, NULL, "bran_stark",
468 ret = be_nsupdate_create_fwd_msg(dyndns_test_ctx, NULL, NULL, "bran_stark",
482 assert_true(check_leaks_pop(dyndns_test_ctx) == true);
492 check_leaks_push(dyndns_test_ctx);
507 ret = sss_get_dualstack_addresses(dyndns_test_ctx,
512 ret = be_nsupdate_create_fwd_msg(dyndns_test_ctx, NULL, NULL, "bran_stark",
529 assert_true(check_leaks_pop(dyndns_test_ctx) == true);
539 check_leaks_push(dyndns_test_ctx);
552 ret = sss_get_dualstack_addresses(dyndns_test_ctx,
557 ret = be_nsupdate_create_fwd_msg(dyndns_test_ctx, NULL, NULL, "bran_stark",
572 assert_true(check_leaks_pop(dyndns_test_ctx) == true);
582 check_leaks_push(dyndns_test_ctx);
596 ret = sss_get_dualstack_addresses(dyndns_test_ctx,
601 ret = be_nsupdate_create_fwd_msg(dyndns_test_ctx, NULL, NULL, "bran_stark",
616 assert_true(check_leaks_pop(dyndns_test_ctx) == true);
627 check_leaks_push(dyndns_test_ctx);
642 ret = sss_get_dualstack_addresses(dyndns_test_ctx,
673 assert_true(check_leaks_pop(dyndns_test_ctx) == true);
684 check_leaks_push(dyndns_test_ctx);
703 ret = sss_get_dualstack_addresses(dyndns_test_ctx,
758 assert_true(check_leaks_pop(dyndns_test_ctx) == true);
766 check_leaks_push(dyndns_test_ctx);
778 ret = sss_get_dualstack_addresses(dyndns_test_ctx,
783 assert_true(check_leaks_pop(dyndns_test_ctx) == true);
796 dyndns_test_ctx->state = MOCK_NSUPDATE_OK;
798 req = be_nsupdate_send(tmp_ctx, dyndns_test_ctx->tctx->ev,
802 tevent_req_set_callback(req, dyndns_test_done, dyndns_test_ctx);
805 ret = test_ev_loop(dyndns_test_ctx->tctx);
810 assert_true(WIFEXITED(dyndns_test_ctx->child_status));
811 assert_int_equal(WEXITSTATUS(dyndns_test_ctx->child_status), 0);
827 dyndns_test_ctx->state = MOCK_NSUPDATE_ERR;
829 req = be_nsupdate_send(tmp_ctx, dyndns_test_ctx->tctx->ev,
833 tevent_req_set_callback(req, dyndns_test_done, dyndns_test_ctx);
836 ret = test_ev_loop(dyndns_test_ctx->tctx);
841 assert_true(WIFEXITED(dyndns_test_ctx->child_status));
842 assert_int_equal(WEXITSTATUS(dyndns_test_ctx->child_status), 1);
858 dyndns_test_ctx->state = MOCK_NSUPDATE_TIMEOUT;
860 req = be_nsupdate_send(tmp_ctx, dyndns_test_ctx->tctx->ev,
864 tevent_req_set_callback(req, dyndns_test_done, dyndns_test_ctx);
867 ret = test_ev_loop(dyndns_test_ctx->tctx);
877 tevent_loop_once(dyndns_test_ctx->tctx->ev); /* SIGCHLD handler */
878 tevent_loop_once(dyndns_test_ctx->tctx->ev); /* nsupdate_child_handler */
890 struct dyndns_test_ctx *ctx = talloc_get_type(pvt, struct dyndns_test_ctx);
911 ret = be_nsupdate_init(tmp_ctx, dyndns_test_ctx->be_ctx, NULL,
912 &dyndns_test_ctx->update_ctx);
915 ret = be_nsupdate_init_timer(dyndns_test_ctx->update_ctx,
916 dyndns_test_ctx->be_ctx->ev,
917 dyndns_test_timer, dyndns_test_ctx);
921 ret = test_ev_loop(dyndns_test_ctx->tctx);
926 talloc_free(dyndns_test_ctx->update_ctx);
944 dyndns_test_ctx = talloc_zero(global_talloc_context, struct dyndns_test_ctx);
945 assert_non_null(dyndns_test_ctx);
947 dyndns_test_ctx->tctx = create_dom_test_ctx(dyndns_test_ctx, TESTS_PATH,
950 assert_non_null(dyndns_test_ctx->tctx);
952 dyndns_test_ctx->be_ctx = mock_be_ctx(dyndns_test_ctx, dyndns_test_ctx->tctx);
953 assert_non_null(dyndns_test_ctx->be_ctx);
964 dyndns_test_ctx = talloc_zero(global_talloc_context, struct dyndns_test_ctx);
965 assert_non_null(dyndns_test_ctx);
971 talloc_free(dyndns_test_ctx);