From 185a7b030f0298eaeff105253d00de733fc1b0f6 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 9 Feb 2012 22:24:03 -0500 Subject: [PATCH] Add basic unit tests for AuthProxy + associated fixes The basic "will it load?" unit tests for AuthProxy* turned up a few requirements: 1. Add install of Net::LDAP to Makefile.install 2. Initialize the OpenSRF cache after bootstrapping Signed-off-by: Dan Scott Signed-off-by: Dan Wells --- Open-ILS/src/extras/Makefile.install | 2 ++ .../src/perlmods/lib/OpenILS/Application/AuthProxy.pm | 3 ++- .../src/perlmods/t/20-OpenILS-Application-AuthProxy.t | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/perlmods/t/20-OpenILS-Application-AuthProxy.t diff --git a/Open-ILS/src/extras/Makefile.install b/Open-ILS/src/extras/Makefile.install index 6c7abe7eee..6905c70eaa 100644 --- a/Open-ILS/src/extras/Makefile.install +++ b/Open-ILS/src/extras/Makefile.install @@ -93,6 +93,7 @@ DEBS = \ liblog-log4perl-perl\ libmarc-record-perl\ libncurses5-dev\ + libnet-ldap-perl \ libnet-server-perl\ libnet-ssh2-perl\ libnspr4-dev\ @@ -188,6 +189,7 @@ FEDORA_RPMS = \ perl-Email-Simple \ perl-GDGraph3d \ perl-JSON-XS \ + perl-LDAP \ perl-Locale-Codes \ perl-Net-IP \ perl-Net-SSH2 \ diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AuthProxy.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AuthProxy.pm index 86ab610acd..be1d05b7f4 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AuthProxy.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AuthProxy.pm @@ -46,13 +46,14 @@ my $U = 'OpenILS::Application::AppUtils'; my @authenticators; my %authenticators_by_name; my $enabled = 'false'; -my $cache = OpenSRF::Utils::Cache->new(); +my $cache; my $seed_timeout; my $block_timeout; my $block_count; sub initialize { my $conf = OpenSRF::Utils::SettingsClient->new; + $cache = OpenSRF::Utils::Cache->new(); my @pfx = ( "apps", "open-ils.auth", "app_settings", "auth_limits" ); diff --git a/Open-ILS/src/perlmods/t/20-OpenILS-Application-AuthProxy.t b/Open-ILS/src/perlmods/t/20-OpenILS-Application-AuthProxy.t new file mode 100644 index 0000000000..ece37e7642 --- /dev/null +++ b/Open-ILS/src/perlmods/t/20-OpenILS-Application-AuthProxy.t @@ -0,0 +1,10 @@ +#!perl -T + +use Test::More tests => 3; + +BEGIN { + use_ok( 'OpenILS::Application::AuthProxy' ); +} + +use_ok( 'OpenILS::Application::AuthProxy::AuthBase'); +use_ok( 'OpenILS::Application::AuthProxy::LDAP_Auth'); -- 2.43.2