LemonLDAP::NG Web SSO
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
lemonldap-ng/lemonldap-ng-portal/t
Clément OUDOT 5d22cf9cd8 Force logout in unit test (#2336) 5 years ago
..
gpghome
lib Tidy 5 years ago
sessions
sessions2
testslapd Add unit test and fix code for ppolicy grace (#1691) 6 years ago
01-AuthDemo.t Tidy 5 years ago
01-CSP-and-CORS-headers.t Unit tests for #2281 5 years ago
01-Handler-redirection-and-URL-check-by-portal.t Tidy 5 years ago
01-pdata.t tidy with new conf 6 years ago
02-Password-Demo-Local-Ppolicy.t Allowed all special chars and rule to disable local password policy (#2266) 5 years ago
02-Password-Demo-Local-noPpolicy.t Append unit tests (#2207) 5 years ago
02-Password-Demo.t New method to override messages with JSON files (#1595) 6 years ago
03-ConfTimeout.t Add timeout for configuration load (#1908) 6 years ago
03-SessionTimeout.t Tidy 5 years ago
03-XSS-protection.t Typo 6 years ago
04-language-selection.t Tidy 6 years ago
19-Auth-Null.t tidy with new conf 6 years ago
20-Auth-DBI-utf8.t new expectJSON function in test-lib 6 years ago
20-Auth-and-password-DBI-dynamic-hash.t Tidy 5 years ago
20-Auth-and-password-DBI.t Parallel tests 6 years ago
21-Auth-LDAP-Policy-only.t Append unit test (#2266) 5 years ago
21-Auth-LDAP-Policy.t Improve unit test (#2266) 5 years ago
21-Auth-LDAP-utf8.t tidy with new conf 6 years ago
21-Auth-and-password-LDAP.t Improve unit test (#2178) 5 years ago
22-Auth-and-password-AD.t tidy with new conf 6 years ago
23-Auth-and-password-REST.t tidy with new conf 6 years ago
24-AuthApache.t tidy with new conf 6 years ago
24-AuthKerberos.t Force cleaning pdata cookie if redirect url match _url & Improve unit test (#2061) 5 years ago
25-AuthSlave-with-Choice.t Tidy 5 years ago
25-AuthSlave-with-Credentials.t Improve unit tests (#1935) 6 years ago
26-AuthRemote.t tidy with new conf 6 years ago
27-AuthProxy.t tidy with new conf 6 years ago
28-AuthChoice-and-password.t Parallel tests 6 years ago
28-AuthChoice-with-captcha.t Tidy 5 years ago
28-AuthChoice-with-over.t Fix warning messages 5 years ago
28-AuthChoice-with-rules.t Tidy 5 years ago
28-AuthChoice-with-token.t Tidy 5 years ago
29-AuthGPG.t Tydy 6 years ago
29-AuthSSL.t Parallel tests 6 years ago
30-Auth-SAML-with-choice.t Tidy 5 years ago
30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t Fix incorrect SOAP content type in SAML issuer (#2263) 5 years ago
30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t Fix incorrect SOAP content type in SAML issuer (#2263) 5 years ago
30-Auth-and-issuer-SAML-Metadata.t Tidy 5 years ago
30-Auth-and-issuer-SAML-POST-IdP-initiated.t Tidy 5 years ago
30-Auth-and-issuer-SAML-POST-Missing-SLO.t Tidy 5 years ago
30-Auth-and-issuer-SAML-POST.t Unit tests for #2281 5 years ago
30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t Tidy 5 years ago
30-Auth-and-issuer-SAML-Redirect-MultipleSP-Missing-SLO.t Tidy 5 years ago
30-Auth-and-issuer-SAML-Redirect-MultipleSP.t Tidy 5 years ago
30-Auth-and-issuer-SAML-Redirect-With-Info.t Tidy 5 years ago
30-Auth-and-issuer-SAML-Redirect.t Tidy 5 years ago
30-CDC.t Tidy 5 years ago
30-SAML-Head-to-Tail-POST.t Tidy 5 years ago
30-SAML-Macros.t Unit tests for #2280 5 years ago
30-SAML-POST-Logout-when-expired.t Fix unit test (bad tidy?) 5 years ago
30-SAML-POST-Logout-when-removed.t Typo (#2184) 5 years ago
30-SAML-POST-with-2F-UpgradeOnly.t Unit tests for #2124 5 years ago
30-SAML-POST-with-2F-and-Notification.t Tidy 5 years ago
30-SAML-POST-with-Notification.t Tidy 5 years ago
30-SAML-ReAuth-with-choice.t Fix unit tests for new renew session URL (#2124) 5 years ago
30-SAML-ReAuth.t Fix unit tests for new renew session URL (#2124) 5 years ago
30-SAML-SP-rule.t Tidy 5 years ago
31-Auth-and-issuer-CAS-Logout-20.t Tidy 5 years ago
31-Auth-and-issuer-CAS-Logout-30.t Tidy 5 years ago
31-Auth-and-issuer-CAS-XSS-on-logout.t Tidy 5 years ago
31-Auth-and-issuer-CAS-declared-app-userattr.t Tidy 5 years ago
31-Auth-and-issuer-CAS-declared-app.t Tidy 5 years ago
31-Auth-and-issuer-CAS-declared-apps.t Tidy 5 years ago
31-Auth-and-issuer-CAS-default.t Do not use arrays in REST sessions (#2190) 5 years ago
31-Auth-and-issuer-CAS-gateway.t Tidy 5 years ago
31-Auth-and-issuer-CAS-proxied.t Tidy 5 years ago
31-Auth-and-issuer-CAS-with-choice-and-cancel.t Tidy 5 years ago
31-Auth-and-issuer-CAS-with-choice.t Fix unit tests for new renew session URL (#2124) 5 years ago
32-Auth-and-issuer-OIDC-authorization_code-OP-logout.t Tidy 5 years ago
32-Auth-and-issuer-OIDC-authorization_code-public_client.t Tidy 5 years ago
32-Auth-and-issuer-OIDC-authorization_code-with-authchoice.t Tidy 5 years ago
32-Auth-and-issuer-OIDC-authorization_code-with-info.t refactor unit test 5 years ago
32-Auth-and-issuer-OIDC-authorization_code-with-none-alg.t Tidy 5 years ago
32-Auth-and-issuer-OIDC-authorization_code.t Tidy 5 years ago
32-Auth-and-issuer-OIDC-hybrid.t Tidy 5 years ago
32-Auth-and-issuer-OIDC-implicit-no-token.t Tidy 5 years ago
32-Auth-and-issuer-OIDC-implicit.t Unit tests for #2177 5 years ago
32-Auth-and-issuer-OIDC-sorted.t Tidy 5 years ago
32-CAS-10.t Refactor switch() in portal tests 5 years ago
32-CAS-Macros.t Unit tests for #2280 5 years ago
32-OIDC-Code-Flow-with-2F-UpgradeOnly.t Unit tests for #2124 5 years ago
32-OIDC-Code-Flow-with-2F.t Add unit test for #2142 5 years ago
32-OIDC-Macro.t Unit tests for #2280 5 years ago
32-OIDC-Offline-Session.t Unit tests for #2280 5 years ago
32-OIDC-Password-Grant-with-Bruteforce.t unit test for #2155 5 years ago
32-OIDC-RP-rule.t Tidy 5 years ago
32-OIDC-Refresh-Token.t Unit tests for #2280 5 years ago
32-OIDC-Register.t Tidy 5 years ago
32-OIDC-Token-Introspection.t Improve introspection endpoint (#2096) 5 years ago
32-OIDC-Token-Security.t Allow special characters in scope names (#2168) 5 years ago
33-Auth-and-issuer-OpenID2.t Tidy 5 years ago
34-Auth-Proxy-and-REST-Server.t Tidy 5 years ago
34-Auth-Proxy-and-REST-sessions.t Tidy 5 years ago
34-Auth-Proxy-and-SOAP-Server.t Tidy 5 years ago
35-My-session.t
35-REST-config-backend.t Tidy 5 years ago
35-REST-export-password.t Tidy 5 years ago
35-REST-sessions-with-AuthBasic-handler.t Parallel tests 6 years ago
35-REST-sessions-with-REST-server.t Do not use arrays in REST sessions (#2190) 5 years ago
35-SOAP-config-backend.t Tidy 5 years ago
35-SOAP-sessions-with-SOAP-server.t Tidy 5 years ago
36-Combination-Kerberos-or-Demo.t Parallel tests 6 years ago
36-Combination-with-Choice.t Update combination tests 5 years ago
36-Combination-with-TOTP.t Fix warning messages 5 years ago
36-Combination-with-over.t Update combination tests 5 years ago
36-Combination-with-token.t Update combination tests 5 years ago
36-Combination.t Update combination tests 5 years ago
37-CAS-App-to-SAML-IdP-POST-with-WAYF.t Tidy 5 years ago
37-CAS-App-to-SAML-IdP-POST.t Tidy 5 years ago
37-Issuer-Timeout.t Fix debug leve 5 years ago
37-Logout-from-OIDC-RP-to-SAML-SP.t Tidy 5 years ago
37-OIDC-RP-to-SAML-IdP-GET-with-WAYF.t post confirm to issuer url after restoring (#2142) 5 years ago
37-OIDC-RP-to-SAML-IdP-GET.t post confirm to issuer url after restoring (#2142) 5 years ago
37-OIDC-RP-to-SAML-IdP-POST.t post confirm to issuer url after restoring (#2142) 5 years ago
37-SAML-SP-GET-to-OIDC-OP.t Tidy 5 years ago
37-SAML-SP-GET-to-SAML-with-Logout.t Add unit test for SAML proxy (#2262) 5 years ago
37-SAML-SP-POST-to-CAS-server-with-Choice.t Tidy 5 years ago
37-SAML-SP-POST-to-CAS-server.t Tidy 5 years ago
37-SAML-SP-POST-to-OIDC-OP.t Tidy 5 years ago
38-No-persistent-session.t make tidy with perltidy-20181120 6 years ago
40-Notifications-Explorer-JSON-File.t Typo (#2302) 5 years ago
40-Notifications-Explorer-XML-File.t Typo (#2302) 5 years ago
40-Notifications-JSON-DBI.t Typo (#2302) 5 years ago
40-Notifications-JSON-File-with-token.t Typo (#2302) 5 years ago
40-Notifications-JSON-File.t Typo (#2302) 5 years ago
40-Notifications-JSON-LDAP.t Fix unit test 5 years ago
40-Notifications-JSON-Server.t Adapt unit tests to new HTML code (#2271) 5 years ago
40-Notifications-XML-DBI.t Typo (#2302) 5 years ago
40-Notifications-XML-File.t Typo (#2302) 5 years ago
40-Notifications-XML-Server.t Remove underscores in notifications reference (#2135) 5 years ago
41-Captcha.t Improve unit tests (#2275) 5 years ago
41-Token-with-global-storage.t Update sessionInfo during auth process 5 years ago
41-Token.t Fix unit tests for #2271 5 years ago
42-Register-Demo-with-captcha.t Improve unit test (#2019) 5 years ago
42-Register-Demo-with-token.t Fix Perl dependencies (see RT#129960) 6 years ago
42-Register-Demo.t Fix Perl dependencies (see RT#129960) 6 years ago
42-Register-LDAP.t tidy with new conf 6 years ago
42-Register-Security.t Fix Perl dependencies (see RT#129960) 6 years ago
43-MailPasswordReset-Choice.t Tidy 5 years ago
43-MailPasswordReset-Combination-LDAP.t Unit test for Mail password reset + Combination + LDAP (#1903) 6 years ago
43-MailPasswordReset-DBI.t Tidy 5 years ago
43-MailPasswordReset-LDAP.t tidy with new conf 6 years ago
43-MailPasswordReset-with-captcha.t Improve unit test (#2019) 5 years ago
43-MailPasswordReset-with-token.t Tydy 6 years ago
43-MailPasswordReset.t Disable template cache to avoid translation issues in mail (#1897) 6 years ago
44-CertificateResetByMail-Demo.t Fix warning messages 5 years ago
44-CertificateResetByMail-LDAP.t Add feature to override SOAP Proxy URN (#2100) 5 years ago
50-IssuerGet.t Please use our .perltidyrc 6 years ago
57-GlobalLogout-with-Double-cookies-Single-session.t Improve unit tests (#2275) 5 years ago
57-GlobalLogout-with-Double-cookies.t Tidy 5 years ago
57-GlobalLogout-without-Timer.t Append unit tests (#1999) 6 years ago
57-GlobalLogout.t Append unit test (#1999) 5 years ago
57-LogoutForward.t Tidy 5 years ago
58-DecryptValue-with-custom-function.t Tidy 5 years ago
58-DecryptValue-with-internal-function.t Typo (#2302) 5 years ago
59-Double-cookies-Refresh-and-Logout.t Tidy 5 years ago
59-Double-cookies-for-Double-sessions.t Improve unit tests (#1775) 6 years ago
59-Double-cookies-for-a-Single-session.t Improve cryptographic functions (#1823) 6 years ago
59-Secured-cookie-Refresh-and-Logout.t Tidy 5 years ago
60-Status.t tidy with new conf 6 years ago
61-AdaptativeAuthenticationLevel.t Force logout in unit test (#2336) 5 years ago
61-BruteForceProtection-with-Incremental-lockTimes-and-TOTP.t Fix unit tests (#2276) 5 years ago
61-BruteForceProtection-with-Incremental-lockTimes.t Fix unit tests (#2276) 5 years ago
61-BruteForceProtection.t Use Time::Fake to avoid sleeping during tests 6 years ago
61-ForceAuthn.t Use Time::Fake to avoid sleeping during tests 6 years ago
61-GrantSession.t Tidy 5 years ago
61-Session-ActivityTimeout.t Tidy 5 years ago
61-Session-Timeout.t Tidy 5 years ago
62-Refresh-plugin.t Tidy 5 years ago
62-SingleSession-with-History.t Append unit test (#2180) 5 years ago
62-SingleSession-with-Rules.t Unit test for #2164 5 years ago
62-SingleSession.t Improve unit tests (#2275) 5 years ago
62-UpgradeSession.t Tidy 5 years ago
63-History.t tidy with new conf 6 years ago
64-StayConnected.t tidy with new conf 6 years ago
65-AutoSignin.t Skip bad rule & improve unit test (#2102) 5 years ago
66-CDA-PSGI-Try.t Tidy 5 years ago
66-CDA-already-auth.t Tidy 5 years ago
66-CDA-with-REST.t Tidy 5 years ago
66-CDA-with-SOAP.t Tidy 5 years ago
66-CDA.t Refactor switch() in portal tests 5 years ago
67-CheckUser-with-Global-token.t Update unit tests (#2314) 5 years ago
67-CheckUser-with-Impersonation-and-Macros.t Update unit tests (#2314) 5 years ago
67-CheckUser-with-UnrestrictedUser.t Update unit tests (#2314) 5 years ago
67-CheckUser-with-issuer-SAML-POST.t Tidy 5 years ago
67-CheckUser-with-rules.t Improve unit test (#2315) 5 years ago
67-CheckUser-with-token.t Update unit tests (#2314) 5 years ago
67-CheckUser.t Typo (#2302) 5 years ago
68-ContextSwitching-with-Impersonation.t Improve unit test (#2273) 5 years ago
68-ContextSwitching-with-Logout.t Fix ContextSwitching redirect & update unit tests (#2273) 5 years ago
68-ContextSwitching-with-TOTP-and-Notification.t Update unit tests (#2314) 5 years ago
68-ContextSwitching-with-UnrestrictedUser.t Fix ContextSwitching redirect & update unit tests (#2273) 5 years ago
68-ContextSwitching.t Tidy 5 years ago
68-Impersonation-with-History.t Append unit tests (#2207) 5 years ago
68-Impersonation-with-SFA.t Better fix and improve unit test (#2337) 5 years ago
68-Impersonation-with-TOTP.t Append unit test (#2333) 5 years ago
68-Impersonation-with-UnrestrictedUser.t Tidy 5 years ago
68-Impersonation-with-doubleCookies.t Tidy 5 years ago
68-Impersonation-with-filtered-merge.t Improve unit test (#2229) 5 years ago
68-Impersonation-with-merge.t Improve unit test (#2229) 5 years ago
68-Impersonation.t Tidy 5 years ago
70-2F-TOTP-8-with-global-storage.t Tidy 5 years ago
70-2F-TOTP-and-U2F-with-TTL-and-JSON.t Fix unit test (#2271) 5 years ago
70-2F-TOTP-with-History-and-Refresh.t Tidy 5 years ago
70-2F-TOTP-with-TTL-and-JSON.t Adapt unit tests to new HTML code (#2271) 5 years ago
70-2F-TOTP-with-TTL-and-XML.t Fix temporary directories in tests 5 years ago
70-2F-TOTP-with-TTL.t Better fix and improve unit test (#2337) 5 years ago
71-2F-U2F-with-History.t Append unit test (#1632) 6 years ago
71-2F-U2F-with-TTL-and-msg.t Improve unit tests 5 years ago
71-2F-U2F-with-TTL.t Use Time::Fake to avoid sleeping during tests 6 years ago
71-2F-U2F.t Better fix and improve unit test (#2337) 5 years ago
72-2F-REST-with-History.t fix param transmission in rest2f (#2123) 5 years ago
73-2F-UTOTP-TOTP-and-U2F-with-History.t Append unit test (#1632) 6 years ago
73-2F-UTOTP-TOTP-and-U2F.t tidy with new conf 6 years ago
73-2F-UTOTP-TOTP-only-with-History.t Append unit test (#1632) 6 years ago
73-2F-UTOTP-TOTP-only.t tidy with new conf 6 years ago
74-2F-Required.t Improve unit tests (#2275) 5 years ago
75-2F-Registers.t Improve unit tests (#2185) 5 years ago
76-2F-Ext-with-BruteForce.t Don t prompt second factor after a failed log in attempt (#2088) 5 years ago
76-2F-Ext-with-CodeActivation.t Adapt unit test to new HTML code (#2038) 6 years ago
76-2F-Ext-with-GrantSession.t Adapt unit test to new HTML code (#2038) 6 years ago
76-2F-Ext-with-History.t Tidy 5 years ago
77-2F-Extra.t Add an easy way to set level of additional second factors (#2149) 5 years ago
77-2F-Mail-with-global-storage.t Update sessionInfo during auth process to improve handler in-memory sessions security & Improve unit tests 5 years ago
77-2F-Mail.t Adapt unit test to new HTML code (#2038) 6 years ago
78-2F-Upgrade-Many.t Add unit test for #2151 5 years ago
78-2F-Upgrade.t Tidy 5 years ago
78-2F-UpgradeOnly.t Unit tests for #2124 5 years ago
79-2F-Yubikey-from-Session.t Some little things 5 years ago
79-2F-Yubikey.t Add yubikey unit test 5 years ago
90-Translations.t Add missing Finnish flag 6 years ago
91-Memory-Leak.t Tidy 5 years ago
99-Dont-load-Dumper.t Tidy 5 years ago
99-pod.t
README.md Remove trailing whitespaces 6 years ago
lmConf-1.json Fix typo in test conf 5 years ago
oidc-lib.pm OIDC refactoring 5 years ago
pdata.pm
saml-lib.pm Add unit test for SAML proxy (#2262) 5 years ago
sendCode.pl Please use our .perltidyrc 6 years ago
sendOTP.pl
separate-handler.pm Tydy 6 years ago
smtp.pm
test-ldap.pm Tidy 5 years ago
test-lib.pm Improve unit tests (#2275) 5 years ago
test-psgi.pm tidy with new conf 6 years ago
test-yubikey.pm Add yubikey unit test 5 years ago
vrfyOTP.pl

README.md

NAME

test-lib.pm - Test framework for LLNG portal

SYNOPSIS

use Test::More;
use strict;
use IO::String;

require 't/test-lib.pm';

my $res;

my $client = LLNG::Manager::Test->new( {
    ini => {
        logLevel => 'error',
        #...
    }
  }
);

ok(
    $res = $client->_post(
        '/',
        IO::String->new('user=dwho&password=dwho'),
        length => 23
    ),
    'Auth query'
);
count(1);
expectOK($res);
my $id = expectCookie($res);

clean_sessions();
done_testing( count() );

DESCRIPTION

This test library permits to simulate browser navigation.

Functions

In these functions, $res is the result of a LLNG::Manager::Test::_get() or LLNG::Manager::Test::_post() call (see below).

count($inc)

Returns number of tests done. Increment test number if an argument is given

explain( $result, $expected_result )

Used to display error if test fails:

ok( $res->[0] == 302, 'Get redirection' ) or
  explain( $res->[0], 302 );

clean_sessions()

Clean sessions created during tests

expectRedirection( $res, $location )

Verify that request result is a redirection to $location. $location can be:

  • a string: location must match exactly

  • a regexp: location must match this regexp. In this case, the list of matching strings are returned. Example:

      my( $uri, $query ) = expectRedirection( $res, qr#http://host(/[^\?]*)?(.*)$# );
    

expectAutoPost(@args)

Same behaviour as expectForm() but verify also that form method is post.

TODO: verify javascript

expectForm( $res, $hostRe, $uriRe, @requiredFields )

Verify form in HTML result and return ( $host, $uri, $query, $method ):

  • verify that a GET/POST form exists
  • if a $hostRe regexp is given, verify that form target matches and populates $host. Skipped if $hostRe eq "#"
  • if a $uriRe regexp is given, verify that form target matches and populates $uri
  • if @requiredFields exists, verify that each element is an input name
  • build form-url-encoded string looking at parameters/values and store it in $query

expectAuthenticatedAs($user)

Verify that result has a Lm-Remote-User header and value is $user

expectOK($res)

Verify that returned code is 200

expectBadRequest($res)

Verify that returned code is 400. Note that it works only for Ajax request (see below).

expectReject( $res, $code )

Verify that returned code is 401 and JSON result contains error:"$code". Note that it works only for Ajax request (see below).

expectCookie( $res, $cookieName )

Check if a Set-Cookie exists and set a cookie named $cookieName. Return its value.

exceptCspFormOK( $res, $host )

Verify that Content-Security-Policy header allows to connect to $host.

getCookies($res)

Returns an hash ref with names => values of cookies set by server.

getHeader( $res, $hname )

Returns value of first header named $hname in $res response.

getRedirection($res)

Returns value of Location header.

getUser($res)

Returns value of Lm-Remote-User header.

LLNG::Manager::Test Class

Accessors

  • app: built application
  • class: class to test (default Lemonldap::NG::Portal::Main)
  • p: portal object
  • ini: initialization parameters ($defaultIni values + given parameters)

Methods

logout($id)

Launch a /?logout=1 request an test:

  • if response is 200
  • if cookie 'lemonldap' and 'lemonldappdata' have no value
  • if a GET request with previous cookie value ($i) is rejected

_get( $path, %args )

Simulates a GET requests to $path. Accepted arguments:

  • accept: accepted content, default to Ajax request. Use 'text/html' to test content (to launch a expectForm() for example).
  • cookie: full cookie string
  • custom: additional headers (hash ref only)
  • ip: remote address. Default to 127.0.0.1
  • method: default to GET. Only GET/DELETE values are acceptable (use _post() if you want to launch a POST/PUT request)
  • query: query string
  • referer
  • remote_user: REMOTE_USER header value

_post( $path, $body, %args )

Same as _get except that a body is required. $body must be a file handle. Example with IO::String:

ok(
    $res = $client->_post(
        '/',
        IO::String->new('user=dwho&password=dwho'),
        length => 23
    ),
    'Auth query'
);

_delete( $path, %args )

Call _get() with method set to DELETE.

_put( $path, $body, %args )

Call _post() with method set to PUT