summaryrefslogtreecommitdiffstats
path: root/tests/login_tests_saml2.c
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2011-12-10 11:56:34 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2011-12-16 10:39:18 (GMT)
commit65b94cc1f5b3d169647703950a707b4efc7c1f81 (patch)
tree77af95cb23fccc88bc8488925a1d13264ae0d3f5 /tests/login_tests_saml2.c
parentc3467ed48c979a0f2029207a79f8f4e4c78ea513 (diff)
downloadlasso-65b94cc1f5b3d169647703950a707b4efc7c1f81.zip
lasso-65b94cc1f5b3d169647703950a707b4efc7c1f81.tar.gz
lasso-65b94cc1f5b3d169647703950a707b4efc7c1f81.tar.bz2
[tests] improve checking for log output
- now any non expected log output is considered an error, by setting a g_log default handler. - block_lasso_logs()/unblock_lasso_logs() will block logging output at the DEBUG level - begin_check_do_log(level, message, endswith)/end_check_do_log() with check that the only message emitted between the two macros is one equals to "message" at the level "level", or ending (to work around variable parts in a log message) with "message" if "endswith" is True.
Diffstat (limited to 'tests/login_tests_saml2.c')
-rw-r--r--tests/login_tests_saml2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/login_tests_saml2.c b/tests/login_tests_saml2.c
index c17c750..1052c61 100644
--- a/tests/login_tests_saml2.c
+++ b/tests/login_tests_saml2.c
@@ -785,8 +785,10 @@ START_TEST(test05_sso_idp_with_key_rollover)
check_good_rc(lasso_login_accept_sso(spLoginContext));
/* Process response 2 */
+ block_lasso_logs;
check_good_rc(lasso_login_process_authn_response_msg(spLoginContext,
idpLoginContext2->parent.msg_body));
+ unblock_lasso_logs;
check_good_rc(lasso_login_accept_sso(spLoginContext));
/* Cleanup */
@@ -838,7 +840,9 @@ sso_sp_with_key_rollover(LassoServer *idp_context, LassoServer *sp_context)
LASSO_SAML2_NAME_IDENTIFIER_FORMAT_PERSISTENT);
LASSO_SAMLP2_AUTHN_REQUEST(idp_login_context->parent.request)->NameIDPolicy->AllowCreate = 1;
+ block_lasso_logs;
check_good_rc(lasso_login_process_authn_request_msg(idp_login_context, NULL));
+ unblock_lasso_logs;
check_good_rc(lasso_login_validate_request_msg(idp_login_context,
1, /* authentication_result */
0 /* is_consent_obtained */
@@ -855,8 +859,10 @@ sso_sp_with_key_rollover(LassoServer *idp_context, LassoServer *sp_context)
check_not_null(idp_login_context->parent.msg_url);
/* Process response */
+ block_lasso_logs;
check_good_rc(lasso_login_process_authn_response_msg(sp_login_context,
idp_login_context->parent.msg_body));
+ unblock_lasso_logs;
check_good_rc(lasso_login_accept_sso(sp_login_context));
/* Cleanup */
@@ -986,7 +992,9 @@ START_TEST(test07_sso_sp_with_hmac_sha1_signatures)
test07_make_context(idp_context, "idp6-saml2", LASSO_PROVIDER_ROLE_SP, "sp6-saml2", key)
test07_make_context(sp_context, "sp6-saml2", LASSO_PROVIDER_ROLE_IDP, "idp6-saml2", key)
+ block_lasso_logs;
sso_initiated_by_sp(idp_context, sp_context);
+ unblock_lasso_logs;
/* Cleanup */
lasso_release_gobject(idp_context);