Lines Matching refs:test_ctx
49 struct test_ctx {
66 struct test_ctx *test_ctx;
71 test_ctx = talloc_zero(global_talloc_context, struct test_ctx);
72 assert_non_null(test_ctx);
74 check_leaks_push(test_ctx);
76 test_ctx->mem_idmap = talloc_new(test_ctx);
77 assert_non_null(test_ctx->mem_idmap);
79 err = sss_idmap_init(idmap_talloc, test_ctx->mem_idmap, idmap_free,
80 &test_ctx->idmap_ctx);
83 *state = test_ctx;
87 static int setup_ranges(struct test_ctx *test_ctx, bool external_mapping,
95 assert_non_null(test_ctx);
110 err = sss_idmap_add_auto_domain_ex(test_ctx->idmap_ctx, name, sid,
114 err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, name, sid, &range,
123 err = sss_idmap_add_auto_domain_ex(test_ctx->idmap_ctx, name, sid,
127 err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, name, sid, &range,
134 static int setup_ranges_2922(struct test_ctx *test_ctx)
144 assert_non_null(test_ctx);
149 err = sss_idmap_calculate_range(test_ctx->idmap_ctx, sid, &slice_num,
157 err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, name, sid, &range,
166 struct test_ctx *test_ctx;
170 test_ctx = talloc_get_type(*state, struct test_ctx);
171 assert_non_null(test_ctx);
173 setup_ranges(test_ctx, false, false, false);
179 struct test_ctx *test_ctx;
183 test_ctx = talloc_get_type(*state, struct test_ctx);
184 assert_non_null(test_ctx);
186 setup_ranges_2922(test_ctx);
192 struct test_ctx *test_ctx;
196 test_ctx = talloc_get_type(*state, struct test_ctx);
197 assert_non_null(test_ctx);
199 setup_ranges(test_ctx, false, false, true);
205 struct test_ctx *test_ctx;
209 test_ctx = talloc_get_type(*state, struct test_ctx);
210 assert_non_null(test_ctx);
212 setup_ranges(test_ctx, true, false, false);
218 struct test_ctx *test_ctx;
222 test_ctx = talloc_get_type(*state, struct test_ctx);
223 assert_non_null(test_ctx);
225 setup_ranges(test_ctx, false, false, false);
226 setup_ranges(test_ctx, true, true, false);
232 struct test_ctx *test_ctx;
234 test_ctx = talloc_get_type(*state, struct test_ctx);
236 assert_non_null(test_ctx);
238 talloc_free(test_ctx->idmap_ctx);
239 talloc_free(test_ctx->mem_idmap);
240 assert_true(check_leaks_pop(test_ctx) == true);
241 talloc_free(test_ctx);
248 struct test_ctx *test_ctx;
252 test_ctx = talloc_get_type(*state, struct test_ctx);
254 assert_non_null(test_ctx);
259 err = sss_idmap_add_domain(test_ctx->idmap_ctx, TEST_DOM_NAME, TEST_DOM_SID,
263 err = sss_idmap_add_domain(test_ctx->idmap_ctx, TEST_DOM_NAME, TEST_DOM_SID,
267 err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME,
273 err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME,
277 err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME"X",
282 err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME,
287 err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME,
292 err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME,
299 err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME"-nosid",
304 err = sss_idmap_add_domain_ex(test_ctx->idmap_ctx, TEST_DOM_NAME"-nosid",
312 struct test_ctx *test_ctx;
317 test_ctx = talloc_get_type(*state, struct test_ctx);
319 assert_non_null(test_ctx);
321 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"1-1", &id);
324 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
328 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_OFFSET - 1, &sid);
331 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-0", &id);
335 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, id, &sid);
338 sss_idmap_free_sid(test_ctx->idmap_ctx, sid);
340 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx,
345 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, id, &sid);
348 sss_idmap_free_sid(test_ctx->idmap_ctx, sid);
360 struct test_ctx *test_ctx;
365 test_ctx = talloc_get_type(*state, struct test_ctx);
367 assert_non_null(test_ctx);
370 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_2922_MIN_ID, &sid);
373 sss_idmap_free_sid(test_ctx->idmap_ctx, sid);
376 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_2922_FIRST_SID, &id);
381 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_2922_MAX_ID, &sid);
384 sss_idmap_free_sid(test_ctx->idmap_ctx, sid);
387 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_2922_LAST_SID, &id);
392 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_2922_MAX_ID + 1,
397 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx,
405 struct test_ctx *test_ctx;
410 test_ctx = talloc_get_type(*state, struct test_ctx);
412 assert_non_null(test_ctx);
414 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"1-1", &id);
417 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-4000000",
422 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_OFFSET - 1, &sid);
425 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-0", &id);
429 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, id, &sid);
432 sss_idmap_free_sid(test_ctx->idmap_ctx, sid);
434 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx,
439 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, id, &sid);
442 sss_idmap_free_sid(test_ctx->idmap_ctx, sid);
447 struct test_ctx *test_ctx;
452 test_ctx = talloc_get_type(*state, struct test_ctx);
454 assert_non_null(test_ctx);
456 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"1-1", &id);
459 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
463 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_OFFSET - 1, &sid);
466 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-0", &id);
469 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx, TEST_RANGE_MIN, &sid);
472 err = sss_idmap_sid_to_unix(test_ctx->idmap_ctx,
476 err = sss_idmap_unix_to_sid(test_ctx->idmap_ctx,
483 struct test_ctx *test_ctx;
486 test_ctx = talloc_get_type(*state, struct test_ctx);
488 assert_non_null(test_ctx);
490 err = sss_idmap_check_sid_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
494 err = sss_idmap_check_sid_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
498 err = sss_idmap_check_sid_unix(test_ctx->idmap_ctx, TEST_DOM_SID"1-400000",
502 err = sss_idmap_check_sid_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
506 err = sss_idmap_check_sid_unix(test_ctx->idmap_ctx, TEST_DOM_SID"-400000",
513 struct test_ctx *test_ctx;
517 test_ctx = talloc_get_type(*state, struct test_ctx);
519 assert_non_null(test_ctx);
528 err = sss_idmap_domain_has_algorithmic_mapping(test_ctx->idmap_ctx, NULL,
532 err = sss_idmap_domain_has_algorithmic_mapping(test_ctx->idmap_ctx,
537 err = sss_idmap_domain_has_algorithmic_mapping(test_ctx->idmap_ctx,
543 err = sss_idmap_domain_has_algorithmic_mapping(test_ctx->idmap_ctx,
552 struct test_ctx *test_ctx;
556 test_ctx = talloc_get_type(*state, struct test_ctx);
558 assert_non_null(test_ctx);
567 err = sss_idmap_domain_by_name_has_algorithmic_mapping(test_ctx->idmap_ctx, NULL,
571 err = sss_idmap_domain_by_name_has_algorithmic_mapping(test_ctx->idmap_ctx,
576 err = sss_idmap_domain_by_name_has_algorithmic_mapping(test_ctx->idmap_ctx,
582 err = sss_idmap_domain_by_name_has_algorithmic_mapping(test_ctx->idmap_ctx,