Bugzilla – Attachment 189595 Details for
Bug 41167
Rewrite Rules missing in etc/koha-httpd.conf
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41167: Add test to compare both apache conf
6df0f48.patch (text/plain), 2.45 KB, created by
Jonathan Druart
on 2025-11-14 11:39:55 UTC
(
hide
)
Description:
Bug 41167: Add test to compare both apache conf
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-11-14 11:39:55 UTC
Size:
2.45 KB
patch
obsolete
>From 6df0f487bb620322b56294aef2ae203cbe2b0526 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 14 Nov 2025 12:39:33 +0100 >Subject: [PATCH] Bug 41167: Add test to compare both apache conf > >--- > xt/check_apache_conf.t | 50 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 50 insertions(+) > create mode 100644 xt/check_apache_conf.t > >diff --git a/xt/check_apache_conf.t b/xt/check_apache_conf.t >new file mode 100644 >index 00000000000..e297571ec59 >--- /dev/null >+++ b/xt/check_apache_conf.t >@@ -0,0 +1,50 @@ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, see <https://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 1; >+ >+#use Test::NoWarnings; >+ >+use Array::Utils qw( array_minus ); >+use File::Slurp qw(read_file); >+ >+subtest 'Intranet RewriteRule statements' => sub { >+ plan tests => 1; >+ my @debian_content = read_file('debian/templates/apache-shared-intranet.conf'); >+ my @httpd_content = read_file('etc/koha-httpd.conf'); >+ >+ my @debian_rewrite_rules = >+ grep { $_ =~ m{RewriteRule|RewriteCond} ? chomp && $_ =~ s#^\s*## && $_ : () } @debian_content; >+ my @httpd_intranet_rewrite_rules; >+ my $pattern = "## Intranet"; >+ my $found = 0; >+ foreach my $line (@httpd_content) { >+ chomp $line; >+ if ( $found && $line =~ m{RewriteRule|RewriteCond} ) { >+ $line =~ s#^\s*##; >+ push @httpd_intranet_rewrite_rules, $line; >+ } elsif ( $line =~ m{$pattern} ) { >+ $found = 1; >+ } >+ } >+ use Data::Printer colored => 1; >+ warn p @debian_rewrite_rules; >+ use Data::Printer colored => 1; >+ warn p @httpd_intranet_rewrite_rules; >+ my @diff = array_minus @debian_rewrite_rules, @httpd_intranet_rewrite_rules; >+ is( scalar(@diff), 0, "All RewriteRule and RewriteCond directives must be copied to etc/koha-httpd.conf" ) >+ or diag @diff; >+}; >-- >2.34.1 >
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 41167
:
188883
|
189141
|
189248
|
189249
|
189252
|
189595
|
189626
|
189627
|
189628