Lines Matching refs:test_ctx

80     struct ad_sysdb_test_ctx *test_ctx;
84 test_ctx = talloc_zero(global_talloc_context,
86 assert_non_null(test_ctx);
90 test_ctx->tctx = create_multidom_test_ctx(test_ctx, TESTS_PATH,
93 assert_non_null(test_ctx->tctx);
95 *state = test_ctx;
101 struct ad_sysdb_test_ctx *test_ctx =
105 talloc_free(test_ctx);
113 struct ad_sysdb_test_ctx *test_ctx =
122 ar = talloc_zero(test_ctx, struct dp_id_data);
125 ret = check_if_pac_is_available(test_ctx, test_ctx->tctx->dom, ar, &msg);
131 ret = check_if_pac_is_available(test_ctx, test_ctx->tctx->dom, ar, &msg);
134 ret = sysdb_add_user(test_ctx->tctx->dom, TEST_USER, 123, 456, NULL, NULL,
138 ret = check_if_pac_is_available(test_ctx, test_ctx->tctx->dom, ar, &msg);
141 attrs = sysdb_new_attrs(test_ctx);
147 ret = sysdb_set_user_attr(test_ctx->tctx->dom, TEST_USER, attrs,
151 ret = check_if_pac_is_available(test_ctx, test_ctx->tctx->dom, ar, &msg);
155 attrs = sysdb_new_attrs(test_ctx);
161 ret = sysdb_set_user_attr(test_ctx->tctx->dom, TEST_USER, attrs,
165 ret = check_if_pac_is_available(test_ctx, test_ctx->tctx->dom, ar, &msg);
169 attrs = sysdb_new_attrs(test_ctx);
175 ret = sysdb_set_user_attr(test_ctx->tctx->dom, TEST_USER, attrs,
179 ret = check_if_pac_is_available(test_ctx, test_ctx->tctx->dom, ar, &msg);
217 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
220 test_pac_blob = sss_base64_decode(test_ctx, TEST_PAC_BASE64,
224 ret = ad_get_data_from_pac(test_ctx, test_pac_blob, test_pac_blob_size,
263 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
266 err = sss_idmap_init(sss_idmap_talloc, test_ctx, sss_idmap_talloc_free,
270 test_pac_blob = sss_base64_decode(test_ctx, TEST_PAC_BASE64,
274 ret = ad_get_data_from_pac(test_ctx, test_pac_blob, test_pac_blob_size,
278 ret = ad_get_sids_from_pac(test_ctx, idmap_ctx, logon_info, &user_sid,
311 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
330 err = sss_idmap_init(sss_idmap_talloc, test_ctx, sss_idmap_talloc_free,
334 user_msg = ldb_msg_new(test_ctx);
343 val.data = sss_base64_decode(test_ctx, TEST_PAC_BASE64, &val.length);
348 ret = ad_get_pac_data_from_user_entry(test_ctx, user_msg, idmap_ctx,
394 struct ad_common_test_ctx *test_ctx;
400 test_ctx = talloc_zero(global_talloc_context, struct ad_common_test_ctx);
401 assert_non_null(test_ctx);
403 test_ctx->dom = talloc_zero(test_ctx, struct sss_domain_info);
404 assert_non_null(test_ctx->dom);
405 test_ctx->dom->name = discard_const(DOMNAME);
407 test_ctx->subdom = talloc_zero(test_ctx, struct sss_domain_info);
408 assert_non_null(test_ctx->subdom);
409 test_ctx->subdom->name = discard_const(SUBDOMNAME);
410 test_ctx->subdom->parent = test_ctx->dom;
412 test_ctx->ad_ctx = talloc_zero(test_ctx, struct ad_id_ctx);
413 assert_non_null(test_ctx->ad_ctx);
415 check_leaks_push(test_ctx);
416 *state = test_ctx;
423 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
425 assert_non_null(test_ctx);
427 assert_true(check_leaks_pop(test_ctx) == true);
428 talloc_free(test_ctx);
439 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
445 mock_keytab_with_contents(test_ctx, ONEWAY_KEYTAB_PATH, ONEWAY_TEST_PRINC);
447 test_ctx->subdom->name = discard_const(ONEWAY_DOMNAME);
448 test_ctx->ad_ctx->ad_options = ad_create_1way_trust_options(
449 test_ctx->ad_ctx,
453 test_ctx->subdom,
457 assert_non_null(test_ctx->ad_ctx->ad_options);
459 assert_int_equal(test_ctx->ad_ctx->ad_options->id->schema_type,
462 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->basic,
467 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->basic,
472 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->basic,
477 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->basic,
482 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->id->basic,
486 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->id->basic,
491 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->id->basic,
496 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->id->basic,
501 talloc_free(test_ctx->ad_ctx->ad_options);
507 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
512 mock_keytab_with_contents(test_ctx, KEYTAB_PATH, KEYTAB_TEST_PRINC);
513 test_ctx->subdom->name = discard_const(DOMNAME);
515 test_ctx->ad_ctx->ad_options = ad_create_2way_trust_options(
516 test_ctx->ad_ctx,
521 test_ctx->subdom,
525 assert_non_null(test_ctx->ad_ctx->ad_options);
527 assert_int_equal(test_ctx->ad_ctx->ad_options->id->schema_type,
530 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->basic,
535 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->basic,
540 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->basic,
545 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->id->basic,
549 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->id->basic,
554 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->id->basic,
559 s = dp_opt_get_string(test_ctx->ad_ctx->ad_options->id->basic,
564 talloc_free(test_ctx->ad_ctx->ad_options);
572 struct ad_common_test_ctx *test_ctx;
579 ret = test_ad_common_setup((void **) &test_ctx);
582 mock_keytab_with_contents(test_ctx, KEYTAB_PATH, KEYTAB_TEST_PRINC);
584 ad_ctx = test_ctx->ad_ctx;
586 test_ctx->ad_ctx->ad_options = ad_create_2way_trust_options(
592 test_ctx->subdom,
611 ret = sdap_domain_add(ad_ctx->sdap_id_ctx->opts, test_ctx->dom, &sdom);
615 subdom_ad_ctx = talloc_zero(test_ctx, struct ad_id_ctx);
622 ret = sdap_domain_add(ad_ctx->sdap_id_ctx->opts, test_ctx->subdom, &sdom);
626 test_ctx->subdom_ad_ctx = subdom_ad_ctx;
628 *state = test_ctx;
635 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
637 assert_non_null(test_ctx);
641 talloc_free(test_ctx->subdom_ad_ctx);
642 talloc_free(test_ctx->ad_ctx->ad_options);
643 talloc_free(test_ctx->ad_ctx->gc_ctx);
644 talloc_free(test_ctx->ad_ctx->ldap_ctx);
645 talloc_free(test_ctx->ad_ctx->sdap_id_ctx);
647 test_ad_common_teardown((void **) &test_ctx);
677 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
679 assert_non_null(test_ctx);
681 conn = ad_get_dom_ldap_conn(test_ctx->ad_ctx, test_ctx->dom);
682 assert_true(conn == test_ctx->ad_ctx->ldap_ctx);
684 conn = ad_get_dom_ldap_conn(test_ctx->ad_ctx, test_ctx->subdom);
685 assert_true(conn == test_ctx->subdom_ad_ctx->ldap_ctx);
692 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
694 assert_non_null(test_ctx);
696 assert_true(dp_opt_get_bool(test_ctx->ad_ctx->ad_options->basic,
698 conn_list = ad_gc_conn_list(test_ctx, test_ctx->ad_ctx, test_ctx->dom);
701 assert_true(conn_list[0] == test_ctx->ad_ctx->gc_ctx);
704 assert_true(conn_list[1] == test_ctx->ad_ctx->ldap_ctx);
709 conn_list = ad_gc_conn_list(test_ctx, test_ctx->ad_ctx, test_ctx->subdom);
712 assert_true(conn_list[0] == test_ctx->ad_ctx->gc_ctx);
714 assert_true(conn_list[1] == test_ctx->subdom_ad_ctx->ldap_ctx);
719 dp_opt_set_bool(test_ctx->ad_ctx->ad_options->basic, AD_ENABLE_GC, false);
720 assert_false(dp_opt_get_bool(test_ctx->ad_ctx->ad_options->basic,
723 conn_list = ad_gc_conn_list(test_ctx, test_ctx->ad_ctx, test_ctx->dom);
726 assert_true(conn_list[0] == test_ctx->ad_ctx->ldap_ctx);
731 conn_list = ad_gc_conn_list(test_ctx, test_ctx->ad_ctx, test_ctx->subdom);
734 assert_true(conn_list[0] == test_ctx->subdom_ad_ctx->ldap_ctx);
744 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
746 assert_non_null(test_ctx);
748 conn_list = ad_ldap_conn_list(test_ctx,
749 test_ctx->ad_ctx,
750 test_ctx->dom);
753 assert_true(conn_list[0] == test_ctx->ad_ctx->ldap_ctx);
758 conn_list = ad_ldap_conn_list(test_ctx,
759 test_ctx->ad_ctx,
760 test_ctx->subdom);
763 assert_true(conn_list[0] == test_ctx->subdom_ad_ctx->ldap_ctx);
773 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
775 assert_non_null(test_ctx);
777 conn_list = ad_user_conn_list(test_ctx, test_ctx->ad_ctx,
778 test_ctx->dom);
781 assert_true(conn_list[0] == test_ctx->ad_ctx->ldap_ctx);
786 conn_list = ad_user_conn_list(test_ctx, test_ctx->ad_ctx,
787 test_ctx->subdom);
790 assert_true(conn_list[0] == test_ctx->ad_ctx->gc_ctx);
792 assert_true(conn_list[1] == test_ctx->subdom_ad_ctx->ldap_ctx);
807 struct ad_common_test_ctx *test_ctx = talloc_get_type(*state,
809 assert_non_null(test_ctx);
811 attrs = sysdb_new_attrs(test_ctx);
814 ret = netlogon_get_domain_info(test_ctx, attrs, false, NULL, NULL, NULL);
820 ret = netlogon_get_domain_info(test_ctx, attrs, false, NULL, NULL, NULL);
824 attrs = sysdb_new_attrs(test_ctx);
827 val.data = sss_base64_decode(test_ctx, "FwAAAP0zAABsGcIYI7j2TL97Rd+TvpATAmFkBWRldmVsAMAYCWFkLXNlcnZlcsAYAkFEAAlBRC1TRVJWRVIAABdEZWZhdWx0LUZpcnN0LVNpdGUtTmFtZQDAQAUAAAD/////", &val.length);
833 ret = netlogon_get_domain_info(test_ctx, attrs, false, &flat_name, &site, &forest);
845 attrs = sysdb_new_attrs(test_ctx);
848 val.data = sss_base64_decode(test_ctx, "FwAAAH0zAABsGcIYI7j2TL97Rd+TvpATAmFkBWRldmVsAMAYCWFkLXNlcnZlcsAYAkFEAAlBRC1TRVJWRVIAABdEZWZhdWx0LUZpcnN0LVNpdGUtTmFtZQAABQAAAP////8=", &val.length);
854 ret = netlogon_get_domain_info(test_ctx, attrs, false, &flat_name, &site, &forest);
863 ret = netlogon_get_domain_info(test_ctx, attrs, true, &flat_name, &site, &forest);