test_ad_subdomains.c revision 57c5ea8825c7179fd93382dbcbb07e828e5aec19
/*
Authors:
Petr Čech <pcech@redhat.com>
Copyright (C) 2016 Red Hat
SSSD tests: AD subdomain 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 <stdarg.h>
#include <stdlib.h>
#include "tests/cmocka/common_mock.h"
#include "tests/cmocka/common_mock_resp.h"
#include "providers/ad/ad_common.h"
#include "providers/ad/ad_subdomains.c"
#define AD_DOMAIN "ad_domain.domain.test"
#define DOMAIN_1 "one.domain.test"
#define DOMAIN_2 "two.domain.test"
struct test_ad_subdom_ctx {
};
static struct ad_id_ctx *
{
struct ad_options *ad_options;
&ad_options->basic);
return ad_id_ctx;
}
static int test_ad_subdom_setup(void **state)
{
struct test_ad_subdom_ctx *test_ctx;
return 0;
}
static int test_ad_subdom_teardown(void **state)
{
struct test_ad_subdom_ctx *test_ctx;
return 0;
}
static void test_ad_subdom_default(void **state)
{
struct test_ad_subdom_ctx *test_ctx;
const char **ad_enabled_domains = NULL;
}
static void test_ad_subdom_add_one(void **state)
{
struct test_ad_subdom_ctx *test_ctx;
const char **ad_enabled_domains = NULL;
int domain_count = 2;
const char *domains[domain_count];
for (enabled_domains_count = 0;
}
}
static void test_ad_subdom_add_two(void **state)
{
struct test_ad_subdom_ctx *test_ctx;
const char **ad_enabled_domains = NULL;
int domain_count = 3;
const char *domains[domain_count];
for (enabled_domains_count = 0;
}
}
static void test_ad_subdom_add_master(void **state)
{
struct test_ad_subdom_ctx *test_ctx;
const char **ad_enabled_domains = NULL;
int domain_count = 1;
const char *domains[domain_count];
for (enabled_domains_count = 0;
}
}
static void test_ad_subdom_add_two_with_master(void **state)
{
struct test_ad_subdom_ctx *test_ctx;
const char **ad_enabled_domains = NULL;
int domain_count = 3;
const char *domains[domain_count];
for (enabled_domains_count = 0;
}
}
{
int rv;
int opt;
struct poptOption long_options[] = {
};
const struct CMUnitTest tests[] = {
};
/* Set debug level to invalid value so we can decide if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
/* Even though normally the tests should clean up after themselves
* they might not after a failed run. Remove the old DB to be sure */
return rv;
}