sysdb-tests.c revision 7c974e792beef952ceb19a01775c6d0ee71a1253
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder System Database
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder Copyright (C) Stephen Gallagher <sgallagh@redhat.com> 2009
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder This program is free software; you can redistribute it and/or modify
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder it under the terms of the GNU General Public License as published by
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder the Free Software Foundation; either version 3 of the License, or
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder (at your option) any later version.
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder This program is distributed in the hope that it will be useful,
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder but WITHOUT ANY WARRANTY; without even the implied warranty of
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder GNU General Public License for more details.
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder You should have received a copy of the GNU General Public License
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder along with this program. If not, see <http://www.gnu.org/licenses/>.
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder#define TEST_ATTR_UPDATE_VALUE "test_attr_update_value"
struct sysdb_test_ctx {
char *conf_db;
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 *autofsmapname;
const char *shell;
bool finished;
int error;
const char **attrlist;
char **memberlist;
char *homedir;
char *gecos;
int ret;
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;
int ret;
char *member;
if (!attrs) {
return ENOMEM;
if (!member) {
return ENOMEM;
return ret;
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;
char *membername;
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;
if (_i == 0) {
int ret;
if (_i == 0) {
char *ghostname;
int ret;
char *ghostname_del;
char *ghostname_add;
int ret;
char *ghostname_rep;
char *ghostname_del;
char *ghostname_check;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
int ret;
char *ghostname;
int ret;
int ret, j;
char *expected;
int ret;
int ret;
if (exp_gh < 0) {
exp_gh = 0;
if (exp_gh) {
char *ghostname_del;
char *ghostname_add;
int ret;
char *ghostname_del;
char *ghostname_add;
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 *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);
#ifdef BUILD_AUTOFS
const char *autofsmapname;
const char *autofsmapname;
const char *autofsmapname;
const char *autofsmapname;
const char *autofsmapname;
const char *autofskey;
const char *autofsval;
int ii;
const char *autofsmapname;
const char *autofsmapname;
const char *autofskey;
const char *autofsval;
const char *autofskey;
NULL };
const char *filter;
#ifdef BUILD_AUTOFS
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;