test_sysdb_views.c revision 8eb981dd8bc85aee7a913c6f0096ad47f3382339
/*
SSSD
sysdb_views - Tests for view and override related sysdb calls
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2014 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 <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <popt.h>
#include "tests/cmocka/common_mock.h"
#define TESTS_PATH "tests_sysdb_views"
#define TEST_CONF_FILE "tests_conf.ldb"
struct sysdb_test_ctx {
struct confdb_ctx *confdb;
struct tevent_context *ev;
struct sss_domain_info *domain;
};
{
struct sysdb_test_ctx *test_ctx;
char *conf_db;
int ret;
const char *val[2];
/* Create tests directory if it doesn't exist */
/* (relative to current dir) */
/* Create an event context
* It will not be used except in confdb_init and sysdb_init
*/
/* Connect to the conf db */
val[0] = "LOCAL";
val[0] = "local";
val[0] = "TRUE";
return EOK;
}
static void test_sysdb_setup(void **state)
{
int ret;
struct sysdb_test_ctx *test_ctx;
}
static void test_sysdb_teardown(void **state)
{
struct sysdb_test_ctx);
}
void test_sysdb_add_overrides_to_object(void **state)
{
int ret;
struct ldb_message *orig;
struct ldb_message *override;
struct ldb_message_element *el;
char *tmp_str;
struct sysdb_test_ctx);
"ORIGNAME");
"ORIGGECOS");
NULL),
"OVERRIDENAME");
NULL),
"OVERRIDEGECOS");
}
void test_split_ipa_anchor(void **state)
{
int ret;
char *dom;
char *uuid;
struct sysdb_test_ctx);
}
{
int rv;
int no_cleanup = 0;
int opt;
struct poptOption long_options[] = {
_("Do not delete the test database after a test run"), NULL },
};
};
/* Set debug level to invalid value so we can deside if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
if (rv == 0 && no_cleanup == 0) {
}
return rv;
}