sysdb-tests.c revision 84bb9ec1bba8e60d1d87febd48749edd18e16787
fccb930434fc0c61658be2289dab263535109803William King System Database
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence Copyright (C) Stephen Gallagher <sgallagh@redhat.com> 2009
15a44745412679c30a6d022733925af70a38b715David Lawrence This program is free software; you can redistribute it and/or modify
15a44745412679c30a6d022733925af70a38b715David Lawrence it under the terms of the GNU General Public License as published by
15a44745412679c30a6d022733925af70a38b715David Lawrence the Free Software Foundation; either version 3 of the License, or
15a44745412679c30a6d022733925af70a38b715David Lawrence (at your option) any later version.
15a44745412679c30a6d022733925af70a38b715David Lawrence This program is distributed in the hope that it will be useful,
15a44745412679c30a6d022733925af70a38b715David Lawrence but WITHOUT ANY WARRANTY; without even the implied warranty of
15a44745412679c30a6d022733925af70a38b715David Lawrence MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews GNU General Public License for more details.
fccb930434fc0c61658be2289dab263535109803William King You should have received a copy of the GNU General Public License
fccb930434fc0c61658be2289dab263535109803William King along with this program. If not, see <http://www.gnu.org/licenses/>.
fccb930434fc0c61658be2289dab263535109803William King#define TEST_ATTR_UPDATE_VALUE "test_attr_update_value"
8a0ba20b16177d40bd557b491f56003c7d38a4a2David Lawrence#define TEST_ATTR_ADD_VALUE "test_attr_add_value"
8a0ba20b16177d40bd557b491f56003c7d38a4a2David Lawrence#define CUSTOM_TEST_CONTAINER "custom_test_container"
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 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);
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]);
char **add_groups;
char **del_groups;
(const char *const *)add_groups,
(const char *const *)del_groups);
NULL,
(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;
&res);
const char *netgrname;
const char *hostname;
const char *username;
const char *domainname;
&res);
const char *netgrname;
const char *membername;
char *hostname1;
char *username1;
char *domainname1;
char *hostname2;
char *username2;
char *domainname2;
&res);
const char *netgrname;
const char *membername;
char *hostname;
char *username;
char *domainname;
&res);
const char *received_user;
const char *received_group;
bool enumerated;
&enumerated);
&enumerated);
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;