From fb592697d0be22111994f02c0586ac26012b122e Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Tue, 28 Jul 2015 10:56:26 +0200 Subject: 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. --- daemons/ipa-kdb/tests/ipa_kdb_tests.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/daemons/ipa-kdb/tests/ipa_kdb_tests.c b/daemons/ipa-kdb/tests/ipa_kdb_tests.c index ac541ad91..9d4e729c8 100644 --- a/daemons/ipa-kdb/tests/ipa_kdb_tests.c +++ b/daemons/ipa-kdb/tests/ipa_kdb_tests.c @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -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); -- cgit