summaryrefslogtreecommitdiffstats
path: root/src/tests/sysdb-tests.c
Commit message (Collapse)AuthorAgeFilesLines
* sysdb: add sysdb_search_object_by_uuid()Sumit Bose2014-11-201-0/+51
| | | | | | Related to https://fedorahosted.org/sssd/ticket/2481 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SYSDB: sysdb_idmap_get_mappings returns ENOENTPavel Reichl2014-11-191-0/+6
| | | | | | | | | sysdb_idmap_get_mappings returns ENOENT if no results were found. Part od solution for: https://fedorahosted.org/sssd/ticket/1991 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* sysdb: add sysdb_attrs_add_val_safe() and sysdb_attrs_add_string_safe()Sumit Bose2014-10-161-0/+103
| | | | | | | | | | | | sysdb_attrs_add_val_safe() works like sysdb_attrs_add_val() but checks if the attribute value to add already exists. In this case the value list is not changed. This is useful if values are added from different sources at different times to avoid LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS errors from ldb_modify() later on. sysdb_attrs_add_string_safe() does the same for string arguments Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* tests: add test for sysdb_get_user_attr with subdomain userPavel Březina2014-10-091-0/+54
| | | | Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* SYSDB: move sysdb_get_real_name() from sysdb.c to sysdb_search.cJakub Hrozek2014-10-061-0/+49
| | | | | | | | | | | The sysdb.c should be reserved for utility and setup functions. Search functions belong to sysdb_search.c Keeping functions in specialized modules helps to maintain nice dependencies and in overall makes unit testing easier. Moreover, the function was not unit tested, which needed fixing. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* tests: Add a test for storing custom attrs with automatic IDJakub Hrozek2014-09-181-0/+51
| | | | Reviewed-by: Daniel Gollub <dgollub@brocade.com>
* TESTS: Add a case-insensitive group search sysdb testJakub Hrozek2014-09-171-8/+25
| | | | | | | A recent fix enabled searching for groups by name in a case-insensitive domain. This patch adds a unit test to check that behaviour. Reviewed-by: Sumit Bose <sbose@redhat.com>
* SYSDB: SSS_LDB_SEARCH - macro around ldb_searchPavel Reichl2014-09-051-19/+19
| | | | | | | | | | | | | This patch amends previous patch 5153e8b9793dea1e212ca08af0f77ea1d023cbb7. Macro SSS_LDB_SEARCH is used instead of using fuction sss_ldb_search as a wrapper around ldb_search which could lead to premature expansion of variadic parameters. Part of solution for: https://fedorahosted.org/sssd/ticket/1991 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TESTS: Add unit tests for the GPO interfaceJakub Hrozek2014-09-011-0/+100
| | | | Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TOOLS: Always debug to stderrJakub Hrozek2014-07-091-1/+1
| | | | | | | | | https://fedorahosted.org/sssd/ticket/2348 Programs that are supposed to only be executed on the foreground should log to stderr automatically. Reviewed-by: Michal Židek <mzidek@redhat.com>
* TESTS: sysdb_getnetgr - return ENOENTPavel Reichl2014-06-251-0/+6
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/1991 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TESTS: add tests for sss_ldb_searchPavel Reichl2014-06-251-0/+97
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/1991 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sysdb: add sysdb_search_user_by_upn() with testsSumit Bose2014-06-201-0/+231
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TESTS: sysdb_search_return_ENOENT - check mem leaksPavel Reichl2014-06-201-0/+2
| | | | Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
* TEST: simple_access & sysdb tests - cleanupPavel Reichl2014-05-281-7/+1
| | | | | | Before running tests do cleanup. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TEST: unused variablePavel Reichl2014-05-281-3/+0
| | | | | | Remove unused variable causing warning. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* tests: Add test for confdb_list_all_domain_namesJakub Hrozek2014-05-281-0/+149
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* TEST: Test empty results from functions sysdb_search_*Lukas Slebodnik2014-05-271-0/+136
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SYSDB: return SYSDB_NAME from sysdb_initgroupsJakub Hrozek2014-05-141-0/+5
| | | | | | | | For the GetGroupsList function it would be handy to get the user names as well with a single sysdb_initgroups() call. This patch adds SYSDB_NAME to the default attribute list. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* Update DEBUG* invocations to use new levelsNikolai Kondrashov2014-02-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a script to update DEBUG* macro invocations, which use literal numbers for levels, to use bitmask macros instead: grep -rl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e 'use strict; use File::Slurp; my @map=qw" SSSDBG_FATAL_FAILURE SSSDBG_CRIT_FAILURE SSSDBG_OP_FAILURE SSSDBG_MINOR_FAILURE SSSDBG_CONF_SETTINGS SSSDBG_FUNC_DATA SSSDBG_TRACE_FUNC SSSDBG_TRACE_LIBS SSSDBG_TRACE_INTERNAL SSSDBG_TRACE_ALL "; my $text=read_file(\*STDIN); my $repl; $text=~s/ ^ ( .* \b (DEBUG|DEBUG_PAM_DATA|DEBUG_GR_MEM) \s* \(\s* )( [0-9] )( \s*, ) ( \s* ) ( .* ) $ / $repl = $1.$map[$3].$4.$5.$6, length($repl) <= 80 ? $repl : $1.$map[$3].$4."\n".(" " x length($1)).$6 /xmge; print $text; ' < "$f.orig" > "$f" rm "$f.orig" done Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Make DEBUG macro invocations variadicNikolai Kondrashov2014-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Use a script to update DEBUG macro invocations to use it as a variadic macro, supplying format string and its arguments directly, instead of wrapping them in parens. This script was used to update the code: grep -rwl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e \ 'use strict; use File::Slurp; my $text=read_file(\*STDIN); $text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs; print $text;' < "$f.orig" > "$f" rm "$f.orig" done Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* DB: Add sss_ldb_el_to_string_listJakub Hrozek2014-01-291-0/+49
|
* Add sysdb_attrs_add_lc_name_aliasSumit Bose2013-12-191-0/+29
|
* SYSDB: Sanitize filter before removing ghost attrsLukas Slebodnik2013-11-281-0/+17
| | | | | | | | | | | sysdb_add_user fails with EIO if enumeration is disabled and user contains backslashes. We try to remove ghost attributes from groups with disabled enumeration, but unsanitized filter is used to find ghost attributes "(|(ghost=usr\\\\002)" and ldb cannot parse this filter. Resolves: https://fedorahosted.org/sssd/ticket/2163
* SYSDB: Sanitize filter before sysdb_search_groupsLukas Slebodnik2013-11-281-0/+4
| | | | | | | | | | sysdb_delete_user fails with EIO if user does not exist and contains backslashes. ldb could not parse filter (&(objectclass=group)(ghost=usr\\\\001)), because ghost value was not sanitized Resolves: https://fedorahosted.org/sssd/ticket/2163
* SYSDB: Drop redundant sysdb_ctx parameter from sysdb.cMichal Zidek2013-11-151-17/+11
|
* SYSDB: Drop the sysdb_ctx parameter - module sysdb_ops (part 2)Michal Zidek2013-11-151-77/+61
|
* SYSDB: Drop the sysdb_ctx parameter - module sysdb_ops (part 1)Michal Zidek2013-11-151-103/+56
|
* SYSDB: Drop the sysdb_ctx parameter from the sysdb_services moduleMichal Zidek2013-11-151-14/+11
|
* SYSDB: Drop the sysdb_ctx parameter from the sysdb_search moduleMichal Zidek2013-11-151-36/+16
|
* SYSDB: Drop the sysdb_ctx parameter from the autofs APIJakub Hrozek2013-11-151-10/+7
|
* SYSDB: Add sysdb_delete_by_sidJakub Hrozek2013-10-251-0/+12
|
* IPA: store forest name for forest member domainsSumit Bose2013-09-271-8/+8
| | | | | In order to fix https://fedorahosted.org/sssd/ticket/2093 the name of the forest must be known for a member domain of the forest.
* sysdb: sysdb_update_members can take either name or dnPavel Březina2013-09-261-3/+3
| | | | | | | | | We need to work with distinguish names when processing cross-domain membership, because groups and users may be stored in different sysdb tree. Resolves: https://fedorahosted.org/sssd/ticket/2066
* DB: Add user/group lookup by SIDOndrej Kos2013-09-101-19/+32
|
* Read enumerate state for subdomains from cacheJakub Hrozek2013-08-281-3/+3
| | | | | The enumerate flag will be read from the cache for subdomains and the domain object will be created accordingly.
* SYSDB: Store enumerate flag for subdomainJakub Hrozek2013-08-281-5/+7
|
* sysdb_add_incomplete_group: store SID string is availableSumit Bose2013-08-191-4/+45
| | | | | | During initgroups request we read the SID of a group from the server but do not save it to the cache. This patch fixes this and might help to avoid an additional lookup of the SID later.
* DB: sysdb_search_user_by_name: search by both name and aliasJakub Hrozek2013-07-091-4/+19
|
* Read mpg state for subdomains from cacheSumit Bose2013-06-281-3/+6
| | | | | The mpg flag will be read from the cache for subdomains and the domain object will be created accordingly.
* Save mpg state for subdomainsSumit Bose2013-06-281-5/+8
| | | | | | The information of a subdomain will use magic private groups (mpg) or not will be stored together with other information about the domain in the cache.
* Remove empty directories after tests run.Lukas Slebodnik2013-05-301-15/+2
| | | | | Empty directory tests_path is removed in function test_dom_suite_cleanup. Function test_dom_suite_cleanup is reused in other tests.
* Only try to relink ghost users if we're not enumeratingJakub Hrozek2013-04-291-4/+8
| | | | | | | | https://fedorahosted.org/sssd/ticket/1893 When SSSD is not enumerating (which is the default), we are trying to link any "ghost" entries with a newly created user entry. However, when enumeration is on, this means a spurious search on adding any user.
* Fixing duplicate constLukas Slebodnik2013-03-211-3/+3
| | | | const char const * --> const char *const
* tests: Print warning if LDB_MODULES_PATH is not setMichal Zidek2013-03-201-0/+5
| | | | | | | Print warning if sysdb-tests or sysdb-ssh test are run individually and LDB_MODULES_PATH was not set. https://fedorahosted.org/sssd/ticket/1820
* Use SSSD specific errors for offline authSimo Sorce2013-03-041-4/+8
| | | | | | This prevents reportin false errors when internal functions return a generic EINVAL or EACCES that should just be treated as internal errors.
* Change the way domains are linked.Simo Sorce2013-02-101-60/+27
| | | | | | | | | | | | | | | | | | | - Use a double-linked list for domains and subdomains. - Never remove a subdomain, simply mark it as disabled if it becomes unused. - Rework the way subdomains are refreshed. Now sysdb_update_subdomains() actually updates the current subdomains and marks as disabled the ones not found in the sysdb or add new ones found. It never removes them. Removal of missing domains from sysdb is deferred to the providers, which will perform it at refresh time, for the ipa provider that is done by ipa_subdomains_write_mappings() now. sysdb_update_subdomains() is then used to update the memory hierarchy of the subdomains. - Removes sysdb_get_subdomains() - Removes copy_subdomain() - Add sysdb_subdomain_delete()
* Remove sysdb_subdom completelySimo Sorce2013-02-101-45/+67
| | | | | struct sss_domain_info is always used to represent domains now. Adjust tests accordingly.
* Avoid sysdb_subdom in sysdb_get_subdomains()Simo Sorce2013-02-101-11/+11
|
* Add realm info to sss_domain_infoSimo Sorce2013-02-101-3/+3
|