Lines 16-25
Link Here
|
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
use Test::More tests => 10; |
19 |
use Test::More tests => 13; |
|
|
20 |
use Test::Warn; |
20 |
|
21 |
|
21 |
use C4::Auth qw / in_ipset /; |
22 |
use C4::Auth qw / in_ipset /; |
22 |
use warnings; |
|
|
23 |
|
23 |
|
24 |
$ENV{REMOTE_ADDR} = '192.168.1.30'; |
24 |
$ENV{REMOTE_ADDR} = '192.168.1.30'; |
25 |
my $ipset1 = "192.168.1.30"; |
25 |
my $ipset1 = "192.168.1.30"; |
Lines 34-36
ok(in_ipset("192.168.1.10-192.168.1.30"), 'validly represented ip range with rem
Link Here
|
34 |
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'); |
34 |
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'); |
35 |
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"); |
35 |
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"); |
36 |
ok(in_ipset(""), "blank list given, no preference set - implies everything goes through."); |
36 |
ok(in_ipset(""), "blank list given, no preference set - implies everything goes through."); |
37 |
- |
37 |
ok(in_ipset(), "no list given, no preference set - implies everything goes through."); |
|
|
38 |
ok(in_ipset("192.168.1.1/36"), 'simple invalid ip range/36 with remote ip in it'); |
39 |
$ENV{DEBUG} = 1; |
40 |
warning_like { in_ipset("192.168.1.1/36") } |
41 |
qr/cidrlookup failed for/, |
42 |
'noisy simple invalid ip range/36 with remote ip in it'; |