lemonldap-ng/lemonldap-ng-handler/t/05-Lemonldap-NG-Handler-Reload.t

97 lines
2.2 KiB
Perl
Raw Normal View History

# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Handler-Vhost.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
package My::Package;
2017-02-12 21:09:46 +01:00
use Test::More tests => 6;
BEGIN {
use_ok('Lemonldap::NG::Handler::Main');
}
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
my $globalinit;
my $tsv = {};
2017-02-12 21:09:46 +01:00
sub Lemonldap::NG::Handler::Main::defaultLogger {
'Lemonldap::NG::Common::Logger::Std';
}
eval { Lemonldap::NG::Handler::Main->logLevelInit('error') };
ok( !$@, 'logLevelInit' );
ok(
Lemonldap::NG::Handler::Main->jailInit(
{
https => 0,
port => 0,
maintenance => 0,
vhostOptions => {
www1 => {
vhostHttps => 1,
vhostPort => 443,
vhostMaintenance => 1,
vhostAliases => 'www2 www3',
}
},
},
$tsv
),
'defaultValuesInit'
);
2013-10-03 12:48:52 +02:00
ok(
Lemonldap::NG::Handler::Main->defaultValuesInit(
2013-10-03 12:48:52 +02:00
{
https => 0,
port => 0,
maintenance => 0,
vhostOptions => {
www1 => {
vhostHttps => 1,
vhostPort => 443,
vhostMaintenance => 1,
vhostAliases => 'www2 www3',
}
},
},
$tsv
2013-10-03 12:48:52 +02:00
),
'defaultValuesInit'
);
ok(
Lemonldap::NG::Handler::Main->locationRulesInit(
{
'locationRules' => {
'www1' => {
'default' => 'accept',
'^/no' => 'deny',
'test' => '$groups =~ /\badmin\b/',
}
}
},
$tsv
),
'locationRulesInit'
);
ok(
Lemonldap::NG::Handler::Main->headersInit(
2014-07-24 17:48:32 +02:00
{ exportedHeaders => { www1 => { Auth => '$uid', } } }, $tsv
),
'forgeHeadersInit'
);