Cross Reference: /sssd-io/src/tests/cmocka/test_sysdb_ts_cache.c

Lines Matching refs:res

198     struct ldb_result *res = NULL;
200 ret = sysdb_getgrnam(mem_ctx, domain, name, &res);
202 assert_non_null(res);
204 return res;
212 struct ldb_result *res = NULL;
214 ret = sysdb_getpwnam(mem_ctx, domain, name, &res);
216 assert_non_null(res);
218 return res;
226 struct ldb_result *res;
232 ret = ldb_search(test_ctx->tctx->sysdb->ldb, test_ctx, &res,
234 if (ret != EOK || res == NULL || res->count != 1) {
235 talloc_free(res);
239 cache_expire_sysdb = ldb_msg_find_attr_as_uint64(res->msgs[0],
242 talloc_free(res);
361 struct ldb_result *res = NULL;
368 res = sysdb_getgrnam_res(test_ctx, test_ctx->tctx->dom, TEST_GROUP_NAME);
369 assert_int_equal(res->count, 0);
370 talloc_free(res);
504 struct ldb_result *res = NULL;
514 res = sysdb_getgrnam_res(test_ctx, test_ctx->tctx->dom, TEST_GROUP_NAME);
515 assert_int_equal(res->count, 0);
516 talloc_free(res);
563 res = sysdb_getgrnam_res(test_ctx, test_ctx->tctx->dom, TEST_GROUP_NAME);
564 assert_int_equal(res->count, 0);
565 talloc_free(res);
580 struct ldb_result *res = NULL;
590 res = sysdb_getgrnam_res(test_ctx, test_ctx->tctx->dom, TEST_GROUP_NAME);
591 assert_int_equal(res->count, 0);
592 talloc_free(res);
593 res = sysdb_getgrnam_res(test_ctx, test_ctx->tctx->dom,
595 assert_int_equal(res->count, 0);
596 talloc_free(res);
645 res = sysdb_getgrnam_res(test_ctx, test_ctx->tctx->dom,
647 assert_int_equal(res->count, 0);
648 talloc_free(res);
672 static void assert_ts_attrs_res(struct ldb_result *res,
676 return assert_ts_attrs_msg(res->msgs[0], exp_expiration, exp_last_update);
684 struct ldb_result res;
686 res.count = msgs_count;
687 res.msgs = msgs;
688 return assert_ts_attrs_res(&res, exp_expiration, exp_last_update);
699 struct ldb_result *res = NULL;
728 ret = sysdb_getgrnam(test_ctx, test_ctx->tctx->dom, TEST_GROUP_NAME, &res);
730 assert_int_equal(res->count, 1);
731 assert_ts_attrs_res(res, TEST_NOW_2 + TEST_CACHE_TIMEOUT, TEST_NOW_2);
732 talloc_free(res);
734 ret = sysdb_getgrgid(test_ctx, test_ctx->tctx->dom, TEST_GROUP_GID, &res);
736 assert_int_equal(res->count, 1);
737 assert_ts_attrs_res(res, TEST_NOW_2 + TEST_CACHE_TIMEOUT, TEST_NOW_2);
738 talloc_free(res);
759 ret = sysdb_getgrnam(test_ctx, test_ctx->tctx->dom, TEST_GROUP_NAME, &res);
761 assert_int_equal(res->count, 1);
762 assert_ts_attrs_res(res, TEST_NOW_3 + TEST_CACHE_TIMEOUT, TEST_NOW_3);
763 talloc_free(res);
788 struct ldb_result *res;
846 res = sss_merge_ldb_results(res1, res2);
847 assert_non_null(res);
848 assert_int_equal(res->count, 3);
861 struct ldb_result *res;
872 &res);
896 &res);
898 assert_int_equal(res->count, 1);
899 assert_ts_attrs_res(res, TEST_NOW_2 + TEST_CACHE_TIMEOUT, TEST_NOW_2);
900 talloc_free(res);
919 &res);
935 struct ldb_result *res = NULL;
941 res = sysdb_getpwnam_res(test_ctx, test_ctx->tctx->dom, TEST_USER_NAME);
942 assert_int_equal(res->count, 0);
943 talloc_free(res);
1024 struct ldb_result *res = NULL;
1034 res = sysdb_getpwnam_res(test_ctx, test_ctx->tctx->dom, TEST_USER_NAME);
1035 assert_int_equal(res->count, 0);
1036 talloc_free(res);
1079 res = sysdb_getpwnam_res(test_ctx, test_ctx->tctx->dom, TEST_USER_NAME);
1080 assert_int_equal(res->count, 0);
1081 talloc_free(res);
1106 struct ldb_result *res = NULL;
1135 ret = sysdb_getpwnam(test_ctx, test_ctx->tctx->dom, TEST_USER_NAME, &res);
1137 assert_int_equal(res->count, 1);
1138 assert_ts_attrs_res(res, TEST_NOW_2 + TEST_CACHE_TIMEOUT, TEST_NOW_2);
1139 talloc_free(res);
1142 ret = sysdb_getpwuid(test_ctx, test_ctx->tctx->dom, TEST_USER_UID, &res);
1144 assert_int_equal(res->count, 1);
1145 assert_ts_attrs_res(res, TEST_NOW_2 + TEST_CACHE_TIMEOUT, TEST_NOW_2);
1146 talloc_free(res);
1169 ret = sysdb_getpwnam(test_ctx, test_ctx->tctx->dom, TEST_USER_NAME, &res);
1171 assert_int_equal(res->count, 1);
1172 assert_ts_attrs_res(res, TEST_NOW_3 + TEST_CACHE_TIMEOUT, TEST_NOW_3);
1173 talloc_free(res);
1175 ret = sysdb_initgroups(test_ctx, test_ctx->tctx->dom, TEST_USER_NAME, &res);
1177 assert_int_equal(res->count, 1);
1178 assert_ts_attrs_res(res, TEST_NOW_3 + TEST_CACHE_TIMEOUT, TEST_NOW_3);
1179 talloc_free(res);
1182 TEST_USER_NAME, pw_fetch_attrs, &res);
1184 assert_int_equal(res->count, 1);
1185 assert_ts_attrs_res(res, TEST_NOW_3 + TEST_CACHE_TIMEOUT, TEST_NOW_3);
1186 talloc_free(res);
1211 struct ldb_result *res;
1222 &res);
1244 &res);
1246 assert_int_equal(res->count, 1);
1247 assert_ts_attrs_res(res, TEST_NOW_2 + TEST_CACHE_TIMEOUT, TEST_NOW_2);
1248 talloc_free(res);
1267 &res);
1285 struct ldb_result *res;
1306 ret = sysdb_getpwupn(test_ctx, test_ctx->tctx->dom, false, TEST_USER_UPN, &res);
1308 assert_int_equal(res->count, 1);
1309 assert_ts_attrs_res(res, TEST_NOW_2 + TEST_CACHE_TIMEOUT, TEST_NOW_2);
1310 talloc_free(res);
1314 &res);
1316 assert_int_equal(res->count, 1);
1317 assert_ts_attrs_res(res, TEST_NOW_2 + TEST_CACHE_TIMEOUT, TEST_NOW_2);
1318 talloc_free(res);
1327 TEST_USER_UPN, &res);
1329 assert_int_equal(res->count, 1);
1330 assert_ts_attrs_res(res, TEST_NOW_2 + TEST_CACHE_TIMEOUT, TEST_NOW_2);
1331 talloc_free(res);
1339 struct ldb_result *res = NULL;
1345 res = sysdb_getpwnam_res(test_ctx, test_ctx->tctx->dom, TEST_USER_NAME);
1346 assert_int_equal(res->count, 0);
1347 talloc_free(res);
1349 res = sysdb_getgrnam_res(test_ctx, test_ctx->tctx->dom, TEST_GROUP_NAME);
1350 assert_int_equal(res->count, 0);
1351 talloc_free(res);