summaryrefslogtreecommitdiffstats
path: root/src/tests
Commit message (Collapse)AuthorAgeFilesLines
* debug-tests: Fix test with new line in debug messageLukas Slebodnik2015-03-171-5/+5
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Add missing new lines to debug messagesLukas Slebodnik2015-03-171-1/+1
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* cache_req: parse input name if neededPavel Březina2015-03-131-2/+169
| | | | | | | | The input name is now parse automatically by cache_req if none particullar domain is specified. The parsed named is returned from _recv as an output parameter. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* cmocka: include mock_parse_inp in header filePavel Březina2015-03-131-0/+2
| | | | | | | This is a non static function that is supposed to be used in tests but it was missing from header file. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* cache_req: add support for group by idPavel Březina2015-03-131-1/+362
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* cache_req: add support for group by namePavel Březina2015-03-131-1/+342
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* cache_req: add support for user by uidPavel Březina2015-03-131-2/+368
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* cache_req tests: define user name constantPavel Březina2015-03-131-11/+14
| | | | | | | Using a constant here is better since the name is shared between the test function and testing _done function. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* cache_req tests: rename test_user to test_user_by_namePavel Březina2015-03-131-25/+25
| | | | | | | This is done in order to distinguish those tests from other user tests that are about to come. For example: test_user_by_id. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* test: Check ERR_LASTMichal Zidek2015-03-131-0/+10
| | | | | | Check if number of error codes and messages is the same. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* Add unit tests for initgroupsJakub Hrozek2015-03-121-0/+346
| | | | Reviewed-by: Pavel Reichl <preichl@redhat.com>
* tests: Add a getpwnam-by-UPN testJakub Hrozek2015-03-121-0/+97
| | | | Reviewed-by: Pavel Reichl <preichl@redhat.com>
* tests: ncache_hit must be an int to test UPNsJakub Hrozek2015-03-121-9/+9
| | | | | | | | In order to detect faulty cases where negcache would be checked twice, we need to convert the ncache_hit to integer and check exact amounts of hits. Reviewed-by: Pavel Reichl <preichl@redhat.com>
* tests: convert all unit tests to cmocka 1.0 or laterJakub Hrozek2015-03-1135-663/+769
| | | | | | All tests now use the cmocka-1.0-compatible API. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* UTIL: convert GeneralizedTime to unix timePavel Reichl2015-03-051-0/+57
| | | | | | | | New utility function *sss_utc_to_time_t* to convert GeneralizedTime to unix time. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* FO: Use SRV TTL in fail over codeJakub Hrozek2015-03-031-0/+599
| | | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/1884 Removes the hardcoded SRV TTL timeout and uses TTL from the DNS instead. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* SPEC: Build python3 bindings on available platformsLukas Slebodnik2015-02-251-4/+10
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2574 Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
* TESTS: Run python tests with all supported python versionsLukas Slebodnik2015-02-254-0/+20
| | | | | | | This patch add simple bash wrappers for python tests. They are executed either with python2 or python3. Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
* BUILD: Add possibility to build python{2,3} bindingsLukas Slebodnik2015-02-252-6/+38
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2574 Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
* sbus codegen: do not prefix getters with iface namePavel Březina2015-02-173-75/+75
| | | | | | | | | | | | | | | | | | Prefixing getters with C name of the interface is just redundant since it is the same as the name of the structure that contains those fields. The following structure: struct test_pilot { $type test_pilot_get_name; } changes to: struct test_pilot { $type get_name; } Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sbus: use hard coded getters instead of generatedPavel Březina2015-02-171-761/+28
| | | | | | | | | | | | | | | Properties are single value of a small number of predefined D-Bus types. There is no need to generate them with codegen. Actually, the source generator for property getters is already quite mess with branching for array, strings and object paths. Adding any more complex type in the future (such as dictionary) would require even more branching or creating a separate path for it. Hard coding the getters will simplify creating new ones for more complex types. This patch also reduces lots of code duplication and creates a simple function for GetAll. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Remove strict requirements of python2Lukas Slebodnik2015-02-133-3/+3
| | | | | | | | | | * fix hashbangs * remove strict requirements of python2 in build system Resolves: https://fedorahosted.org/sssd/ticket/2017 Reviewed-by: Petr Viktorin <pviktori@redhat.com>
* RESOLV: Add an internal function to read TTL from a DNS packetJakub Hrozek2015-02-112-1/+375
| | | | | | | | | | | | Related: https://fedorahosted.org/sssd/ticket/1884 Adds an internal resolver function that reads the TTL for SRV records as specified by RFC-2181. Several internal c-ares definitions are used until c-ares contains a function that exposes all this information via a parsing function. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* LDAP: Add UUID when saving incomplete groupsJakub Hrozek2015-01-301-8/+8
| | | | | | | Related to: https://fedorahosted.org/sssd/ticket/2571 Reviewed-by: Sumit Bose <sbose@redhat.com>
* test_nested_groups: Additional unit testsLukas Slebodnik2015-01-301-0/+165
| | | | | | | Unit test for: https://fedorahosted.org/sssd/ticket/2531 Reviewed-by: Pavel Reichl <preichl@redhat.com>
* TESTS: Mock return value of sdap_get_generic_recvLukas Slebodnik2015-01-302-1/+9
| | | | Reviewed-by: Pavel Reichl <preichl@redhat.com>
* sbus: add sbus_opath_get_object_name()Pavel Březina2015-01-231-4/+29
| | | | | | | This function assumes that the last component of the object path is an object name. It will return the part unescaped. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sbus: move common opath functions from ifp to sbus codePavel Březina2015-01-232-98/+157
| | | | | | | These functions are quite general thus they may be part of sbus interface. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sbus: unify naming of handler data variablePavel Březina2015-01-232-51/+51
| | | | | | | | | We used three different names to express handler data: - pvt - instace_data - handler_data Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sbus: support org.freedesktop.DBus.PropertiesPavel Březina2015-01-232-2/+16
| | | | | | | Bring back org.freedesktop.DBus.Properties with support of multiple interfaces on single object path. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sbus: support org.freedesktop.DBus.IntrospectablePavel Březina2015-01-231-26/+11
| | | | | | | | | This commit brings back support of Introspectable interface and enables support of multiple interfaces there. It also refactors the old code so the generator and introspect xml format especially is more readable. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sbus: add object path to sbus requestPavel Březina2015-01-231-5/+3
| | | | | | | | | Object path is heavily used in implementation of methods from interfaces that are supported on whole subtrees. Although it can be obtained from a D-Bus message, it is nice to have it accessible directly. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sbus: support multiple interfaces on single pathPavel Březina2015-01-232-0/+4
| | | | | | | | | | | | | | | | | | | This patch removes the old message handler which is replaced with a new one that supports multiple interfaces registered on single object path. A hash table is used to store registered object paths and their interfaces. When an entry or the table itself is destroyed, registered object path is unregistered through delete callback. It temporarily removes support of Introspect and Properties standard D-Bus interfaces and disables unit tests of those interfaces. The support is brought back by following patches. Resolves: https://fedorahosted.org/sssd/ticket/2339 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sbus: add new iface via sbus_conn_register_iface()Pavel Březina2015-01-232-12/+6
| | | | | | | | | | | | | | | | | | | Rename sbus_conn_add_interface() to sbus_conn_register_iface() and remove sbus_new_interface() calls since it is just one more unnecessary call outside the sbus code. The function sbus_new_interface() is made static and used directly in sbus_conn_register_iface(). The name was chosen to better describe what the function is doing. That it registers an interface on a given object path. The same interface can be used with different paths so it is not really about adding an interface. Preparation for: https://fedorahosted.org/sssd/ticket/2339 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IPA: properly handle mixed-case trusted domainsSumit Bose2015-01-231-0/+44
| | | | | | | | | | | | In the SSSD cache domain names are handled case-sensitive. As a result fully-qualified names in RDN contain the domain part in the original spelling. When IPA client lookup up group-memberships on the IPA server via the extdom plugin the names returned are all lower case. To make sure new DNs are generated correctly the domain part must adjusted. Related to https://fedorahosted.org/sssd/ticket/2159 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* nss: Add original DN and memberOf to origbyname requestSumit Bose2015-01-201-2/+1
| | | | | | | | | IPA HBAC evaluation relies on the original values for DN and memberOf attributes. Resolves https://fedorahosted.org/sssd/ticket/2560 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* nss: make fill_orig() multi-value awareSumit Bose2015-01-201-1/+130
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* krb5: fix entry order in MEMORY keytabSumit Bose2015-01-191-0/+82
| | | | | | | | | | | | | | | Since krb5_kt_add_entry() adds new entries at the beginning of a MEMORY type keytab and not at the end a simple copy into a MEMORY type keytab will revert the order of the keytab entries. Since e.g. the sssd_krb5 man page give hints about where to add entries into keytab files to help SSSD to find a right entry we have to keep the order when coping a keytab into a MEMORY type keytab. This patch fixes this by doing a second copy to retain the original order. Resolves https://fedorahosted.org/sssd/ticket/2557 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* UTIL: Unify the fd_nonblocking implementationJakub Hrozek2015-01-152-2/+23
| | | | | | | The responder and child_common modules each had their own implementation. Unify it instead and add a unit test. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* TESTS: Cover child_common.c with unit testsJakub Hrozek2015-01-152-1/+330
| | | | | | The module wasn't tested properly, which made it harder to patch it Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* server-tests: use strtouint32 instead strtolPavel Březina2015-01-151-4/+7
| | | | | | | | | | PID may be greater than 0xffff thus we remove this check but it is supposed to be in range of uint32. There are also some improvements to get more information from assertions. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* UTIL: Allow dup-ing child pipe to a different FDJakub Hrozek2015-01-131-5/+6
| | | | | | | | | | Related to: https://fedorahosted.org/sssd/ticket/2544 Adds a new function exec_child_ex and moves setting the extra_argv[] to exec_child_ex() along with specifying the input and output fds. Reviewed-by: Sumit Bose <sbose@redhat.com>
* Python3 support in SSSDBohuslav Kabrda2015-01-133-18/+31
| | | | https://fedorahosted.org/sssd/ticket/2017
* responders: new interface for cache requestPavel Březina2015-01-091-0/+529
| | | | | | | | | | | | | | | | Many areas of responders performs an expiration check and refresh of cached objects during single or multiple domain search. This code is duplicated on many areas of the code with small or none modifications. This interface aims to reduce code duplication between responders, by providing one universal API for requesting cached objects. This API will take care of cache lookup, expiration check, cache refresh, out of band cache request, negative cache in both single and multi domain searches. Reviewed-by: Michal Židek <mzidek@redhat.com>
* tests: remove code duplication in single domain cleanupPavel Březina2015-01-099-81/+29
| | | | Reviewed-by: Michal Židek <mzidek@redhat.com>
* tests: add test_multidom_suite_cleanup()Pavel Březina2015-01-092-0/+69
| | | | | | Cleanup multiple domains. Reviewed-by: Michal Židek <mzidek@redhat.com>
* tests: add create_multidom_test_ctx()Pavel Březina2015-01-092-21/+58
| | | | | | This will allow to create a multi domain test environment. Reviewed-by: Michal Židek <mzidek@redhat.com>
* tests: refactor create_dom_test_ctx()Pavel Březina2015-01-091-61/+193
| | | | | | | Separate the function into more functions as a preparation for creating a multi domain test environment. Reviewed-by: Michal Židek <mzidek@redhat.com>
* TESTS: Cover sysdb_gpo.c with unit testsJakub Hrozek2015-01-081-0/+78
| | | | | | Untested code is risky to change. Reviewed-by: Pavel Reichl <preichl@redhat.com>
* TESTS: typo in 'assert message'Pavel Reichl2015-01-081-2/+2
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>