Lines Matching refs:test_ctx

251     struct parse_test_ctx *test_ctx;
255 test_ctx = talloc_zero(global_talloc_context, struct parse_test_ctx);
256 assert_non_null(test_ctx);
258 check_leaks_push(test_ctx);
259 *state = test_ctx;
265 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
268 assert_true(check_leaks_pop(test_ctx) == true);
269 talloc_free(test_ctx);
278 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
304 ret = sdap_copy_map(test_ctx, ipa_user_map, SDAP_OPTS_USER, &map);
307 ret = sdap_parse_entry(test_ctx, &test_ctx->sh, &test_ctx->sm,
333 decoded_key = sss_base64_decode(test_ctx,
352 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
369 ret = sdap_parse_entry(test_ctx, &test_ctx->sh, &test_ctx->sm,
395 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
410 ret = sdap_copy_map(test_ctx, rfc2307_user_map, SDAP_OPTS_USER, &map);
413 ret = sdap_parse_entry(test_ctx, &test_ctx->sh, &test_ctx->sm,
430 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
448 ret = sdap_copy_map(test_ctx, rfc2307_user_map, SDAP_OPTS_USER, &map);
460 ret = sdap_parse_entry(test_ctx, &test_ctx->sh, &test_ctx->sm,
482 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
500 ret = sdap_copy_map(test_ctx, rfc2307_user_map, SDAP_OPTS_USER, &minfo.map);
504 dref = mock_deref_res(test_ctx, &test_ipa_user);
507 ret = sdap_parse_deref(test_ctx, &minfo, 1, dref, &res);
528 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
537 ret = sdap_copy_map(test_ctx, rfc2307_user_map, SDAP_OPTS_USER, &minfo.map);
541 dref = mock_deref_res(test_ctx, &test_ipa_user);
544 ret = sdap_parse_deref(test_ctx, &minfo, 1, dref, &res);
555 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
571 ret = sdap_copy_map(test_ctx, rfc2307_group_map, SDAP_OPTS_GROUP, &minfo.map);
575 dref = mock_deref_res(test_ctx, &test_ipa_user);
578 ret = sdap_parse_deref(test_ctx, &minfo, 1, dref, &res);
592 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
609 ret = sdap_copy_map(test_ctx, rfc2307_group_map, SDAP_OPTS_GROUP, &map);
613 ret = sdap_parse_entry(test_ctx, &test_ctx->sh, &test_ctx->sm,
627 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
644 ret = sdap_copy_map(test_ctx, rfc2307_user_map, SDAP_OPTS_USER, &map);
647 ret = sdap_parse_entry(test_ctx, &test_ctx->sh, &test_ctx->sm,
662 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
677 ret = sdap_copy_map(test_ctx, rfc2307_user_map, SDAP_OPTS_USER, &map);
680 ret = sdap_parse_entry(test_ctx, &test_ctx->sh, &test_ctx->sm,
695 struct parse_test_ctx *test_ctx = talloc_get_type_abort(*state,
712 ret = sdap_copy_map(test_ctx, rfc2307_user_map, SDAP_OPTS_USER, &map);
715 ret = sdap_parse_entry(test_ctx, &test_ctx->sh, &test_ctx->sm,
731 struct copy_map_entry_test_ctx *test_ctx;
735 test_ctx = talloc_zero(global_talloc_context,
737 assert_non_null(test_ctx);
739 ret = sdap_copy_map(test_ctx, rfc2307_user_map,
740 SDAP_OPTS_USER, &test_ctx->src_map);
743 ret = sdap_copy_map(test_ctx, rfc2307_user_map,
744 SDAP_OPTS_USER, &test_ctx->dst_map);
747 check_leaks_push(test_ctx);
748 *state = test_ctx;
754 struct copy_map_entry_test_ctx *test_ctx = talloc_get_type_abort(*state,
756 assert_true(check_leaks_pop(test_ctx) == true);
757 talloc_free(test_ctx);
762 static const char *copy_uuid(struct copy_map_entry_test_ctx *test_ctx)
766 assert_null(test_ctx->dst_map[SDAP_AT_USER_UUID].name);
767 ret = sdap_copy_map_entry(test_ctx->src_map, test_ctx->dst_map,
770 return test_ctx->dst_map[SDAP_AT_USER_UUID].name;
775 struct copy_map_entry_test_ctx *test_ctx = talloc_get_type_abort(*state,
780 test_ctx->src_map[SDAP_AT_USER_UUID].name = discard_const(uuid_set_val);
782 uuid_val = copy_uuid(test_ctx);
785 talloc_free(test_ctx->dst_map[SDAP_AT_USER_UUID].name);
790 struct copy_map_entry_test_ctx *test_ctx = talloc_get_type_abort(*state,
794 uuid_val = copy_uuid(test_ctx);
825 struct test_sdap_inherit_ctx *test_ctx;
829 test_ctx = talloc_zero(global_talloc_context,
831 assert_non_null(test_ctx);
833 test_ctx->child_sdap_opts = talloc_zero(test_ctx, struct sdap_options);
835 test_ctx->parent_sdap_opts = mock_sdap_opts(test_ctx);
836 assert_non_null(test_ctx->parent_sdap_opts);
837 test_ctx->child_sdap_opts = mock_sdap_opts(test_ctx);
838 assert_non_null(test_ctx->child_sdap_opts);
840 test_ctx->parent_sdap_opts->user_map[SDAP_AT_USER_PRINC].name = \
843 ret = dp_opt_set_int(test_ctx->parent_sdap_opts->basic,
847 *state = test_ctx;
853 struct test_sdap_inherit_ctx *test_ctx = \
856 talloc_free(test_ctx);
863 struct test_sdap_inherit_ctx *test_ctx = \
867 val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
872 test_ctx->parent_sdap_opts,
873 test_ctx->child_sdap_opts);
875 val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
882 struct test_sdap_inherit_ctx *test_ctx = \
887 val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
893 test_ctx->parent_sdap_opts,
894 test_ctx->child_sdap_opts);
896 val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
903 struct test_sdap_inherit_ctx *test_ctx = \
908 val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
914 test_ctx->parent_sdap_opts,
915 test_ctx->child_sdap_opts);
917 val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
924 struct test_sdap_inherit_ctx *test_ctx = \
929 test_ctx->child_sdap_opts->user_map[SDAP_AT_USER_PRINC].name,
934 test_ctx->parent_sdap_opts,
935 test_ctx->child_sdap_opts);
938 test_ctx->child_sdap_opts->user_map[SDAP_AT_USER_PRINC].name,
941 talloc_free(test_ctx->child_sdap_opts->user_map[SDAP_AT_USER_PRINC].name);
1004 struct copy_dom_obj_test_ctx *test_ctx;
1006 test_ctx = talloc_zero(NULL,
1008 assert_non_null(test_ctx);
1010 test_ctx->opts = talloc_zero(test_ctx, struct sdap_options);
1011 assert_non_null(test_ctx->opts);
1013 test_ctx->parent = named_domain(test_ctx, "win.trust.test", NULL);
1014 assert_non_null(test_ctx->parent);
1016 test_ctx->child = named_domain(test_ctx, "child.win.trust.test",
1017 test_ctx->parent);
1018 assert_non_null(test_ctx->child);
1020 test_ctx->parent_sd = create_sdap_domain(test_ctx->opts,
1021 test_ctx->parent);
1022 assert_non_null(test_ctx->parent_sd);
1024 test_ctx->child_sd = create_sdap_domain(test_ctx->opts,
1025 test_ctx->child);
1026 assert_non_null(test_ctx->child_sd);
1029 test_ctx->ldap_objects = talloc_zero_array(test_ctx,
1031 assert_non_null(test_ctx->ldap_objects);
1033 test_ctx->ldap_objects[0] = test_obj(test_ctx->ldap_objects, "parent",
1034 test_ctx->parent_sd->basedn);
1035 assert_non_null(test_ctx->ldap_objects[0]);
1037 test_ctx->ldap_objects[1] = test_obj(test_ctx->ldap_objects, "child",
1038 test_ctx->child_sd->basedn);
1039 assert_non_null(test_ctx->ldap_objects[1]);
1042 test_ctx->dom_objects = talloc_zero_array(test_ctx,
1044 assert_non_null(test_ctx->dom_objects);
1046 *state = test_ctx;
1052 struct copy_dom_obj_test_ctx *test_ctx = talloc_get_type_abort(*state,
1055 talloc_free(test_ctx);
1061 struct copy_dom_obj_test_ctx *test_ctx = talloc_get_type_abort(*state,
1065 assert_ptr_equal(talloc_parent(test_ctx->ldap_objects[0]),
1066 test_ctx->ldap_objects);
1067 assert_ptr_equal(talloc_parent(test_ctx->ldap_objects[1]),
1068 test_ctx->ldap_objects);
1070 assert_null(test_ctx->dom_objects[0]);
1071 assert_null(test_ctx->dom_objects[1]);
1073 count = sdap_steal_objects_in_dom(test_ctx->opts,
1074 test_ctx->dom_objects,
1076 test_ctx->parent,
1077 test_ctx->ldap_objects,
1081 assert_non_null(test_ctx->dom_objects[0]);
1082 assert_non_null(test_ctx->dom_objects[0] == test_ctx->ldap_objects[0]);
1083 assert_null(test_ctx->dom_objects[1]);
1085 assert_ptr_equal(talloc_parent(test_ctx->ldap_objects[0]),
1086 test_ctx->dom_objects);
1088 count = sdap_steal_objects_in_dom(test_ctx->opts,
1089 test_ctx->dom_objects,
1091 test_ctx->child,
1092 test_ctx->ldap_objects,
1096 assert_non_null(test_ctx->dom_objects[1]);
1097 assert_non_null(test_ctx->dom_objects[1] == test_ctx->ldap_objects[1]);
1098 assert_ptr_equal(talloc_parent(test_ctx->ldap_objects[1]),
1099 test_ctx->dom_objects);
1104 struct copy_dom_obj_test_ctx *test_ctx = talloc_get_type_abort(*state,
1108 count = sdap_steal_objects_in_dom(test_ctx->opts,
1109 test_ctx->dom_objects,
1111 test_ctx->parent,
1112 test_ctx->ldap_objects,
1116 assert_ptr_equal(talloc_parent(test_ctx->ldap_objects[0]),
1117 test_ctx->dom_objects);
1118 assert_ptr_equal(talloc_parent(test_ctx->ldap_objects[1]),
1119 test_ctx->dom_objects);