summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2017-05-08 15:28:20 +0200
committerLukas Slebodnik <lslebodn@redhat.com>2017-06-01 16:18:51 +0200
commit89ff140d7ab92fce52d6730a7d27c8d73c7d9e4a (patch)
tree5095e07131f51f8b6998e2f4e6f37fcf90b6ee9e /src/tests
parent749963195393efa3a4f9b168dd02fbcc68976ba3 (diff)
downloadsssd-89ff140d7ab92fce52d6730a7d27c8d73c7d9e4a.tar.gz
sssd-89ff140d7ab92fce52d6730a7d27c8d73c7d9e4a.tar.xz
sssd-89ff140d7ab92fce52d6730a7d27c8d73c7d9e4a.zip
tests: fix test_pam_preauth_cert_no_logon_name()
Currently a name is provided for test_pam_preauth_cert_no_logon_name() so it is not a no-logon-name test. This patch removes the name and adds the now missing mocked reply manually. Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/cmocka/test_pam_srv.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tests/cmocka/test_pam_srv.c b/src/tests/cmocka/test_pam_srv.c
index 4d351a370..35afbdd81 100644
--- a/src/tests/cmocka/test_pam_srv.c
+++ b/src/tests/cmocka/test_pam_srv.c
@@ -1873,10 +1873,14 @@ void test_pam_preauth_cert_no_logon_name(void **state)
* Since there is a matching user the upcoming lookup by name will find
* the user entry. But since we force the lookup by name to go to the
* backend to make sure the group-membership data is up to date the
- * backend response has to be mocked twice and the second argument of
- * mock_input_pam_cert cannot be NULL but must match the user name. */
- mock_input_pam_cert(pam_test_ctx, "pamuser", NULL, NULL,
+ * backend response has to be mocked twice.
+ * Additionally sss_parse_inp_recv() must be mocked because the cache
+ * request will be done with the username found by the certificate
+ * lookup. */
+ mock_input_pam_cert(pam_test_ctx, NULL, NULL, NULL,
test_lookup_by_cert_cb, TEST_TOKEN_CERT, false);
+ mock_account_recv_simple();
+ mock_parse_inp("pamuser", NULL, EOK);
will_return(__wrap_sss_packet_get_cmd, SSS_PAM_PREAUTH);
will_return(__wrap_sss_packet_get_body, WRAP_CALL_REAL);