summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2015-07-28 10:56:26 +0200
committerSumit Bose <sbose@redhat.com>2016-07-06 16:41:09 +0200
commitc3cb7e16faf6cf25ef75130b0ff93734a8485b6d (patch)
treed4f99354bb4c90454a9d4d86e4fcd30ed2a73c05
parent7e3a0ebfec05a5eef7455ef7219cdda507568a23 (diff)
downloadfreeipa-c3cb7e16faf6cf25ef75130b0ff93734a8485b6d.tar.gz
freeipa-c3cb7e16faf6cf25ef75130b0ff93734a8485b6d.tar.xz
freeipa-c3cb7e16faf6cf25ef75130b0ff93734a8485b6d.zip
IPA KDB: use empty profile to init krb5 context in tests
If the systems /etc/krb5.conf contains some unexpected or broken configuration the test might fail. With this patch the tests are run with an empty configuration.
-rw-r--r--daemons/ipa-kdb/tests/ipa_kdb_tests.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/daemons/ipa-kdb/tests/ipa_kdb_tests.c b/daemons/ipa-kdb/tests/ipa_kdb_tests.c
index 3bd6e64f2..1220d889e 100644
--- a/daemons/ipa-kdb/tests/ipa_kdb_tests.c
+++ b/daemons/ipa-kdb/tests/ipa_kdb_tests.c
@@ -27,6 +27,7 @@
#include <stdint.h>
#include <setjmp.h>
#include <cmocka.h>
+#include <profile.h>
#include <talloc.h>
@@ -79,8 +80,13 @@ static int setup(void **state)
krb5_error_code kerr;
struct ipadb_context *ipa_ctx;
struct test_ctx *test_ctx;
+ struct _profile_t *profile;
+ long perr;
- kerr = krb5_init_context(&krb5_ctx);
+ perr = profile_init(NULL, &profile);
+ assert_int_equal(perr, 0);
+
+ kerr = krb5_init_context_profile(profile, 0, &krb5_ctx);
assert_int_equal(kerr, 0);
kerr = krb5_set_default_realm(krb5_ctx, "EXAMPLE.COM");