summaryrefslogtreecommitdiffstats
path: root/src/tests/krb5_utils-tests.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2015-07-30 16:52:42 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-08-05 14:09:42 +0200
commit7bb9ba8688ec1ca930d693eea05e936bc38f6d1b (patch)
tree06f866863c997d95c5ed66208fc281919520ba8a /src/tests/krb5_utils-tests.c
parent089db891b8a7a94b5666e8cffb1d7b359d6aeb6e (diff)
downloadsssd-7bb9ba8688ec1ca930d693eea05e936bc38f6d1b.tar.gz
sssd-7bb9ba8688ec1ca930d693eea05e936bc38f6d1b.tar.xz
sssd-7bb9ba8688ec1ca930d693eea05e936bc38f6d1b.zip
krb5 utils: add sss_krb5_realm_has_proxy()
Reviewed-by: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/tests/krb5_utils-tests.c')
-rw-r--r--src/tests/krb5_utils-tests.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tests/krb5_utils-tests.c b/src/tests/krb5_utils-tests.c
index 650ed4859..9a25b09cd 100644
--- a/src/tests/krb5_utils-tests.c
+++ b/src/tests/krb5_utils-tests.c
@@ -684,6 +684,22 @@ START_TEST(test_parse_krb5_map_user)
}
END_TEST
+START_TEST(test_sss_krb5_realm_has_proxy)
+{
+ krb5_error_code kerr;
+ long perr;
+
+ fail_unless(sss_krb5_realm_has_proxy(NULL) == false);
+
+ setenv("KRB5_CONFIG", "/dev/null", 1);
+ fail_unless(sss_krb5_realm_has_proxy("REALM") == false);
+
+ setenv("KRB5_CONFIG", ABS_SRC_DIR"/src/tests/krb5_proxy_check_test_data.conf", 1);
+ fail_unless(sss_krb5_realm_has_proxy("REALM") == false);
+ fail_unless(sss_krb5_realm_has_proxy("REALM_PROXY") == true);
+}
+END_TEST
+
Suite *krb5_utils_suite (void)
{
Suite *s = suite_create ("krb5_utils");
@@ -723,6 +739,7 @@ Suite *krb5_utils_suite (void)
TCase *tc_krb5_helpers = tcase_create("Helper functions");
tcase_add_test(tc_krb5_helpers, test_compare_principal_realm);
tcase_add_test(tc_krb5_helpers, test_parse_krb5_map_user);
+ tcase_add_test(tc_krb5_helpers, test_sss_krb5_realm_has_proxy);
suite_add_tcase(s, tc_krb5_helpers);
return s;