sysdb_ssh-tests.c revision 6b57784f0f175275fd900eca21c77415e3a5ea52
/*
Authors:
Michal Zidek <mzidek@redhat.com>
Stephen Gallagher <sgallagh@redhat.com>
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 <stdlib.h>
#include <check.h>
#include <popt.h>
#include <talloc.h>
#include "config.h"
#include "confdb/confdb_setup.h"
#include "db/sysdb_services.h"
#include "db/sysdb_ssh.h"
#define TESTS_PATH "tests_sysdb_ssh"
#define TEST_CONF_FILE "tests_conf.ldb"
#define TEST_HOSTNAME "testhost"
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) */
return EFAULT;
}
fail("Could not allocate memory for test context");
return ENOMEM;
}
/* Create an event context
* It will not be used except in confdb_init and sysdb_init
*/
fail("Could not create event context");
return EIO;
}
fail("Out of memory, aborting!");
return ENOMEM;
}
/* Connect to the conf db */
fail("Could not initialize connection to the confdb");
return ret;
}
val[0] = "LOCAL";
fail("Could not initialize domains placeholder");
return ret;
}
val[0] = "local";
fail("Could not initialize provider");
return ret;
}
val[0] = "TRUE";
fail("Could not initialize LOCAL domain");
return ret;
}
val[0] = "TRUE";
fail("Could not initialize LOCAL domain");
return ret;
}
return ret;
}
return EOK;
}
static void clean_up(void)
{
int ret = 0;
if (ret != 0) {
}
}
struct test_data {
struct tevent_context *ev;
struct sysdb_test_ctx *ctx;
const char *hostname;
const char *alias;
struct ldb_message *host;
struct sysdb_attrs *attrs;
};
{
int ret;
now,
return ret;
}
{
int ret;
return ret;
}
{
int ret;
return ret;
}
{
struct sysdb_test_ctx *test_ctx;
int ret;
fail("Could not set up the test");
return;
}
fail("Out of memory!");
return;
}
fail("Out of memory!");
return;
}
fail("Out of memory!");
return;
}
}
{
struct sysdb_test_ctx *test_ctx;
int ret;
fail("Could not set up the test");
return;
}
fail("Out of memory!");
return;
}
fail("Out of memory!");
return;
}
}
{
struct sysdb_test_ctx *test_ctx;
int ret;
fail("Could not set up the test");
return;
}
fail("Out of memory!");
return;
}
fail("Out of memory!");
return;
}
}
{
struct sysdb_test_ctx *test_ctx;
int ret;
fail("Could not set up test");
return;
}
fail("Out of memory!");
return;
}
fail("Out of memory!");
return;
}
fail("Out of memory!");
return;
}
return;
}
}
Suite *create_sysdb_ssh_suite(void)
{
return s;
}
{
int failcount;
int opt;
Suite* s;
struct poptOption long_options[] = {
};
/* Set debug level to invalid value so we can deside if -d 0 was used. */
return 1;
}
if (!ldb_modules_path_is_set()) {
"will use LDB plugins installed in system paths.\n");
}
s = create_sysdb_ssh_suite();
sr = srunner_create(s);
clean_up();
if (failcount != 0) {
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}