sysdb-tests.c revision b58460076fe843c11d736ae244c1ac979a6473a4
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi System Database
285bfe946c2d54928b272270dd5eef9041b24271Timo Sirainen Copyright (C) Stephen Gallagher <sgallagh@redhat.com> 2009
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi This program is free software; you can redistribute it and/or modify
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi it under the terms of the GNU General Public License as published by
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi the Free Software Foundation; either version 3 of the License, or
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi (at your option) any later version.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi This program is distributed in the hope that it will be useful,
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi but WITHOUT ANY WARRANTY; without even the implied warranty of
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi GNU General Public License for more details.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi You should have received a copy of the GNU General Public License
1b3579352544e7920fd497328b29fb3e06a85768Timo Sirainen along with this program. If not, see <http://www.gnu.org/licenses/>.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi#define TEST_ATTR_UPDATE_VALUE "test_attr_update_value"
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi#define CUSTOM_TEST_CONTAINER "custom_test_container"
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomistatic int setup_sysdb_tests(struct sysdb_test_ctx **ctx)
int ret;
return EFAULT;
return ENOMEM;
return EIO;
return ENOMEM;
return ret;
return ret;
return ret;
return ret;
return ret;
return ret;
return EOK;
struct test_data {
const char *username;
const char *groupname;
const char *netgrname;
const char *shell;
bool finished;
int error;
const char **attrlist;
char *homedir;
char *gecos;
int ret;
NULL, 0, 0);
return ret;
char *homedir;
char *gecos;
int ret;
return ret;
int ret;
return ret;
int ret;
return ret;
int ret;
return ret;
int ret;
return ret;
int ret;
return ret;
int ret;
return ret;
int ret;
return ret;
int ret;
return ret;
int ret;
return ret;
int ret;
return ret;
const char *username;
int ret;
return ENOMEM;
return ret;
const char *username;
int ret;
return ENOMEM;
return ret;
char *object_name;
int ret;
if (!object_name) {
return ENOMEM;
return ret;
int ret;
return ret;
int ret;
return ENOMEM;
return ret;
int ret;
if (!dn) {
return ENOMEM;
return ret;
int ret;
char *member;
if (!attrs) {
return ENOMEM;
if (!member) {
return ENOMEM;
return ret;
return ret;
const char *description;
int ret;
return ret;
int ret;
return ret;
int ret;
return ret;
int ret;
const char *description;
if (!attrs) {
return ENOMEM;
if (ret) {
return ret;
return ret;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
const char *username;
int ret;
if (ret) {
goto done;
goto done;
if (ret) {
goto done;
done:
const char *groupname;
int ret;
if (ret) {
goto done;
goto done;
if (ret) {
goto done;
done:
const char *e_groupname;
const char *groupname;
int ret;
if (ret) {
goto done;
goto done;
done:
const char *e_username;
const char *username;
int ret;
if (ret) {
goto done;
goto done;
done:
int ret;
&res);
int ret;
&res);
int ret;
const char *attrval;
char *username;
int ret;
if (ret) {
goto done;
done:
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
char *object_name;
int ret;
int ret;
char *object_name;
int ret;
int ret;
int ret;
const char *password,
int expected_result)
int ret;
0, expire_date);
const char *password,
int expected_result)
int ret;
char *username;
char *username;
char *username;
int ret;
int ret;
char *gid_str;
for (i = 0; i < msgs_count; i++) {
int ret;
char *uid_str;
int ret;
int ret;
int ret;
if (_i == 0) {
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
char **list;
list[0]);
const char *name;
goto done;
goto done;
done:
const char *name;
goto done;
goto done;
done:
char **add_groups;
char **del_groups;
(const char *const *)add_groups,
(const char *const *)del_groups);
int ret;
const char *groupname;
char *parsed;
int ret;
int ret;
const char *netgrname;
int ret;
int ret;
int ret;
int ret;
const char *description;
const char *netgrname;
const char *attrval;
const char *netgrname;
const char *hostname;
const char *username;
const char *domainname;
const char *netgrname;
const char *hostname;
const char *username;
const char *domainname;
const char *netgrname;
const char *membername;
char *hostname1;
char *username1;
char *domainname1;
char *hostname2;
char *username2;
char *domainname2;
const char *netgrname;
const char *membername;
char *hostname;
char *username;
char *domainname;
const char *received_user;
const char *received_group;
bool by_name,
const char *primary_name,
int port,
const char **aliases,
const char **protocols)
bool matched;
const char *ret_name;
int ret_port;
if (by_name) {
matched = false;
for (j = 0; aliases[j]; j++) {
matched = true;
matched = false;
for (j = 0; protocols[j]; j++) {
matched = true;
const char *primary_name,
int port,
const char **aliases,
const char **protocols,
char *primary_name;
const char **aliases;
const char **protocols;
NULL);
const char **aliases;
const char **protocols;
const char *alias);
const char **aliases;
const char **protocols;
NULL);
bool enumerated;
&enumerated);
const char *filter;
"name=subdomuser,cn=users,cn=test.sub,cn=sysdb");
"name=subdomuser,cn=users,cn=test.sub,cn=sysdb");
&msg);
"name=subdomgroup,cn=groups,cn=test.sub,cn=sysdb");
&msg);
int opt;
int ret;
int failure_count;
int no_cleanup = 0;
switch(opt) {
return EXIT_FAILURE;
return EXIT_FAILURE;
return EXIT_FAILURE;
return EXIT_SUCCESS;
return EXIT_FAILURE;