test_ad_common.c revision 933314e53fac878d1a9b126af216454172cb945a
/*
Authors:
Jakub Hrozek <jhrozek@redhat.com>
Copyright (C) 2013 Red Hat
SSSD tests: AD access control filter tests
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <talloc.h>
#include <tevent.h>
#include <errno.h>
#include <popt.h>
#include <unistd.h>
#include <ifaddrs.h>
/* In order to access opaque types */
#include "providers/ad/ad_common.c"
#include "tests/cmocka/common_mock.h"
#include "tests/cmocka/common_mock_krb5.h"
#define DOMNAME "domname"
static bool call_real_sasl_options;
{
}
struct ad_common_test_ctx {
struct ad_id_ctx *subdom_ad_ctx;
struct sss_domain_info *dom;
struct sss_domain_info *subdom;
};
static void test_ad_create_default_options(void **state)
{
struct ad_options *ad_options;
const char *s;
/* Not too much to test here except some defaults */
assert_null(s);
}
static int test_ad_common_setup(void **state)
{
struct ad_common_test_ctx *test_ctx;
return 0;
}
static int test_ad_common_teardown(void **state)
{
struct ad_common_test_ctx);
return 0;
}
static void test_ad_create_2way_trust_options(void **state)
{
struct ad_common_test_ctx);
const char *s;
call_real_sasl_options = true;
assert_non_null(s);
assert_non_null(s);
assert_null(s); /* This is the system keytab */
assert_non_null(s);
assert_non_null(s);
assert_non_null(s);
}
static int
test_ldap_conn_setup(void **state)
{
struct ad_common_test_ctx *test_ctx;
struct sdap_domain *sdom;
struct ad_id_ctx *subdom_ad_ctx;
struct sdap_id_conn_ctx *subdom_ldap_ctx;
struct sdap_options);
return 0;
}
static int
test_ldap_conn_teardown(void **state)
{
struct ad_common_test_ctx);
test_ad_common_teardown((void **) &test_ctx);
return 0;
}
char *default_primary,
char *default_realm,
const char *keytab_path);
char *default_primary,
char *default_realm,
const char *keytab_path)
{
/* Pretend SASL is fine */
if (call_real_sasl_options == true) {
return __real_sdap_set_sasl_options(id_opts,
}
return EOK;
}
void test_ldap_conn_list(void **state)
{
struct sdap_id_conn_ctx *conn;
struct ad_common_test_ctx);
}
void test_conn_list(void **state)
{
struct sdap_id_conn_ctx **conn_list;
struct ad_common_test_ctx);
AD_ENABLE_GC));
/* If there is a fallback, we should ignore the offline mode */
AD_ENABLE_GC));
}
{
int opt;
struct poptOption long_options[] = {
};
const struct CMUnitTest tests[] = {
};
/* Set debug level to invalid value so we can deside if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
}