summaryrefslogtreecommitdiffstats
path: root/src/tests/cmocka
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-06-23 17:50:45 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-07-01 11:43:14 +0200
commit919cfb623e9b725eaa654c6e1b513d1305057314 (patch)
tree95d4280d3c37cd758029d8e695470581bfe53efb /src/tests/cmocka
parent0f495aa73529b06b0a8b4c39cfd098351c4f6760 (diff)
downloadsssd-919cfb623e9b725eaa654c6e1b513d1305057314.tar.gz
sssd-919cfb623e9b725eaa654c6e1b513d1305057314.tar.xz
sssd-919cfb623e9b725eaa654c6e1b513d1305057314.zip
TESTS: Add confdb domain base DN to sss_test_ctx
Creation of the path to the domain's confdb entry was duplicated in the tests. Rather than adding yet another duplication, I added the path as another field of the sss_test_ctx structure. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/tests/cmocka')
-rw-r--r--src/tests/cmocka/test_dp_opts.c6
-rw-r--r--src/tests/cmocka/test_dyndns.c5
2 files changed, 2 insertions, 9 deletions
diff --git a/src/tests/cmocka/test_dp_opts.c b/src/tests/cmocka/test_dp_opts.c
index f3029940d..31dde47c7 100644
--- a/src/tests/cmocka/test_dp_opts.c
+++ b/src/tests/cmocka/test_dp_opts.c
@@ -210,7 +210,6 @@ void opt_test_get(void **state)
int ret;
struct sss_test_ctx *tctx;
struct dp_option *opts;
- char *dompath;
struct sss_test_conf_param params[] = {
{ "string_nodefault", "stringval2" },
{ "blob_nodefault", "blobval2" },
@@ -227,10 +226,7 @@ void opt_test_get(void **state)
TEST_DOM_NAME, TEST_ID_PROVIDER, params);
assert_non_null(tctx);
- dompath = talloc_asprintf(tctx, "config/domain/%s", TEST_DOM_NAME);
- assert_non_null(dompath);
-
- ret = dp_get_options(global_talloc_context, tctx->confdb, dompath,
+ ret = dp_get_options(global_talloc_context, tctx->confdb, tctx->conf_dom_path,
test_def_opts, OPT_NUM_OPTS, &opts);
assert_int_equal(ret, EOK);
diff --git a/src/tests/cmocka/test_dyndns.c b/src/tests/cmocka/test_dyndns.c
index dcf6eede3..db90e661c 100644
--- a/src/tests/cmocka/test_dyndns.c
+++ b/src/tests/cmocka/test_dyndns.c
@@ -369,10 +369,7 @@ void dyndns_test_setup(void **state)
dyndns_test_ctx->be_ctx->cdb = dyndns_test_ctx->tctx->confdb;
dyndns_test_ctx->be_ctx->ev = dyndns_test_ctx->tctx->ev;
- dyndns_test_ctx->be_ctx->conf_path = talloc_asprintf(dyndns_test_ctx,
- CONFDB_DOMAIN_PATH_TMPL,
- TEST_DOM_NAME);
- assert_non_null(dyndns_test_ctx->be_ctx->conf_path);
+ dyndns_test_ctx->be_ctx->conf_path = dyndns_test_ctx->tctx->conf_dom_path;
}
void dyndns_test_teardown(void **state)