summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2016-05-23 18:18:00 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-06-23 13:47:07 +0200
commita257259b05d62ebe548b6c798a3aa03a97dbc0c2 (patch)
treeaf4cc3c4e1e109bcf25b673ce06beb85a2a4536d /src/tests
parentdd285415d7a8d8376207960cfa3e977524c3b98c (diff)
downloadsssd-a257259b05d62ebe548b6c798a3aa03a97dbc0c2.tar.gz
sssd-a257259b05d62ebe548b6c798a3aa03a97dbc0c2.tar.xz
sssd-a257259b05d62ebe548b6c798a3aa03a97dbc0c2.zip
SYSDB: If modifyTimestamp is the same, only update the TS cache
Resolves: https://fedorahosted.org/sssd/ticket/2602 If the entry being saved contains the original modifyTimestamp attribute and the modifyTimestamp attribute is the same as the one we already saved to the timestamp cache, only the expire timestamps in the asynchronous timestamp cache will be bumped and the sysdb code will avoid writes to the main cache completely. If the modifyTimestamp is either missing or differs, we assume the entry had changed and do a full write to the main cache. Also amends the generic sysdb_set_attrs* and similar functions that their results is also reflected in the timestamps cache. Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/cmocka/test_responder_cache_req.c2
-rw-r--r--src/tests/cmocka/test_sysdb_sudo.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/tests/cmocka/test_responder_cache_req.c b/src/tests/cmocka/test_responder_cache_req.c
index f30f1eaad..ba7fbc194 100644
--- a/src/tests/cmocka/test_responder_cache_req.c
+++ b/src/tests/cmocka/test_responder_cache_req.c
@@ -483,6 +483,7 @@ static int test_multi_domain_setup(void **state)
ret = sss_ncache_init(test_ctx, 10, 0, &test_ctx->ncache);
assert_int_equal(ret, EOK);
+ reset_ldb_errstrings(test_ctx->tctx->dom);
check_leaks_push(test_ctx);
return 0;
@@ -497,6 +498,7 @@ static int test_multi_domain_teardown(void **state)
talloc_zfree(test_ctx->result);
talloc_zfree(test_ctx->name);
+ reset_ldb_errstrings(test_ctx->tctx->dom);
assert_true(check_leaks_pop(test_ctx));
talloc_zfree(test_ctx);
test_multidom_suite_cleanup(TESTS_PATH, TEST_CONF_DB, domains);
diff --git a/src/tests/cmocka/test_sysdb_sudo.c b/src/tests/cmocka/test_sysdb_sudo.c
index 97f80d7e5..aebad88eb 100644
--- a/src/tests/cmocka/test_sysdb_sudo.c
+++ b/src/tests/cmocka/test_sysdb_sudo.c
@@ -155,6 +155,7 @@ static int test_sysdb_teardown(void **state)
test_dom_suite_cleanup(TESTS_PATH, TEST_CONF_DB, TEST_DOM_NAME);
+ reset_ldb_errstrings(test_ctx->tctx->dom);
assert_true(check_leaks_pop(test_ctx));
talloc_zfree(test_ctx);
assert_true(leak_check_teardown());