Commit 74dc2c3e authored by Xavier Guimard's avatar Xavier Guimard

Enable test for custom functions

parent 6fe556f3
......@@ -427,6 +427,7 @@ plackup:
-I`pwd`/lemonldap-ng-portal/blib/lib/ \
-I`pwd`/lemonldap-ng-manager/blib/lib/ \
e2e-tests/conf/sbin/llng-fastcgi-server \
-f e2e-tests/custom.pm \
-F >e2e-tests/conf/fastcgi.log 2>&1 &
install_test:
......
......@@ -6,4 +6,5 @@ SetEnv LLNG_DEFAULTCONFFILE __pwd__/e2e-tests/conf/lemonldap-ng.ini
use lib "__pwd__/lemonldap-ng-handler/blib/lib";
use lib "__pwd__/lemonldap-ng-portal/blib/lib";
use lib "__pwd__/lemonldap-ng-manager/blib/lib";
require "__pwd__/e2e-tests/custom.pm";
</perl>
'use strict';
describe('Lemonldap::NG handler', function() {
describe('Header insertion mechanism', function() {
it('should display headers', function() {
browser.driver.get('http://test1.example.com:' + process.env.TESTWEBSERVERPORT + '/');
expect(browser.driver.findElement(by.id('v-Auth-User')).getText()).toEqual('dwho');
expect(browser.driver.findElement(by.id('v-Ip-Addr')).getText()).toMatch(/^\d+\.\d+\.\d+\.\d+$/);
});
it('should display custom functions results', function() {
expect(browser.driver.findElement(by.id('v-Hello')).getText()).toEqual('Hello');
expect(browser.driver.findElement(by.id('v-Uri')).getText()).toEqual('/');
expect(browser.driver.findElement(by.id('v-Additional-Arg')).getText()).toEqual('header-added');
});
});
});
......@@ -90,6 +90,7 @@
"cfgLog": "Default configuration provided by LemonLDAP::NG team",
"cfgNum": "1",
"cookieName": "lemonldap",
"customFunctions": "My::hello My::get_uri My::get_additional_arg",
"demoExportedVars": {
"cn": "cn",
"mail": "mail",
......@@ -99,7 +100,10 @@
"exportedHeaders": {
"test1.example.com": {
"Auth-User": "$uid",
"Ip-Addr": "$ipAddr"
"Ip-Addr": "$ipAddr",
"Hello": "hello()",
"Uri": "get_uri()",
"Additional-Arg": "get_additional_arg('header-added')"
},
"test2.example.com": {
"Auth-User": "$uid"
......@@ -179,4 +183,4 @@
"timeout": 72000,
"userDB": "Demo",
"whatToTrace": "_whatToTrace"
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment