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.
78 lines
1.7 KiB
78 lines
1.7 KiB
|
19 years ago
|
# 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';
|
||
|
|
|
||
|
19 years ago
|
package My::Package;
|
||
|
|
|
||
|
12 years ago
|
use Test::More tests => 5;
|
||
|
19 years ago
|
|
||
|
|
BEGIN {
|
||
|
12 years ago
|
use_ok('Lemonldap::NG::Handler::Reload');
|
||
|
19 years ago
|
}
|
||
|
19 years ago
|
|
||
|
|
#########################
|
||
|
|
|
||
|
|
# 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.
|
||
|
|
|
||
|
12 years ago
|
my $globalinit;
|
||
|
19 years ago
|
|
||
|
12 years ago
|
open STDERR, '>/dev/null';
|
||
|
|
|
||
|
|
ok(
|
||
|
12 years ago
|
$globalinit = Lemonldap::NG::Handler::Reload->new(
|
||
|
12 years ago
|
customFunctions => "",
|
||
|
|
useSafeJail => 1,
|
||
|
|
),
|
||
|
|
'constructor'
|
||
|
|
);
|
||
|
|
|
||
|
|
ok(
|
||
|
|
$globalinit->defaultValuesInit(
|
||
|
|
( map { undef } 1 .. 16 ),
|
||
|
12 years ago
|
{
|
||
|
|
https => 0,
|
||
|
|
port => 0,
|
||
|
|
maintenance => 0,
|
||
|
|
vhostOptions => {
|
||
|
|
www1 => {
|
||
|
|
vhostHttps => 1,
|
||
|
|
vhostPort => 443,
|
||
|
|
vhostMaintenance => 1,
|
||
|
|
vhostAliases => 'www2 www3',
|
||
|
|
|
||
|
|
}
|
||
|
|
},
|
||
|
|
}
|
||
|
|
),
|
||
|
|
'defaultValuesInit'
|
||
|
|
);
|
||
|
|
|
||
|
19 years ago
|
ok(
|
||
|
12 years ago
|
$globalinit->locationRulesInit(
|
||
|
|
( map { undef } 1 .. 8 ),
|
||
|
19 years ago
|
{
|
||
|
12 years ago
|
'locationRules' => {
|
||
|
|
'www1' => {
|
||
|
|
'default' => 'accept',
|
||
|
|
'^/no' => 'deny',
|
||
|
|
'test' => '$groups =~ /\badmin\b/',
|
||
|
|
}
|
||
|
|
}
|
||
|
19 years ago
|
}
|
||
|
18 years ago
|
),
|
||
|
|
'locationRulesInit'
|
||
|
19 years ago
|
);
|
||
|
|
|
||
|
|
ok(
|
||
|
12 years ago
|
$globalinit->forgeHeadersInit(
|
||
|
|
( map { undef } 1 .. 1 ),
|
||
|
19 years ago
|
{ exportedHeaders => { www1 => { Auth => '$uid', } } }
|
||
|
18 years ago
|
),
|
||
|
|
'forgeHeadersInit'
|
||
|
19 years ago
|
);
|
||
|
|
|