summaryrefslogtreecommitdiffstats
path: root/src/tests/cmocka/test_sdap.c
Commit message (Collapse)AuthorAgeFilesLines
* TESTS: Add a unit test for matching the secondary objectclassJakub Hrozek2014-09-251-0/+37
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TESTS: Add a unit test for dereference parsingJakub Hrozek2014-09-081-1/+169
| | | | Reviewed-by: Michal Židek <mzidek@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>
* sdap-tests: Fix off by one.Lukas Slebodnik2014-07-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Function sss_base64_decode does not return NUL terminated string and it causes valgrind warning in test "Invalid read of size 1" ==30954== Invalid read of size 1 ==30954== at 0x4A09FB8: strcmp (mc_replace_strmem.c:730) ==30954== by 0x4C2AAFA: _assert_string_equal (in /usr/lib64/libcmocka.so.0.2.1) ==30954== by 0x407DBA: test_parse_with_map (test_sdap.c:285) ==30954== by 0x4C2C817: _run_test (in /usr/lib64/libcmocka.so.0.2.1) ==30954== by 0x4C2CCF8: _run_tests (in /usr/lib64/libcmocka.so.0.2.1) ==30954== by 0x408A6F: main (test_sdap.c:583) ==30954== Address 0x6a8db34 is 0 bytes after a block of size 100 alloc'd ==30954== at 0x4A0645D: malloc (vg_replace_malloc.c:291) ==30954== by 0x35C8204980: _talloc_memdup (talloc.c:613) ==30954== by 0x5080A4B: sss_base64_decode (nss_base64.c:86) ==30954== by 0x407DA0: test_parse_with_map (test_sdap.c:282) ==30954== by 0x4C2C817: _run_test (in /usr/lib64/libcmocka.so.0.2.1) ==30954== by 0x4C2CCF8: _run_tests (in /usr/lib64/libcmocka.so.0.2.1) ==30954== by 0x408A6F: main (test_sdap.c:583) Reviewed-by: Pavel Reichl <preichl@redhat.com>
* LDAP: Remove unused output parameter _dn from sdap_parse_entryJakub Hrozek2014-07-081-8/+7
| | | | | | | No caller directly accessed this parameter. Moreover, it seemed useless since the same data is available as SYSDB_ORIGINAL_DN in the attributes. Reviewed-by: Michal Židek <mzidek@redhat.com>
* LDAP: Try all attributes when saving an entryJakub Hrozek2014-07-081-0/+55
| | | | | | | | | | | | | The same LDAP attribute might be used several times for the same user or group attribute. For instance, some servers have a global "ID" number that should be used for both UID and GID. However, our sdap_parse_entry() function only copied the LDAP attribute to the first matching sysdb attribute. This patch adds a second nested loop that checks if any of the other LDAP attributes are eligible. Reviewed-by: Michal Židek <mzidek@redhat.com>
* TESTS: Add a unit test for the sdap.c moduleJakub Hrozek2014-07-081-0/+530
Covers the sdap_parse_entry function with unit tests so that we know that modifying the function in a later patch will not result in a regression. Reviewed-by: Michal Židek <mzidek@redhat.com>