Bugzilla – Attachment 146845 Details for
Bug 32979
Add Test::Exception to Logger.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32979: Skip test if running as root
Bug-32979-Skip-test-if-running-as-root.patch (text/plain), 1.22 KB, created by
Kyle M Hall (khall)
on 2023-02-17 13:48:51 UTC
(
hide
)
Description:
Bug 32979: Skip test if running as root
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-02-17 13:48:51 UTC
Size:
1.22 KB
patch
obsolete
>From 5f7e575b472249603d135110e374508047534301 Mon Sep 17 00:00:00 2001 >From: John Doe <you@example.com> >Date: Fri, 17 Feb 2023 13:46:58 +0000 >Subject: [PATCH] Bug 32979: Skip test if running as root > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/Logger.t | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >diff --git a/t/Logger.t b/t/Logger.t >index b51acd2aea..2b63c8efa5 100755 >--- a/t/Logger.t >+++ b/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' ); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32979
:
146727
|
146728
|
146844
| 146845