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
Christophe Maudoux 583bbbe285 Append CSP frame-ancestors option & Improve unit test (#2068) 5 years ago
..
gpghome
lib Append unit test (#1956) 6 years ago
sessions
sessions2
testslapd Add unit test and fix code for ppolicy grace (#1691) 6 years ago
01-AuthDemo.t Tydy 6 years ago
01-CSP-and-CORS-headers.t Append CSP frame-ancestors option & Improve unit test (#2068) 5 years ago
01-pdata.t
02-Password-Demo-Local-Ppolicy.t Local password policy: minimal digits (#993) 6 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 Fix test (#1908) 6 years ago
03-XSS-protection.t Typo 6 years ago
04-language-selection.t Tidy 6 years ago
19-Auth-Null.t
20-Auth-DBI-utf8.t new expectJSON function in test-lib 6 years ago
20-Auth-and-password-DBI-dynamic-hash.t Parallel tests 6 years ago
20-Auth-and-password-DBI.t Parallel tests 6 years ago
21-Auth-LDAP-Policy.t Fix some warnings in tests 6 years ago
21-Auth-LDAP-utf8.t
21-Auth-and-password-LDAP.t Validate LDAP connections in getUser (#2018) 6 years ago
22-Auth-and-password-AD.t
23-Auth-and-password-REST.t
24-AuthApache.t
24-AuthKerberos.t
25-AuthSlave-with-Choice.t Improve unit tests (#1935) 6 years ago
25-AuthSlave-with-Credentials.t Improve unit tests (#1935) 6 years ago
26-AuthRemote.t
27-AuthProxy.t
28-AuthChoice-and-password.t Parallel tests 6 years ago
28-AuthChoice-with-captcha.t Improve unit test (#2019) 5 years ago
28-AuthChoice-with-over.t Add unit test for #1500 6 years ago
28-AuthChoice-with-rules.t Change defaut value for cspFormAction (#2024) 6 years ago
28-AuthChoice-with-token.t Tidy 6 years ago
29-AuthGPG.t Tydy 6 years ago
29-AuthSSL.t Parallel tests 6 years ago
30-Auth-SAML-with-choice.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-Auth-and-issuer-SAML-Metadata.t Tydy 6 years ago
30-Auth-and-issuer-SAML-POST-IdP-initiated.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-Auth-and-issuer-SAML-POST-Missing-SLO.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-Auth-and-issuer-SAML-POST.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-Auth-and-issuer-SAML-Redirect-MultipleSP-Missing-SLO.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-Auth-and-issuer-SAML-Redirect-MultipleSP.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-Auth-and-issuer-SAML-Redirect.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-CDC.t Remove IDP cookie (#1941) 6 years ago
30-SAML-Head-to-Tail-POST.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-SAML-Macros.t SAML per-service macros portal code (#2042) 6 years ago
30-SAML-POST-Logout-when-expired.t Use Time::Fake to avoid sleeping during tests 6 years ago
30-SAML-POST-with-2F-and-Notification.t Adapt unit test to new HTML code (#2038) 6 years ago
30-SAML-POST-with-Notification.t Fix cookie removal on SAML logout (#2001) 6 years ago
30-SAML-ReAuth-with-choice.t Use Time::Fake to avoid sleeping during tests 6 years ago
30-SAML-ReAuth.t Use Time::Fake to avoid sleeping during tests 6 years ago
30-SAML-SP-rule.t Remove IDP cookie (#1941) 6 years ago
31-Auth-and-issuer-CAS-Logout-20.t Fix Perl dependencies (see RT#129960) 6 years ago
31-Auth-and-issuer-CAS-Logout-30.t Fix Perl dependencies (see RT#129960) 6 years ago
31-Auth-and-issuer-CAS-XSS-on-logout.t Fix Perl dependencies (see RT#129960) 6 years ago
31-Auth-and-issuer-CAS-declared-app-userattr.t Typo 6 years ago
31-Auth-and-issuer-CAS-declared-app.t Typo 6 years ago
31-Auth-and-issuer-CAS-declared-apps.t Disable compactConf by default & Update unit tests (#2046) 6 years ago
31-Auth-and-issuer-CAS-default.t Typo 6 years ago
31-Auth-and-issuer-CAS-gateway.t Fix Perl dependencies (see RT#129960) 6 years ago
31-Auth-and-issuer-CAS-proxied.t Typo 6 years ago
31-Auth-and-issuer-CAS-with-choice-and-cancel.t Parallel tests 6 years ago
31-Auth-and-issuer-CAS-with-choice.t Typo 6 years ago
32-Auth-and-issuer-OIDC-authorization_code-OP-logout.t Update unit tests for #1882 6 years ago
32-Auth-and-issuer-OIDC-authorization_code-public_client.t Update unit tests for #1882 6 years ago
32-Auth-and-issuer-OIDC-authorization_code-with-authchoice.t Update unit tests for #1882 6 years ago
32-Auth-and-issuer-OIDC-authorization_code-with-none-alg.t Update unit tests for #1882 6 years ago
32-Auth-and-issuer-OIDC-authorization_code.t Update unit tests for #1882 6 years ago
32-Auth-and-issuer-OIDC-hybrid.t Update unit tests for #1882 6 years ago
32-Auth-and-issuer-OIDC-implicit-no-token.t Update unit tests for #1882 6 years ago
32-Auth-and-issuer-OIDC-implicit.t Update unit tests for #1882 6 years ago
32-Auth-and-issuer-OIDC-sorted.t Update unit tests for #1882 6 years ago
32-CAS-10.t make tidy with perltidy-20181120 6 years ago
32-CAS-Macros.t CAS per-service macros portal code (#2042) 6 years ago
32-OIDC-Macro.t Update unit tests for #1882 6 years ago
32-OIDC-Offline-Session.t Update unit tests for #1882 6 years ago
32-OIDC-RP-rule.t Update unit tests for #1882 6 years ago
32-OIDC-Refresh-Token.t Update unit tests for #1882 6 years ago
32-OIDC-Register.t Isolate unit test configuration (#2048) 5 years ago
32-OIDC-Token-Introspection.t Update unit tests for #1882 6 years ago
32-OIDC-Token-Security.t Update unit tests for #1882 6 years ago
33-Auth-and-issuer-OpenID2.t Clean tests (#1819) 6 years ago
34-Auth-Proxy-and-REST-Server.t make tidy with perltidy-20181120 6 years ago
34-Auth-Proxy-and-SOAP-Server.t make tidy with perltidy-20181120 6 years ago
35-My-session.t
35-REST-config-backend.t Fix REST service (#1870) 6 years ago
35-REST-export-password.t Clean tests (#1819) 6 years ago
35-REST-sessions-with-AuthBasic-handler.t Parallel tests 6 years ago
35-REST-sessions-with-REST-server.t Clean tests (#1819) 6 years ago
35-SOAP-config-backend.t make tidy with perltidy-20181120 6 years ago
35-SOAP-sessions-with-SOAP-server.t make tidy with perltidy-20181120 6 years ago
36-Combination-Kerberos-or-Demo.t Parallel tests 6 years ago
36-Combination-with-Choice.t Parallel tests 6 years ago
36-Combination-with-TOTP.t Use Time::Fake to avoid sleeping during tests 6 years ago
36-Combination-with-over.t Parallel tests 6 years ago
36-Combination-with-token.t tests: make expectReject more flexible 6 years ago
36-Combination.t Parallel tests 6 years ago
37-CAS-App-to-SAML-IdP-POST-with-WAYF.t Remove IDP cookie (#1941) 6 years ago
37-CAS-App-to-SAML-IdP-POST.t Remove IDP cookie (#1941) 6 years ago
37-Logout-from-OIDC-RP-to-SAML-SP.t Update unit tests for #1882 6 years ago
37-OIDC-RP-to-SAML-IdP-GET-with-WAYF.t Update unit tests for #1882 6 years ago
37-OIDC-RP-to-SAML-IdP-GET.t Update unit tests for #1882 6 years ago
37-OIDC-RP-to-SAML-IdP-POST.t Update unit tests for #1882 6 years ago
37-SAML-SP-GET-to-OIDC-OP.t Update unit tests for #1882 6 years ago
37-SAML-SP-POST-to-CAS-server-with-Choice.t Remove IDP cookie (#1941) 6 years ago
37-SAML-SP-POST-to-CAS-server.t Remove IDP cookie (#1941) 6 years ago
37-SAML-SP-POST-to-OIDC-OP.t Update unit tests for #1882 6 years ago
38-No-persistent-session.t make tidy with perltidy-20181120 6 years ago
40-Notifications-JSON-DBI.t Check only active notifications & Improve unit test - JSON format (#2012) 6 years ago
40-Notifications-JSON-File-with-token.t Parallel tests 6 years ago
40-Notifications-JSON-File.t Parallel tests 6 years ago
40-Notifications-JSON-Server.t Catch error and Improve parameter tests & Improve unit test (#2049) 6 years ago
40-Notifications-XML-DBI.t Check only active notifications & Improve unit test - XML format (#2012) 6 years ago
40-Notifications-XML-File.t Parallel tests 6 years ago
40-Notifications-XML-Server.t Prevent to store notifications with time & Improve unit tests (#2012) 6 years ago
41-Captcha.t Improve unit test (#2057) 5 years ago
41-Token-with-global-storage.t Update sessionInfo during auth process 5 years ago
41-Token.t Improve unit test 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
42-Register-Security.t Fix Perl dependencies (see RT#129960) 6 years ago
43-MailPasswordReset-Choice.t Parallel tests 6 years ago
43-MailPasswordReset-Combination-LDAP.t Unit test for Mail password reset + Combination + LDAP (#1903) 6 years ago
43-MailPasswordReset-DBI.t Parallel tests 6 years ago
43-MailPasswordReset-LDAP.t
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 Improve unit tests 5 years ago
44-CertificateResetByMail-LDAP.t Improve unit tests 5 years ago
50-IssuerGet.t
57-GlobalLogout-without-Timer.t Append unit tests (#1999) 6 years ago
57-GlobalLogout.t Fix warning 6 years ago
58-DecryptValue-with-custom-function.t Typo (#1956) 6 years ago
58-DecryptValue-with-internal-function.t Typo (#1956) 6 years ago
59-Double-cookies-Refresh-and-Logout.t Use Time::Fake to avoid sleeping during tests 6 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 Fix #2005 & improve unit test 6 years ago
60-Status.t
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 Adapt GrantSession plugin to display authentication error on login form (#1666) 6 years ago
61-Session-ActivityTimeout.t Use Time::Fake to avoid sleeping during tests 6 years ago
61-Session-Timeout.t Use Time::Fake to avoid sleeping during tests 6 years ago
62-Refresh-plugin.t Refresh plugin (#2006) 6 years ago
62-SingleSession.t
62-UpgradeSession.t debug -> error 6 years ago
63-History.t
64-StayConnected.t
65-AutoSignin.t
66-CDA-PSGI-Try.t Render CDA compatible with Try (Fixes: #1849) 6 years ago
66-CDA-already-auth.t Clear url pdata on CDA redirection 6 years ago
66-CDA-with-REST.t
66-CDA-with-SOAP.t
66-CDA.t
67-CheckUser-with-Global-token.t Use Time::Fake to avoid sleeping during tests 6 years ago
67-CheckUser-with-Impersonation-and-whatToTrace.t Improve unit test (#1938) 6 years ago
67-CheckUser-with-issuer-SAML-POST.t Fix cookie removal on SAML logout (#2001) 6 years ago
67-CheckUser-with-token.t Fix wrong message & Improve unit test (#2050) 5 years ago
67-CheckUser.t Improve unit test (#1996) 6 years ago
68-ContextSwitching-with-Logout.t Improve unit test (#1783) 6 years ago
68-ContextSwitching.t Improve unit test & fix warning - Expired sessions (#1783) 6 years ago
68-Impersonation-with-History.t Use Time::Fake to avoid sleeping during tests 6 years ago
68-Impersonation-with-TOTP.t Improve displaying checkuser template and rewrite tests #1806 6 years ago
68-Impersonation-with-doubleCookies.t Update sessionInfo during auth process to improve handler in-memory sessions security & Improve unit tests 5 years ago
68-Impersonation-with-filtered-merge.t Fix wrong message & Improve unit test (#2050) 5 years ago
68-Impersonation-with-merge.t Improve displaying checkuser template and rewrite tests #1806 6 years ago
68-Impersonation.t Update sessionInfo during auth process to improve handler in-memory sessions security & Improve unit tests 5 years ago
70-2F-TOTP-8-with-global-storage.t Update sessionInfo during auth process to improve handler in-memory sessions security & Improve unit tests 5 years ago
70-2F-TOTP-with-History.t
70-2F-TOTP-with-TTL-and-JSON.t Use Time::Fake to avoid sleeping during tests 6 years ago
70-2F-TOTP-with-TTL-and-XML.t Use Time::Fake to avoid sleeping during tests 6 years ago
70-2F-TOTP-with-TTL.t Use Time::Fake to avoid sleeping during tests 6 years ago
71-2F-U2F-with-History.t
71-2F-U2F-with-TTL-and-msg.t Use Time::Fake to avoid sleeping during tests 6 years ago
71-2F-U2F-with-TTL.t Use Time::Fake to avoid sleeping during tests 6 years ago
71-2F-U2F.t Improve unit tests (#1796) 6 years ago
72-2F-REST-with-History.t Pass skin parameter in 2F flows (#1915) 6 years ago
73-2F-UTOTP-TOTP-and-U2F-with-History.t
73-2F-UTOTP-TOTP-and-U2F.t
73-2F-UTOTP-TOTP-only-with-History.t
73-2F-UTOTP-TOTP-only.t
74-2F-Required.t
75-2F-Registers.t Use Time::Fake to avoid sleeping during tests 6 years ago
76-2F-Ext-with-BruteForce.t Adapt unit test to new HTML code (#2038) 6 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 Adapt unit test to new HTML code (#2038) 6 years ago
77-2F-Extra.t Adapt unit test to new HTML code (#2038) 6 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.t Update sessionInfo during auth process 5 years ago
90-Translations.t Add missing Finnish flag 6 years ago
99-Dont-load-Dumper.t Disable plugin 5 years ago
99-pod.t
README.md Remove trailing whitespaces 6 years ago
Time-Fake.pm Use Time::Fake to avoid sleeping during tests 6 years ago
lmConf-1.json Improve unit test (#1996) 6 years ago
pdata.pm
saml-lib.pm
sendCode.pl
sendOTP.pl
separate-handler.pm Tydy 6 years ago
smtp.pm
test-ldap.pm Validate LDAP connections in getUser (#2018) 6 years ago
test-lib.pm Isolate unit test configuration (#2048) 5 years ago
test-psgi.pm
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