Lines Matching defs:test_ctx

62     struct subdom_test_ctx *test_ctx;
69 test_ctx = talloc_zero(global_talloc_context,
71 assert_non_null(test_ctx);
75 test_ctx->tctx = create_multidom_test_ctx(test_ctx, TESTS_PATH,
78 assert_non_null(test_ctx->tctx);
80 *state = test_ctx;
86 struct subdom_test_ctx *test_ctx =
90 talloc_free(test_ctx);
98 struct subdom_test_ctx *test_ctx =
104 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
109 ret = sysdb_update_subdomains(test_ctx->tctx->dom);
112 assert_non_null(test_ctx->tctx->dom->subdomains);
113 assert_string_equal(test_ctx->tctx->dom->subdomains->name, dom1[0]);
114 assert_int_equal(test_ctx->tctx->dom->subdomains->trust_direction, 0);
116 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
121 ret = sysdb_update_subdomains(test_ctx->tctx->dom);
124 assert_non_null(test_ctx->tctx->dom->subdomains->next);
125 assert_string_equal(test_ctx->tctx->dom->subdomains->next->name, dom2[0]);
126 assert_int_equal(test_ctx->tctx->dom->subdomains->next->trust_direction, 1);
129 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
134 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
139 ret = sysdb_update_subdomains(test_ctx->tctx->dom);
142 assert_int_equal(test_ctx->tctx->dom->subdomains->trust_direction, 1);
143 assert_int_equal(test_ctx->tctx->dom->subdomains->next->trust_direction, 0);
145 ret = sysdb_subdomain_delete(test_ctx->tctx->sysdb, dom2[0]);
148 ret = sysdb_subdomain_delete(test_ctx->tctx->sysdb, dom1[0]);
151 ret = sysdb_update_subdomains(test_ctx->tctx->dom);
154 assert_int_equal(sss_domain_get_state(test_ctx->tctx->dom->subdomains),
157 sss_domain_get_state(test_ctx->tctx->dom->subdomains->next),
164 struct subdom_test_ctx *test_ctx =
167 ret = sysdb_master_domain_add_info(test_ctx->tctx->dom,
172 ret = sysdb_master_domain_update(test_ctx->tctx->dom);
175 assert_string_equal(test_ctx->tctx->dom->realm, "realm1");
176 assert_string_equal(test_ctx->tctx->dom->flat_name, "flat1");
177 assert_string_equal(test_ctx->tctx->dom->domain_id, "id1");
178 assert_string_equal(test_ctx->tctx->dom->forest, "forest1");
180 ret = sysdb_master_domain_add_info(test_ctx->tctx->dom,
185 ret = sysdb_master_domain_update(test_ctx->tctx->dom);
188 assert_string_equal(test_ctx->tctx->dom->realm, "realm2");
189 assert_string_equal(test_ctx->tctx->dom->flat_name, "flat2");
190 assert_string_equal(test_ctx->tctx->dom->domain_id, "id2");
191 assert_string_equal(test_ctx->tctx->dom->forest, "forest2");
200 struct subdom_test_ctx *test_ctx =
216 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
221 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
228 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
234 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
241 ret = sysdb_update_subdomains(test_ctx->tctx->dom);
245 ret = sysdb_update_subdomains(test_ctx->tctx->dom->next);
248 sub = find_domain_by_name(test_ctx->tctx->dom, dom1[0], true);
252 child = find_domain_by_name(test_ctx->tctx->dom, child_dom1[0], true);
256 sub = find_domain_by_name(test_ctx->tctx->dom, dom2[0], true);
260 child = find_domain_by_name(test_ctx->tctx->dom, child_dom2[0], true);
264 main_dom = find_domain_by_name(test_ctx->tctx->dom, TEST_DOM1_NAME, true);
269 main_dom = find_domain_by_name(test_ctx->tctx->dom, TEST_DOM2_NAME, true);
281 struct subdom_test_ctx *test_ctx =
299 ret = sysdb_master_domain_add_info(test_ctx->tctx->dom,
307 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
314 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
321 ret = sysdb_update_subdomains(test_ctx->tctx->dom);
325 ret = sysdb_update_subdomains(test_ctx->tctx->dom->next);
328 assert_non_null(test_ctx->tctx->dom->forest_root);
329 assert_true(test_ctx->tctx->dom->forest_root == test_ctx->tctx->dom);
330 assert_string_equal(test_ctx->tctx->dom->name, TEST_DOM1_NAME);
332 child = find_domain_by_name(test_ctx->tctx->dom, child_dom[0], true);
334 assert_ptr_equal(child->forest_root, test_ctx->tctx->dom);
336 sub = find_domain_by_name(test_ctx->tctx->dom, sub_dom[0], true);
338 assert_ptr_equal(sub->forest_root, test_ctx->tctx->dom);
341 main_dom = find_domain_by_name(test_ctx->tctx->dom, TEST_DOM2_NAME, true);
352 struct subdom_test_ctx *test_ctx =
358 const char *const forest_root[5] = { test_ctx->tctx->dom->name, /* name */
376 ret = sysdb_master_domain_add_info(test_ctx->tctx->dom,
384 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
391 ret = sysdb_subdomain_store(test_ctx->tctx->sysdb,
398 ret = sysdb_master_domain_update(test_ctx->tctx->dom);
401 ret = sysdb_update_subdomains(test_ctx->tctx->dom);
405 ret = sysdb_master_domain_update(test_ctx->tctx->dom->next);
408 ret = sysdb_update_subdomains(test_ctx->tctx->dom->next);
412 root = find_domain_by_name(test_ctx->tctx->dom, forest_root[0], true);
416 assert_non_null(test_ctx->tctx->dom->forest_root);
417 assert_true(test_ctx->tctx->dom->forest_root == root);
419 sub = find_domain_by_name(test_ctx->tctx->dom, sub_dom[0], true);
424 main_dom = find_domain_by_name(test_ctx->tctx->dom, TEST_DOM2_NAME, true);
437 struct subdom_test_ctx *test_ctx =
457 main_dom1 = find_domain_by_name(test_ctx->tctx->dom, TEST_DOM1_NAME, true);
458 main_dom2 = find_domain_by_name(test_ctx->tctx->dom, TEST_DOM2_NAME, true);
501 main_dom1 = find_domain_by_name(test_ctx->tctx->dom, TEST_DOM1_NAME, true);
506 main_dom2 = find_domain_by_name(test_ctx->tctx->dom, TEST_DOM2_NAME, true);
511 root = find_domain_by_name(test_ctx->tctx->dom, dom2_forest_root[0], true);
526 struct subdom_test_ctx *test_ctx =
529 dom = find_domain_by_name(test_ctx->tctx->dom,
533 ret = domain_to_basedn(test_ctx, dom->name, &dom_basedn);
536 usr_attrs[0] = sysdb_new_attrs(test_ctx);
553 usr_attrs[1] = sysdb_new_attrs(test_ctx);
560 usr_attrs[2] = sysdb_new_attrs(test_ctx);
576 usr_attrs[2] = sysdb_new_attrs(test_ctx);
603 usr_attrs[2] = sysdb_new_attrs(test_ctx);