Append unit test (#2657)

This commit is contained in:
Christophe Maudoux 2021-11-16 23:04:59 +01:00
parent 5ffd909d7d
commit adc96ee774
2 changed files with 29 additions and 4 deletions

View File

@ -9,10 +9,12 @@ require 't/test-lib.pm';
my $res;
my $client = LLNG::Manager::Test->new( {
ini => {
logLevel => 'error',
passwordDB => 'Demo',
impersonationRule => 1,
customPlugins => 't::AfterDataCustomPlugin',
logLevel => 'debug',
passwordDB => 'Demo',
impersonationRule => 1,
customFunctions => 'My::accesToTrace My::return0,, My::return1 ',
customPlugins =>
't::AfterDataCustomPlugin t::CasHookPlugin,, t::OidcHookPlugin ',
customPluginsParams => { uid => 'rtyler' }
}
}

View File

@ -0,0 +1,23 @@
package My;
sub accessToTrace {
my $hash = shift;
my $custom = $hash->{custom};
my $req = $hash->{req};
my $vhost = $hash->{vhost};
my $params = $hash->{params};
my $session = $hash->{session};
return
"$custom alias $params->[0]_$params->[1]:$session->{groups} by using $session->{ $params->[2] }";
}
sub return0 {
return 0;
}
sub return1 {
return 1;
}
1;