ipa_ldap_opt-tests.c revision 6dd4421e76c46f46d0699471703e7dc221d05db5
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki/*
d8a47f7a3f857a43664484552cf83bf170e4629dnd SSSD
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki
d8a47f7a3f857a43664484552cf83bf170e4629dnd Tests if IPA and LDAP backend options are in sync
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Authors:
6fbd2e53c97ea6976d93e0ac521adabc55e0fb73nd Jakub Hrozek <jhrozek@redhat.com>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Copyright (C) 2010 Red Hat
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd This program is free software; you can redistribute it and/or modify
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd it under the terms of the GNU General Public License as published by
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd the Free Software Foundation; either version 3 of the License, or
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd (at your option) any later version.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd This program is distributed in the hope that it will be useful,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd but WITHOUT ANY WARRANTY; without even the implied warranty of
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd GNU General Public License for more details.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd You should have received a copy of the GNU General Public License
7db9f691a00ead175b03335457ca296a33ddf31bnd along with this program. If not, see <http://www.gnu.org/licenses/>.
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki*/
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki#include <check.h>
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki#include <stdlib.h>
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki#include "providers/ipa/ipa_common.h"
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki#include "providers/ldap/sdap.h"
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki#include "providers/krb5/krb5_common.h"
07ab565873bfd241828a89261b1260c448a0799eyoshiki#include "tests/common.h"
07ab565873bfd241828a89261b1260c448a0799eyoshiki
07ab565873bfd241828a89261b1260c448a0799eyoshikiSTART_TEST(test_check_num_opts)
07ab565873bfd241828a89261b1260c448a0799eyoshiki{
938c687542a2f620cc7e781ddba4f3911dc1320dyoshiki fail_if(IPA_OPTS_BASIC_TEST != SDAP_OPTS_BASIC);
fail_if(IPA_KRB5_OPTS_TEST != KRB5_OPTS);
}
END_TEST
Suite *ipa_ldap_opt_suite (void)
{
Suite *s = suite_create ("ipa_ldap_opt");
TCase *tc_ipa_ldap_opt = tcase_create ("ipa_ldap_opt");
tcase_add_test (tc_ipa_ldap_opt, test_check_num_opts);
suite_add_tcase (s, tc_ipa_ldap_opt);
return s;
}
int main(void)
{
int number_failed;
tests_set_cwd();
Suite *s = ipa_ldap_opt_suite ();
SRunner *sr = srunner_create (s);
/* If CK_VERBOSITY is set, use that, otherwise it defaults to CK_NORMAL */
srunner_run_all(sr, CK_ENV);
number_failed = srunner_ntests_failed (sr);
srunner_free (sr);
return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}