summaryrefslogtreecommitdiffstats
path: root/src/tests
Commit message (Collapse)AuthorAgeFilesLines
* intg: Fix execution with dbus-1.11.18Lukas Slebodnik2017-10-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since dbus-1.11.18 DBUS_COOKIE_SHA1 respect $HOME variable and fallback to value returned from getpwnam only if env HOME does not exist. It caused problem for dbus communication between sssd processes because local user usually do not have directory $HOME/.dbus-keyrings/. And directory created in cwrap environment is problmatic [build@host ~]$ ls -ld ~/.dbus-keyrings/ drw-------. 2 build build 6 Oct 3 10:44 /home/build/.dbus-keyrings/ [buildhost ~]$ ls -lna ~/.dbus-keyrings/ ls: cannot access '/home/build/.dbus-keyrings/.': Permission denied ls: cannot access '/home/build/.dbus-keyrings/..': Permission denied total 0 d????????? ? ? ? ? ? . d????????? ? ? ? ? ? .. [build@host ~]$ touch ~/.dbus-keyrings/test touch: cannot touch '/home/build/.dbus-keyrings/test': Permission denied Other alternative would be to set env variable HOME to the same value as in fake passwd file: HOME=$(abs_builddir)/root Related dbus bug: https://bugs.freedesktop.org/show_bug.cgi?id=101960 Resolves: https://pagure.io/SSSD/sssd/issue/3531 Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> (cherry picked from commit 82c36227e36de155b13e6eb7cfa3e80a25774157) (cherry picked from commit ff2ff94a1cdb98a55a2d8a3c3bbe06e1fb948d5a)
* TEST_NEGCACHE: Ensure root's uid and gid are always added to ncacheFabiano Fidêncio2017-08-311-0/+6
| | | | | | | | | | | | | | In order to do so two new functions have been introduced and test_sss_ncache_prepopulate() has been modified in order to ensure that root's uid and gid are always added to the negative cache. Related: https://pagure.io/SSSD/sssd/issue/3460 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit b4b3d0642120ca05f63959fe2f317a6b93031929) (cherry picked from commit 7e48fb252d1cf032d9aa11bbad1366d753ed081d)
* TEST_NEGCACHE: Test that "root" is always added to ncacheFabiano Fidêncio2017-08-311-0/+6
| | | | | | | | | | | | | | | Simply modify test_sss_ncache_prepopulate() in order to ensure that "root" user and group are always added to the negative cache, no matter whether they're set as part of the filter_users or filter_groups options. Related: https://pagure.io/SSSD/sssd/issue/3460 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit e54764d62bfcc48770d9b2578132979aa58636e5) (cherry picked from commit cfc62a3cc9683a78e5a5ccb31c7e5094c1b91a91)
* tests: update expired certificateSumit Bose2017-06-264-36/+36
| | | | | | | | | | | This is a short term fix to un-break the unit tests. The proper fix would be to create the certificates at runtime during the tests. Related to https://pagure.io/SSSD/sssd/issue/3436 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit 2ccfa9502abf52941d8b6e44b5f7cfdd13311a2d) (cherry picked from commit a3f85d196d14d2699af3ccd87c69c89287ce09fa)
* BUILD: Fix build without sshLukas Slebodnik2017-05-251-0/+2
| | | | | | | | | | | | | | | | | | | | autoreconf -if ./configure --without-ssh make check src/tests/cmocka/test_utils-test_sss_ssh.o: In function `test_textual_public_key': src/tests/cmocka/test_sss_ssh.c:78: undefined reference to `sss_ssh_format_pubkey' src/tests/cmocka/test_sss_ssh.c:82: undefined reference to `sss_ssh_format_pubkey' src/tests/cmocka/test_sss_ssh.c:86: undefined reference to `sss_ssh_format_pubkey' src/tests/cmocka/test_sss_ssh.c:89: undefined reference to `sss_ssh_format_pubkey' src/tests/cmocka/test_sss_ssh.c:92: undefined reference to `sss_ssh_format_pubkey' src/tests/cmocka/test_utils-test_sss_ssh.o:src/tests/cmocka/test_sss_ssh.c:95: more undefined references to `sss_ssh_format_pubkey' follow collect2: error: ld returned 1 exit status Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> (cherry picked from commit d82ffa52dd4c3bb11115b1687edc189284797329) (cherry picked from commit f46d1474b7b249eda690e78b02adea981fbb058c)
* libwbclient-sssd: wbcLookupSid() allow NULL argumentsSumit Bose2017-01-211-0/+122
| | | | | | | | | | | | | | Some caller might not be interested in some of the values wbcLookupSid() returns and just pass NULL. Currently 'net ads user info' does this because it is not interested in the domain. wbcLookupSid() should handle this gracefully. Resolves: https://fedorahosted.org/sssd/ticket/3273 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit 0b78b4e32955ced0f35c6d4685bd277bb03d04cb) (cherry picked from commit 924122b5457f8f93687a81d8171757c8036c8b0f)
* views: properly override group member namesSumit Bose2016-11-081-0/+67
| | | | | | | Resolves https://fedorahosted.org/sssd/ticket/2948 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 1594701fbdc341069e11cff9a85e7a795e52db3d)
* PAM: add pam_response_filter optionSumit Bose2016-11-021-7/+142
| | | | | | | | | Currently the main use-case for this new option is to not set the KRB5CCNAME environment varible for services like 'sudo-i'. Resolves https://fedorahosted.org/sssd/ticket/2296 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* PAM: add a test for filter_responses()Sumit Bose2016-11-021-0/+52
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TESTS: Fix check for py bindings in dlopen testsFabiano Fidêncio2016-10-171-2/+2
| | | | | | | | | | The current code checks only for "HAVE_PYTHON_BINDINGS", which is not even a valid check. Let's do the proper check according to the python version (HAVE_PYTHON2_BINDINGS or HAVE_PYTHON3_BINDINGS). Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit 8a681cc41672afd1532b4a0c7e9da3a4eb2014a7)
* p11: add PKCS11_LOGIN_TOKEN_NAME environment variableSumit Bose2016-10-101-1/+13
| | | | | | | | The PKCS11_LOGIN_TOKEN_NAME environment variable is e.g. used by the Gnome Settings Daemon to determine the name of the token used for login. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit d86224608ff60ec5cc7e7cbf9e53d8a04e083530)
* test_memory_cache: Test removing mc without invalidationLukas Slebodnik2016-09-261-5/+2
| | | | | | | | | | | | | Long living clients should be able to reinitialize memory cache which was removed but it not initialized. This patch also remove workaround in test_local_domain.py Test for: https://fedorahosted.org/sssd/ticket/2726 Reviewed-by: Michal Židek <mzidek@redhat.com> (cherry picked from commit b28f5fb097e06a97a45e0ae348e506d9d1432cc8)
* intg: fix typosPavel Březina2016-09-261-8/+8
| | | | | Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit f106125bbd8f038a93d3fabe36899391c215f937)
* intg: Make location of sssd nss module configurableLukas Slebodnik2016-09-262-1/+2
| | | | | | | | | | | | | | | | | | | | | | | The path to sssd nss module (libsss_nss.so) was relative to prefix and expected subdirectory "lib". 32bit and 64bit platforms and different distributions use different paths. This patch allows to use python module sssd_id even with real module and not just integration tests. It is just required to prepare "config.py" with right path. e.g. cd ~/sssd/src/tests/intg [~/sssd/src/tests/intg]$ echo "NSS_MODULE_DIR = '/usr/lib64'" > config.py [~/sssd/src/tests/intg]$ python Python 2.7.12 (default, Jul 18 2016, 09:57:01) [GCC 6.1.1 20160621 (Red Hat 6.1.1-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sssd_id >>> sssd_id.get_user_gids('user') (1, 0, [5977, 1070, 5845, 1076, 1074, 10327, 5975, 5766]) Reviewed-by: Petr Čech <pcech@redhat.com> (cherry picked from commit 70d47ad4c89152f1e2ac4599f75f9374b631b953)
* TESTS: sss_groupshow with MPGMichal Židek2016-09-261-0/+22
| | | | | | | | | | Regression test for ticket #3184 Resolves: https://fedorahosted.org/sssd/ticket/3184 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit bb14556c1df503314644fc424fbbf95759791db9)
* TEST: Add regression test for ticket #3179Michal Židek2016-09-261-12/+114
| | | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/3179 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit 1c72723cde8bea0d390b928c7cd29e48e7a7deab)
* TESTS: Add FQDN variants for some testsMichal Židek2016-09-261-0/+83
| | | | | | | Adds FQDN variants of some already existing tests. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit f2d1d90a14267c01155eab7bb95b8eb34128acc9)
* TESTS: Test for sss_user/groupmod -aMichal Židek2016-09-261-0/+36
| | | | | | | | | | Regression tests for ticket #3178. Resolves: https://fedorahosted.org/sssd/ticket/3178 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit 7fa4964d84f41bd80a6d971ffaeef87a7c2f19be)
* TESTS: sss_groupadd/groupshow regressionsMichal Židek2016-09-261-0/+26
| | | | | | | | | | | Adds regression CI test for ticket #3173 and #3175. Resolves: https://fedorahosted.org/sssd/ticket/3173 https://fedorahosted.org/sssd/ticket/3175 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit 20c2d76d9430a1fc069531ff537df046a74c8f61)
* intg: fix assert messages in test_memory_cachePavel Reichl2016-09-261-10/+10
| | | | | Reviewed-by: Michal Židek <mzidek@redhat.com> (cherry picked from commit 1584db9c0b15ee239bd4e163c4ecaf6909b1b11b)
* intg: Use different uid range for add_remove testsLukas Slebodnik2016-09-261-2/+2
| | | | | | | | | | | | Most linux distribution create local users from UID 1000. We used similar UID space in sssd but it might caused issues in add remove tests becuase sssd in cwrap enviroment run in the same PID space. If sssd try to remove user with uid 1001 it will fail because the local user with the same UID is active and sssd does not remove active users. Reviewed-by: Petr Cech <pcech@redhat.com> (cherry picked from commit e97d9972e8ad05dff1a3b99468ee5728c2c183a8)
* test_ldap: test resolving of names with special charactersLukas Slebodnik2016-09-261-0/+22
| | | | | | | Integration test for #3121 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit e59b73366d3067c576e39a214a34ace2f9a84878)
* test_ldap: test nested membership with rfc2307bisLukas Slebodnik2016-09-261-0/+27
| | | | | | | Integration test for #3093 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 1ba26271952de1beeb9e041bedf87d720d3f5680)
* intg: Change preference of openldap module pathLukas Slebodnik2016-09-261-2/+2
| | | | | | | | | | | | The /usr/lib64 should be preffered path for searching binary modules for openldap backends. The /usr/lib/ should be used for storing no binary files on 64 bit platform e.g. scripts ... The current vresion of would choose /usr/lib/ even though /usr/lib64 contains real openldap modules. Reviewed-by: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> (cherry picked from commit bf472d2422599d14345e7cd9999289c26455c622)
* sssd_id.py: Primary group should be returned for initgroupsLukas Slebodnik2016-09-262-3/+23
| | | | | | | | | | Side effect of this change was that some primary groups could not be resolved and therefore get_user_groups failed in override tests. We should do the same as "id user". return decimal representation GID if it cannot be mapped to name. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit de19c0af27f1576c13bef183600136851baf767d)
* intg: create ldap test without enumerationLukas Slebodnik2016-09-262-0/+698
| | | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 49a5412cbc98e630de17359c29cb8d6ce0e16168)
* test_enumeration: Remove test without enumerationLukas Slebodnik2016-09-261-75/+11
| | | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 8def4f07aedf2cebf77e816b201d91beac9b964b)
* intg: rename test with enumerationLukas Slebodnik2016-09-262-1/+1
| | | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 1f4dc2971bac4ceb0803b18f86a746656a0f1990)
* test_local_domain: Restore correct env variableLukas Slebodnik2016-09-261-1/+1
| | | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 361f9fe207f82693bbfd40dfe272a4513652856c)
* ds.py: Do not call teardown in destructorLukas Slebodnik2016-09-261-4/+0
| | | | | | | | | | We use finalizers in pytest for cleaning up of openldap server. But sometimes destructor was called in case of failure which causes many issues in tests. Running teardown in destructor is not reliable due to pyhton nature. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit a035366f622f42c865dbaa1579f741a81548fde2)
* tests: Add a regression test for upstream ticket #3131Jakub Hrozek2016-09-221-0/+66
| | | | | | | | Tests that running two duplicate SRV resolution queries succeeds and returns a valid host name. Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit a299f900981343904d7c9c5d148e30b8e0b2c460)
* p11: add OCSP default responder optionsSumit Bose2016-09-191-0/+80
| | | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 53ef8f81b60929a6c866efdd133627e7d7d61705)
* p11: add no_verification optionSumit Bose2016-09-192-1/+30
| | | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit aa35995ef056aa8ae052a47c62c6750b7adf065e)
* dyndns-tests: Fix false positive failuresLukas Slebodnik2016-08-101-0/+1
| | | | | | | | | | | | | | | The child process finished faster then it has handled by parent and therefore it timed out. It's the similar solution as in b3074dca3acebd91437ef13d3329d6d65d655215 [ RUN ] dyndns_test_error (Fri Jul 29 16:12:00:621444 2016) [sssd] [nsupdate_child_timeout] (0x0020): Timeout reached for dynamic DNS update Could not run the test - check test fixtures [ ERROR ] dyndns_test_error Reviewed-by: Petr Čech <pcech@redhat.com> (cherry picked from commit bad17a253bf979f23b2294c3720300d1053744b1)
* tests: add tests for netlogon_get_domain_infoSumit Bose2016-08-031-0/+82
| | | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 7fe7073ad2c84946a699528a3bb79f7803c96b69)
* tests: add tests for sss_get_domain_mappings_content()Sumit Bose2016-07-251-0/+163
| | | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 66588a6241df42a04cb9ead75cf3afb38495d74a)
* pam-srv-tests: Increase cached_auth_timeoutLukas Slebodnik2016-06-101-2/+2
| | | | | | | | | | | | | | | The execution sysdb_cache_password_ex can be slow due to function s3crypt_sha512 and valgrind slowdown. Therefore 2 seconds timeout can be reached in possitive tests test_pam_cached_auth_success and test_pam_cached_auth_success_combined_pw_with_cached_2fa Resolves: https://fedorahosted.org/sssd/ticket/2994 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 6574e41a8d1c2af293df2f57916628344eaa3560)
* AD: use krb5_keytab for subdomain initializationSumit Bose2016-06-091-2/+4
| | | | | | | | | | | During the initialization of AD subdomains parameters like the SASL auth id are determined. Since subdomains use a default set of the AD specific configuration options the default keytab will be used. If krb5_keytab is set in sssd.conf for the AD domain this keytab should be used for the subdomains (domains of the same AD forest) as well. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit cc4caf88344210ea9777d618f0f71935ca5e7f8b)
* UTIL: exit() the forked process if exec()-ing a child process failsJakub Hrozek2016-05-191-28/+23
| | | | | | | | | | | | When exec() fails, we should not attempt to continue, but just kill the forked process. The patch adds this logic to the exec_child() and exec_child_ex() functions to avoid code duplication Resolves: https://fedorahosted.org/sssd/ticket/3016 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit de8815aba87d08b6b7ac5d502dcb1755787e0857)
* tests: Extend test_child_common.c to include tests for the only_extra_args ↵Jakub Hrozek2016-05-192-7/+91
| | | | | | | | functionality Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit b5797517abb117cff7330acc894b71deda74be3d)
* tests: Check NULL context in sysdb-tests when removing group membersJakub Hrozek2016-04-131-0/+25
| | | | | | | This is done to make sure the memberof module does not leak memory. Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit 883fb900f7c6b202cf0b6d8268ffa626ab8a1be9)
* test_be_ptask: Check leaks in testsLukas Slebodnik2016-04-131-0/+2
| | | | | Reviewed-by: Sumit Bose <sbose@redhat.com> (cherry picked from commit f818dba78f3e2f3d53ba072e42ac662d2f49edad)
* intg: local override for user with mixed case nameSumit Bose2016-04-131-1/+65
| | | | | | | | | | Test for users with fully-qualified and mixed-cased names are added. Resolves: https://fedorahosted.org/sssd/ticket/2989 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit 32dd0dd34193a7566d83adf6845f5194decc3304)
* REFACTOR: umask(077) --> umask(SSS_DFL_X_UMASK)Petr Cech2016-04-073-4/+4
| | | | | | | | | | | | There are many calls of umask function with 077 argument. This patch add new constant SSS_DFL_X_UMASK which stands fot 077. So all occurences of umask(077) are replaced by constant SSS_DFL_X_UMASK. Resolves: https://fedorahosted.org/sssd/ticket/2424 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit f8e337540d280f944098cd4dd7d670e2f7166b54)
* test_ipa_subdom_server: Workaround for slow krb5 + SELinuxLukas Slebodnik2016-04-071-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is an overhead caused by SELinux after fixing memory leak in krb5. https://bugzilla.redhat.com/show_bug.cgi?id=1311287. The overhead is mainly visible with valgrind and moreover it causes failures due to timeouts. sh$ time libtool --mode=execute ./test_ipa_subdom_server enabled/permissive SELinux real 0m7.976s user 0m6.680s sys 0m0.189s disabled SELinux real 0m2.111s user 0m0.071s sys 0m0.043s valgrind + enabled/permissive SELinux real 2m7.310s user 2m17.080s sys 0m0.786s valgrind + disabled SELinux real 0m5.510s user 0m3.396s sys 0m0.309s Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 1510d1264b44c437b8270e0a5a239e8624933c3d)
* tests: Add a unit test for the external groups resolutionJakub Hrozek2016-03-111-0/+526
| | | | | | | | | | | Adds a test that tests a complex nested group hierarchy. Also defines the talloc chunk for group members to 1 to make sure the realloc branch is always tested. Unit test for: https://fedorahosted.org/sssd/ticket/2522 Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit c6bda70d6131b5e8cd760ad690fae001d1765547)
* tests: Regression test with wrong LC_ALLMichal Židek2016-03-032-0/+113
| | | | | | | | | | | | | | | | | | | | Ticket: https://fedorahosted.org/sssd/ticket/2785 Test local domain tool with wrong LC_ALL environment variable value. NOTE: The memory cache files are not deleted properly in the test teardown to work around the problem described in ticket https://fedorahosted.org/sssd/ticket/2726 Once the ticket above is solved, the teardown will be updated to remove the memory cache files. Reviewed-by: Michal Židek <mzidek@redhat.com> (cherry picked from commit 586f512ab8b6e5a03349598846141f43c1d505b8)
* FO: Use tevent_req_defer_callback() when notifying callersJakub Hrozek2016-03-031-3/+46
| | | | | | | | | | | | | | | If a fo_resolve_service callback would modify the server->common member in any way, for example by dereferencing the server and lowering the refcount to 0, which would free the common structure, then the next iteration of fo_resolve_service_done would access memory that was already gone. Please see https://tevent.samba.org/group__tevent__request.html#ga09373077d0b39e321a196a86bfebf280 for more details. Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit a92f68763a57b211a1bf6b80b6dd80c4a1aa2738)
* FO: Use refcount to keep track of servers returned to callersJakub Hrozek2016-03-032-11/+17
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2829 Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit 10c07e188323a2f9824b5e34379f3b1a9b37759e)
* tests: Reduce failover code duplicationJakub Hrozek2016-03-031-53/+35
| | | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit 4a4af8e1b6a9bab7c7a34d86055a400376e3829e)