From c3cb7e16faf6cf25ef75130b0ff93734a8485b6d 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 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 #include #include +#include #include @@ -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"); -- cgit