From 51e6f026f7b8bcd6c429b10044abacc4f2393305 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Wed, 28 Mar 2012 13:04:44 -0400 Subject: Remove old compatibility tests These are now replaced by the more accurate tests. This patch also drops the runtime option-count check, since we are always performing the more complete check at build-time. --- src/providers/ipa/ipa_common.c | 16 ---------------- src/providers/ipa/ipa_common.h | 15 --------------- src/tests/ipa_ldap_opt-tests.c | 12 +----------- 3 files changed, 1 insertion(+), 42 deletions(-) (limited to 'src') diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c index 3ba666e2..5d2f7987 100644 --- a/src/providers/ipa/ipa_common.c +++ b/src/providers/ipa/ipa_common.c @@ -176,14 +176,6 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, int ret; int i; - /* self check test, this should never fail, unless someone forgot - * to properly update the code after new ldap options have been added */ - if (SDAP_OPTS_BASIC != IPA_OPTS_BASIC_TEST) { - DEBUG(0, ("Option numbers do not match (%d != %d)\n", - SDAP_OPTS_BASIC, IPA_OPTS_BASIC_TEST)); - abort(); - } - tmpctx = talloc_new(ipa_opts); if (!tmpctx) { return ENOMEM; @@ -586,14 +578,6 @@ int ipa_get_auth_options(struct ipa_options *ipa_opts, char *copy = NULL; int ret; - /* self check test, this should never fail, unless someone forgot - * to properly update the code after new ldap options have been added */ - if (KRB5_OPTS != IPA_KRB5_OPTS_TEST) { - DEBUG(0, ("Option numbers do not match (%d != %d)\n", - KRB5_OPTS, IPA_KRB5_OPTS_TEST)); - abort(); - } - ipa_opts->auth = talloc_zero(ipa_opts, struct dp_option); if (ipa_opts->auth == NULL) { ret = ENOMEM; diff --git a/src/providers/ipa/ipa_common.h b/src/providers/ipa/ipa_common.h index 26a6f9d9..d29cf92d 100644 --- a/src/providers/ipa/ipa_common.h +++ b/src/providers/ipa/ipa_common.h @@ -32,21 +32,6 @@ struct ipa_service { struct krb5_service *krb5_service; }; -/* the following defines are used to keep track of the options in the ldap - * module, so that if they change and ipa is not updated correspondingly - * this will trigger a runtime abort error */ -#define IPA_OPTS_BASIC_TEST 61 - -#define IPA_OPTS_SVC_TEST 5 - -#define IPA_OPTS_AUTOMNTMAP_TEST 2 -#define IPA_OPTS_AUTOMNTENTRY_TEST 3 - -/* the following define is used to keep track of the options in the krb5 - * module, so that if they change and ipa is not updated correspondingly - * this will trigger a runtime abort error */ -#define IPA_KRB5_OPTS_TEST 15 - enum ipa_basic_opt { IPA_DOMAIN = 0, IPA_SERVER, diff --git a/src/tests/ipa_ldap_opt-tests.c b/src/tests/ipa_ldap_opt-tests.c index 3f94d681..4c881379 100644 --- a/src/tests/ipa_ldap_opt-tests.c +++ b/src/tests/ipa_ldap_opt-tests.c @@ -30,6 +30,7 @@ #include "providers/ipa/ipa_opts.h" #include "providers/ldap/sdap.h" #include "providers/ldap/ldap_opts.h" +#include "providers/krb5/krb5_opts.h" #include "providers/krb5/krb5_common.h" #include "tests/common.h" @@ -76,16 +77,6 @@ START_TEST(test_domain_to_basedn) } END_TEST -START_TEST(test_check_num_opts) -{ - fail_if(IPA_OPTS_BASIC_TEST != SDAP_OPTS_BASIC); - fail_if(IPA_OPTS_SVC_TEST != SDAP_OPTS_SERVICES); - fail_if(IPA_OPTS_AUTOMNTMAP_TEST != SDAP_OPTS_AUTOFS_MAP); - fail_if(IPA_OPTS_AUTOMNTENTRY_TEST != SDAP_OPTS_AUTOFS_ENTRY); - fail_if(IPA_KRB5_OPTS_TEST != KRB5_OPTS); -} -END_TEST - START_TEST(test_compare_opts) { errno_t ret; @@ -143,7 +134,6 @@ Suite *ipa_ldap_opt_suite (void) TCase *tc_ipa_ldap_opt = tcase_create ("ipa_ldap_opt"); - tcase_add_test (tc_ipa_ldap_opt, test_check_num_opts); tcase_add_test (tc_ipa_ldap_opt, test_compare_opts); tcase_add_test (tc_ipa_ldap_opt, test_compare_sdap_attrs); suite_add_tcase (s, tc_ipa_ldap_opt); -- cgit