Bugzilla – Attachment 88864 Details for
Bug 14407
Limit web-based self-checkout to specific IP addresses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14407: Unit tests for in_ipset
Bug-14407-Unit-tests-for-inipset.patch (text/plain), 2.50 KB, created by
Marcel de Rooy
on 2019-04-26 08:24:07 UTC
(
hide
)
Description:
Bug 14407: Unit tests for in_ipset
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2019-04-26 08:24:07 UTC
Size:
2.50 KB
patch
obsolete
>From c25b5635f6074ac0165296145cbe11ad41fb41c5 Mon Sep 17 00:00:00 2001 >From: Nicholas can Oudtshoorn <vanoudt@gmail.com> >Date: Fri, 12 Jan 2018 18:14:59 +0000 >Subject: [PATCH] Bug 14407: Unit tests for in_ipset >Content-Type: text/plain; charset=utf-8 > >TEST PLAN >--------- >1) apply all pathches >2) sudo koha-shell -c bash kohadev > prove t/Auth.t > -- should run. >3) run koha qa test tools > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/Auth.t | 36 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 36 insertions(+) > create mode 100644 t/Auth.t > >diff --git a/t/Auth.t b/t/Auth.t >new file mode 100644 >index 0000000000..606a454762 >--- /dev/null >+++ b/t/Auth.t >@@ -0,0 +1,36 @@ >+# This file is part of Koha. >+# >+# Copyright (C) 2017 Nicholas van Oudtshoorn >+# >+# 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 <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use Test::More tests => 10; >+ >+use C4::Auth qw / in_ipset /; >+use warnings; >+ >+$ENV{REMOTE_ADDR} = '192.168.1.30'; >+my $ipset1 = "192.168.1.30"; >+ >+ok(in_ipset("192.168.1.30"), 'simple single ip matching remote ip'); >+ok(!in_ipset("192.168.1.31"), 'simple single ip not match remote ip'); >+ok(in_ipset("192.168.1.1/24"), 'simple ip range/24 with remote ip in it'); >+ok(!in_ipset("192.168.2.1/24"), 'simple ip range/24 with remote ip not in it'); >+ok(in_ipset("192.168.2.1/16"), 'simple ip range/16 with remote ip in it'); >+ok(!in_ipset("192.168.1.10-30"), 'invalidly represented IP range with remote ip in it'); >+ok(in_ipset("192.168.1.10-192.168.1.30"), 'validly represented ip range with remote ip in it'); >+ok(in_ipset("127.0.0.1 192.168.1.30 192.168.2.10-192.168.2.25"), 'multiple ips and ranges, including the remote ip'); >+ok(!in_ipset("127.0.0.1 8.8.8.8 192.168.2.1/24 192.168.3.1/24 192.168.1.1-192.168.1.29"), "multiple ip and ip ranges, with the remote ip in none of them"); >+ok(in_ipset(""), "blank list given, no preference set - implies everything goes through."); >-- >2.11.0
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 14407
:
40612
|
40613
|
40852
|
40854
|
45894
|
45898
|
45899
|
51812
|
51813
|
53760
|
54560
|
55746
|
56064
|
56065
|
56066
|
68834
|
68835
|
68836
|
70475
|
70476
|
73316
|
73318
|
73339
|
73340
|
73341
|
73342
|
80735
|
80736
|
80737
|
80738
|
86123
|
88863
| 88864 |
88865
|
88866
|
89114