summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2015-07-28 10:56:26 +0200
committerAlexander Bokovoy <abokovoy@redhat.com>2015-08-10 09:39:22 +0000
commitfb592697d0be22111994f02c0586ac26012b122e (patch)
tree73a76ac871973294fcf957a35213f9f9bcfa06f8
parent43833ccbca01c8892409586b5e8381de2096ac1b (diff)
downloadfreeipa-fb592697d0be22111994f02c0586ac26012b122e.zip
freeipa-fb592697d0be22111994f02c0586ac26012b122e.tar.gz
freeipa-fb592697d0be22111994f02c0586ac26012b122e.tar.xz
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 ac541ad..9d4e729 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 @@ void 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_db_setup_lib_handle(krb5_ctx);
assert_int_equal(kerr, 0);