Add basic unit tests for AuthProxy + associated fixes
authorDan Scott <dscott@laurentian.ca>
Fri, 10 Feb 2012 03:24:03 +0000 (22:24 -0500)
committerDan Wells <dbw2@calvin.edu>
Sat, 10 Mar 2012 02:52:46 +0000 (21:52 -0500)
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 <dscott@laurentian.ca>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/extras/Makefile.install
Open-ILS/src/perlmods/lib/OpenILS/Application/AuthProxy.pm
Open-ILS/src/perlmods/t/20-OpenILS-Application-AuthProxy.t [new file with mode: 0644]

index 6c7abe7..6905c70 100644 (file)
@@ -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 \
index 86ab610..be1d05b 100644 (file)
@@ -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 (file)
index 0000000..ece37e7
--- /dev/null
@@ -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');