summaryrefslogtreecommitdiffstats
path: root/src/tests/cwrap
Commit message (Collapse)AuthorAgeFilesLines
* KRB5: Do not switch_creds() if already the specified userJakub Hrozek2014-11-181-0/+7
| | | | | | | | | | | | | | The code didn't have to handle this case previously as sssd_be was always running as root and switching to the ccache as the user logging in. Also handle NULL creds on restore_creds() in case there was no switch. One less if-condition and fewer indentation levels. Related: https://fedorahosted.org/sssd/ticket/2370 Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* BUILD: Fix linking cwrap tests with -Wl,--as-neededLukas Slebodnik2014-10-271-1/+1
| | | | | | | | | | | CCLD responder_common-tests .libs/libsss_util.so: undefined reference to `sss_base64_encode' .libs/libsss_util.so: undefined reference to `s3crypt_gen_salt' .libs/libsss_util.so: undefined reference to `sss_base64_decode' .libs/libsss_util.so: undefined reference to `s3crypt_sha512' collect2: error: ld returned 1 exit status Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TEST: Unit test for create_pipe_fdJakub Hrozek2014-10-221-0/+91
| | | | | Reviewed-by: Pavel Reichl <preichl@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* UTIL: Add a function to convert id_t from a number or a nameJakub Hrozek2014-10-224-1/+306
| | | | | | | | | | | | We need a custom function that would convert a numeric or string input into uid_t. The function will be used to drop privileges in servers and also in the PAC and IFP responders. Includes a unit test to test all code that changed as well as a fix for a misnamed attribute in the csv_to_uid_list function synopsis. Reviewed-by: Pavel Reichl <preichl@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* test_server: Fix waiting for background processLukas Slebodnik2014-10-221-3/+6
| | | | | | | | A waiting loop for background process was very fast (just 5 milliseconds) It caused problem when test was executed with valgrind. The maximum time was increased to 10 seconds. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* BUILD: Fix automake warningLukas Slebodnik2014-10-221-4/+4
| | | | | | | | | | | src/tests/cwrap/Makefile.am:45: warning: check_PROGRAMS was already defined in condition TRUE, which includes condition HAVE_CMOCKA and HAVE_NSS_WRAPPER and HAVE_UID_WRAPPER ... src/tests/cwrap/Makefile.am:41: ... 'check_PROGRAMS' previously defined here This patch also replace '\t' with spaces Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TESTS: Unit tests for server_setupJakub Hrozek2014-10-202-1/+266
| | | | | | | We changed server_setup, so we must make sure the function continues to work as expected. Reviewed-by: Pavel Reichl <preichl@redhat.com>
* TESTS: Add -std=gnu99 to cwrap tests CFLAGSPavel Reichl2014-10-201-0/+1
| | | | | | | | | | | ../../../../src/tests/cwrap/../../../src/util/domain_info_utils.c: In function ‘subdomain_enumerates’: ../../../../src/tests/cwrap/../../../src/util/domain_info_utils.c:77:9: error: ‘for’ loop initial declarations are only allowed in C99 mode for (int i=0; parent->sd_enumerate[i]; i++) { ^ ../../../../src/tests/cwrap/../../../src/util/domain_info_utils.c:77:9: note: use option -std=c99 or -std=gnu99 to compile your code make[3]: *** [../../../src/util/server_tests-domain_info_utils.o] Error 1 Reviewed-by: Pavel Reichl <preichl@redhat.com>
* TESTS: Add a test to change user IDsJakub Hrozek2014-10-105-0/+222
Adds a unit test using the nss_wrapper and uid_wrapper libraries that exercises the ability to become another user. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>