test_data_provider_be.c revision cc2d77d5218c188119fa954c856e858cbde76947
/*
Copyright (C) 2015 Red Hat
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 <time.h>
#include "tests/cmocka/common_mock.h"
#include "tests/cmocka/common_mock_be.h"
#define TESTS_PATH "tests_dp_be"
#define TEST_CONF_DB "test_dp_be_conf.ldb"
#define TEST_DOM_NAME "dp_be_test"
#define TEST_ID_PROVIDER "ldap"
#define OFFLINE_TIMEOUT 2
static bool global_timer_added;
struct timeval next_event,
void *private_data,
const char *handler_name,
const char *location);
struct timeval next_event,
void *private_data,
const char *handler_name,
const char *location)
{
global_timer_added = true;
location);
}
struct test_ctx {
struct sss_test_ctx *tctx;
};
static int test_setup(void **state)
{
struct sss_test_conf_param params[] = {
};
"subdomains",
return 0;
}
static int test_teardown(void **state)
{
return 0;
}
{
enum sss_domain_state dom_state;
}
struct tevent_timer *te,
struct timeval current_time,
void *pvt)
{
}
static void test_mark_dom_offline(void **state)
{
}
static void test_mark_subdom_offline(void **state)
{
global_timer_added = false;
/* A timer must be added that resets the state back */
/* Global offline state must not change */
/* Make sure we don't add a second timer */
global_timer_added = false;
/* Wait for the internal timer to reset our subdomain back */
test_ctx);
return;
}
}
static void test_mark_subdom_offline_disabled(void **state)
{
}
{
int opt;
int rv;
int no_cleanup = 0;
struct poptOption long_options[] = {
_("Do not delete the test database after a test run"), NULL },
};
const struct CMUnitTest tests[] = {
};
/* Set debug level to invalid value so we can deside 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 */
if (rv == 0 && !no_cleanup) {
}
return rv;
}