Lines Matching refs:test_ctx
74 struct fqdn_test_ctx *test_ctx;
78 test_ctx = talloc_zero(global_talloc_context, struct fqdn_test_ctx);
79 assert_non_null(test_ctx);
81 test_ctx->dom = create_test_domain(test_ctx, DOMNAME, FLATNAME,
84 check_leaks_push(test_ctx);
85 *state = test_ctx;
91 struct fqdn_test_ctx *test_ctx = talloc_get_type(*state,
94 if (test_ctx == NULL) {
99 assert_true(check_leaks_pop(test_ctx) == true);
100 talloc_free(test_ctx);
107 struct fqdn_test_ctx *test_ctx = talloc_get_type(*state,
115 if (test_ctx == NULL) {
120 ret = sss_names_init_from_args(test_ctx,
122 "%1$s@%2$s", &test_ctx->nctx);
125 fqdn = sss_tc_fqname(test_ctx, test_ctx->nctx, test_ctx->dom, NAME);
130 ret = sss_fqname(fqdn_s, fqdn_size, test_ctx->nctx, test_ctx->dom, NAME);
134 talloc_free(test_ctx->nctx);
139 struct fqdn_test_ctx *test_ctx = talloc_get_type(*state,
147 if (test_ctx == NULL) {
152 ret = sss_names_init_from_args(test_ctx,
154 "%1$s@%2$s@%3$s", &test_ctx->nctx);
157 fqdn = sss_tc_fqname(test_ctx, test_ctx->nctx, test_ctx->dom, NAME);
162 ret = sss_fqname(fqdn_s, fqdn_size, test_ctx->nctx, test_ctx->dom, NAME);
166 talloc_free(test_ctx->nctx);
171 struct fqdn_test_ctx *test_ctx = talloc_get_type(*state,
179 if (test_ctx == NULL) {
184 ret = sss_names_init_from_args(test_ctx,
186 "%1$s@%3$s", &test_ctx->nctx);
189 fqdn = sss_tc_fqname(test_ctx, test_ctx->nctx, test_ctx->dom, NAME);
194 ret = sss_fqname(fqdn_s, fqdn_size, test_ctx->nctx, test_ctx->dom, NAME);
198 talloc_free(test_ctx->nctx);
203 struct fqdn_test_ctx *test_ctx = talloc_get_type(*state,
211 if (test_ctx == NULL) {
216 ret = sss_names_init_from_args(test_ctx,
218 "%1$s@%3$s", &test_ctx->nctx);
221 test_ctx->dom->flat_name = NULL;
226 fqdn = sss_tc_fqname(test_ctx, test_ctx->nctx, test_ctx->dom, NAME);
231 ret = sss_fqname(fqdn_s, fqdn_size, test_ctx->nctx, test_ctx->dom, NAME);
235 talloc_free(test_ctx->nctx);
244 void parse_name_check(struct parse_name_test_ctx *test_ctx,
255 check_leaks_push(test_ctx);
256 ret = sss_parse_name_for_domains(test_ctx, test_ctx->dom, default_domain,
272 assert_true(check_leaks_pop(test_ctx) == true);
277 struct parse_name_test_ctx *test_ctx;
283 test_ctx = talloc_zero(global_talloc_context, struct parse_name_test_ctx);
284 assert_non_null(test_ctx);
287 ret = sss_names_init_from_args(test_ctx,
291 "%1$s@%2$s", &test_ctx->nctx);
297 dom = create_test_domain(test_ctx, DOMNAME, FLATNAME,
298 NULL, test_ctx->nctx);
300 DLIST_ADD_END(test_ctx->dom, dom, struct sss_domain_info *);
302 dom = create_test_domain(test_ctx, DOMNAME2,
303 FLATNAME2, NULL, test_ctx->nctx);
305 DLIST_ADD_END(test_ctx->dom, dom, struct sss_domain_info *);
311 test_ctx->subdom = new_subdomain(dom, dom, SUBDOMNAME, NULL, SUBFLATNAME,
313 assert_non_null(test_ctx->subdom);
315 check_leaks_push(test_ctx);
316 *state = test_ctx;
322 struct parse_name_test_ctx *test_ctx = talloc_get_type(*state,
325 assert_true(check_leaks_pop(test_ctx) == true);
326 talloc_free(test_ctx);
331 void sss_parse_name_check(struct parse_name_test_ctx *test_ctx,
341 check_leaks_push(test_ctx);
342 ret = sss_parse_name(test_ctx, test_ctx->nctx, input_name,
359 assert_true(check_leaks_pop(test_ctx) == true);
364 struct parse_name_test_ctx *test_ctx = talloc_get_type(*state,
368 parse_name_check(test_ctx, NAME, NULL, EOK, NAME, NULL);
370 ret = sss_parse_name(test_ctx, test_ctx->nctx, NAME,
374 sss_parse_name_check(test_ctx, NAME, EOK, NAME, NULL);
375 sss_parse_name_check(test_ctx, SPECIALNAME, EOK, SPECIALNAME, NULL);
380 struct parse_name_test_ctx *test_ctx = talloc_get_type(*state,
382 parse_name_check(test_ctx, NAME"@"DOMNAME, NULL, EOK, NAME, DOMNAME);
383 parse_name_check(test_ctx, NAME"@"DOMNAME2, NULL, EOK, NAME, DOMNAME2);
385 sss_parse_name_check(test_ctx, NAME"@"DOMNAME, EOK, NAME, DOMNAME);
386 sss_parse_name_check(test_ctx, NAME"@"DOMNAME2, EOK, NAME, DOMNAME2);
387 sss_parse_name_check(test_ctx, DOMNAME"\\"NAME, EOK, NAME, DOMNAME);
388 sss_parse_name_check(test_ctx, DOMNAME2"\\"NAME, EOK, NAME, DOMNAME2);
393 struct parse_name_test_ctx *test_ctx = talloc_get_type(*state,
396 parse_name_check(test_ctx, NAME"@"SUBDOMNAME, NULL, EAGAIN, NULL, NULL);
399 test_ctx->dom->subdomains = test_ctx->subdom;
400 parse_name_check(test_ctx, NAME"@"SUBDOMNAME, NULL, EOK, NAME, SUBDOMNAME);
405 struct parse_name_test_ctx *test_ctx = talloc_get_type(*state,
409 parse_name_check(test_ctx, FLATNAME"\\"NAME, NULL, EOK, NAME, DOMNAME);
410 parse_name_check(test_ctx, FLATNAME2"\\"NAME, NULL, EOK, NAME, DOMNAME2);
413 parse_name_check(test_ctx, SUBFLATNAME"\\"NAME, NULL, EAGAIN, NULL, NULL);
414 test_ctx->dom->subdomains = test_ctx->subdom;
415 parse_name_check(test_ctx, SUBFLATNAME"\\"NAME, NULL, EOK, NAME, SUBDOMNAME);
420 struct parse_name_test_ctx *test_ctx = talloc_get_type(*state,
424 parse_name_check(test_ctx, NAME, DOMNAME2, EOK, NAME, DOMNAME2);
425 dom2 = test_ctx->dom->next;
428 DLIST_REMOVE(test_ctx->dom, dom2);
429 parse_name_check(test_ctx, NAME, DOMNAME2, EAGAIN, NULL, NULL);
434 struct fqdn_test_ctx *test_ctx = talloc_get_type(*state,
438 if (test_ctx == NULL) {
443 ret = sss_names_init_from_args(test_ctx,
445 "%2$s@%3$s", &test_ctx->nctx);
452 struct parse_name_test_ctx *test_ctx = talloc_get_type(*state,
455 sss_parse_name_check(test_ctx, "", ERR_REGEX_NOMATCH, NULL, NULL);
456 sss_parse_name_check(test_ctx, "@", ERR_REGEX_NOMATCH, NULL, NULL);
457 sss_parse_name_check(test_ctx, "\\", ERR_REGEX_NOMATCH, NULL, NULL);
458 sss_parse_name_check(test_ctx, "\\"NAME, ERR_REGEX_NOMATCH, NULL, NULL);
459 sss_parse_name_check(test_ctx, "@"NAME, ERR_REGEX_NOMATCH, NULL, NULL);
460 sss_parse_name_check(test_ctx, NAME"@", ERR_REGEX_NOMATCH, NULL, NULL);
461 sss_parse_name_check(test_ctx, NAME"\\", ERR_REGEX_NOMATCH, NULL, NULL);