Bug 32979: Skip test if running as root
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7a8a2d7110
)
This commit is contained in:
parent
1575f81c8b
commit
94f01de8ab
1 changed files with 9 additions and 3 deletions
12
t/Logger.t
12
t/Logger.t
|
@ -47,10 +47,16 @@ HERE
|
|||
|
||||
t::lib::Mocks::mock_config('log4perl_conf', $config_file);
|
||||
|
||||
system("chmod 400 $log");
|
||||
throws_ok { Koha::Logger->get } qr/Permission denied/, 'Logger did not init correctly without permission';
|
||||
my $login = getlogin || getpwuid($<) || q{};
|
||||
|
||||
SKIP: {
|
||||
skip "Running as root user", 1 if $login eq 'root';
|
||||
|
||||
system("chmod 400 $log");
|
||||
throws_ok { Koha::Logger->get } qr/Permission denied/, 'Logger did not init correctly without permission';
|
||||
system("chmod 700 $log");
|
||||
}
|
||||
|
||||
system("chmod 700 $log");
|
||||
my $logger = Koha::Logger->get( { interface => 'intranet' } );
|
||||
is( exists $logger->{logger}, 1, 'Log4perl config found');
|
||||
is( $logger->warn('Message 1'), 1, '->warn returned a value' );
|
||||
|
|
Loading…
Reference in a new issue