summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2004-11-15 10:32:06 +0000
committerFrederic Peters <fpeters@entrouvert.com>2004-11-15 10:32:06 +0000
commit0afb57c528b1fc12f5529ed80c770dbcbdbb8173 (patch)
tree4edf655e3d925907a29d1be49c527bab6dc2a45f
parent07e1b7c04f5d623fd624640dffe9ce2a02030422 (diff)
downloadlasso-0afb57c528b1fc12f5529ed80c770dbcbdbb8173.tar.gz
lasso-0afb57c528b1fc12f5529ed80c770dbcbdbb8173.tar.xz
lasso-0afb57c528b1fc12f5529ed80c770dbcbdbb8173.zip
updated tests
-rw-r--r--tests/login_tests.c28
-rw-r--r--tests/tests.c6
2 files changed, 16 insertions, 18 deletions
diff --git a/tests/login_tests.c b/tests/login_tests.c
index 7ad0bf0d..8b0bb517 100644
--- a/tests/login_tests.c
+++ b/tests/login_tests.c
@@ -45,7 +45,7 @@ generateIdentityProviderContextDump()
TESTSDATADIR "/sp1-la/metadata.xml",
TESTSDATADIR "/sp1-la/public-key.pem",
TESTSDATADIR "/ca1-la/certificate.pem");
- return lasso_node_dump(LASSO_NODE(serverContext), NULL, 1);
+ return lasso_server_dump(serverContext);
}
static char*
@@ -64,7 +64,7 @@ generateServiceProviderContextDump()
TESTSDATADIR "/idp1-la/metadata.xml",
TESTSDATADIR "/idp1-la/public-key.pem",
TESTSDATADIR "/ca1-la/certificate.pem");
- return lasso_node_dump(LASSO_NODE(serverContext), NULL, 1);
+ return lasso_server_dump(serverContext);
}
@@ -89,6 +89,7 @@ START_TEST(test02_serviceProviderLogin)
LassoLogin *spLoginContext, *idpLoginContext;
LassoLibAuthnRequest *request;
int rc;
+ char *relayState;
char *authnRequestUrl, *authnRequestQuery;
char *responseUrl, *responseQuery;
char *idpIdentityContextDump, *idpSessionContextDump;
@@ -104,14 +105,13 @@ START_TEST(test02_serviceProviderLogin)
"lasso_login_new() shouldn't have returned NULL");
rc = lasso_login_init_authn_request(spLoginContext, LASSO_HTTP_METHOD_REDIRECT);
fail_unless(rc == 0, "lasso_login_init_authn_request failed");
- fail_unless(LASSO_PROFILE(spLoginContext)->request_type == \
- LASSO_MESSAGE_TYPE_AUTHN_REQUEST, "request_type should be AuthnRequest");
- request = LASSO_LIB_AUTHN_REQUEST(
- LASSO_PROFILE(spLoginContext)->request);
- request->IsPassive = FALSE;
- request->NameIDPolicy = LASSO_LIB_NAMEID_POLICY_TYPE_FEDERATED;
- request->consent = LASSO_LIB_CONSENT_OBTAINED;
- request->RelayState = strdup("fake");
+ request = LASSO_LIB_AUTHN_REQUEST(LASSO_PROFILE(spLoginContext)->request);
+ fail_unless(LASSO_IS_LIB_AUTHN_REQUEST(request), "request should be authn_request");
+ request->IsPassive = 0;
+ request->NameIDPolicy = g_strdup(LASSO_LIB_NAMEID_POLICY_TYPE_FEDERATED);
+ request->consent = g_strdup(LASSO_LIB_CONSENT_OBTAINED);
+ relayState = "fake";
+ request->RelayState = g_strdup(relayState);
rc = lasso_login_build_authn_request_msg(spLoginContext, "https://idp1/metadata");
fail_unless(rc == 0, "lasso_login_build_authn_request_msg failed");
authnRequestUrl = LASSO_PROFILE(spLoginContext)->msg_url;
@@ -127,8 +127,7 @@ START_TEST(test02_serviceProviderLogin)
idpLoginContext = lasso_login_new(idpContext);
fail_unless(idpLoginContext != NULL,
"lasso_login_new() shouldn't have returned NULL");
- rc = lasso_login_process_authn_request_msg(idpLoginContext,
- authnRequestQuery, LASSO_HTTP_METHOD_REDIRECT);
+ rc = lasso_login_process_authn_request_msg(idpLoginContext, authnRequestQuery);
fail_unless(rc == 0, "lasso_login_process_authn_request_msg failed");
fail_unless(lasso_login_must_authenticate(idpLoginContext),
"lasso_login_must_authenticate() should be TRUE");
@@ -140,7 +139,10 @@ START_TEST(test02_serviceProviderLogin)
1, /* authentication_result */
0, /* is_consent_obtained */
LASSO_SAML_AUTHENTICATION_METHOD_PASSWORD,
+ "FIXME: authenticationInstant",
"FIXME: reauthenticateOnOrAfter",
+ "FIXME: notBefore",
+ "FIXME: notOnOrAfter",
LASSO_HTTP_METHOD_REDIRECT);
fail_unless(rc == 0, "lasso_login_build_artifact_msg failed");
@@ -155,7 +157,7 @@ START_TEST(test02_serviceProviderLogin)
responseQuery = strchr(responseUrl, '?')+1;
fail_unless(strlen(responseQuery) > 0,
"responseQuery shouldn't be an empty string");
- serviceProviderId = lasso_profile_get_remote_providerID(LASSO_PROFILE(idpLoginContext));
+ serviceProviderId = LASSO_PROFILE(idpLoginContext)->remote_providerID;
fail_unless(serviceProviderId != NULL,
"lasso_profile_get_remote_providerID shouldn't return NULL");
diff --git a/tests/tests.c b/tests/tests.c
index d416813c..9e3b0a3e 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -30,13 +30,10 @@
extern Suite* basic_suite();
extern Suite* login_suite();
-extern Suite* random_suite();
typedef Suite* (*SuiteFunction) ();
SuiteFunction suites[] = {
- random_suite,
- NULL,
basic_suite,
login_suite,
NULL
@@ -48,14 +45,13 @@ main(int argc, char *argv[])
int rc;
SRunner *sr;
int i;
- int dont_fork = 0;
+ int dont_fork = 1;
for (i=1; i<argc; i++) {
if (strcmp(argv[i], "--dontfork") == 0) {
dont_fork = 1;
}
}
- dont_fork = 1; /* XXX: to help debug segfaults */
lasso_init();