[Rt-commit] rt branch, 4.4/external-auth, updated. rt-4.2.11-183-g534ed41
Todd Wade
todd at bestpractical.com
Mon Nov 2 11:35:27 EST 2015
The branch, 4.4/external-auth has been updated
via 534ed41bb3dafe2f239a14ae2308ef71659d035e (commit)
from 976711f8cd8b84dd66516036136c4d80d7b9a978 (commit)
Summary of changes:
lib/RT/Interface/Web.pm | 4 ++--
t/externalauth/ldap.t | 8 +++++---
t/externalauth/ldap_escaping.t | 8 +++++---
t/externalauth/ldap_group.t | 8 +++++---
t/externalauth/ldap_privileged.t | 8 +++++---
t/externalauth/obfuscate-password.t | 2 +-
t/externalauth/sessions.t | 8 +++++++-
t/externalauth/sqlite.t | 9 ++++++++-
t/ldapimport/group-callbacks.t | 3 +--
t/ldapimport/group-import.t | 6 ++++--
t/ldapimport/group-member-import.t | 2 +-
t/ldapimport/group-rename.t | 2 +-
t/ldapimport/user-import-cfs.t | 4 +++-
t/ldapimport/user-import-privileged.t | 4 +++-
t/ldapimport/user-import.t | 4 +++-
15 files changed, 54 insertions(+), 26 deletions(-)
- Log -----------------------------------------------------------------
commit 534ed41bb3dafe2f239a14ae2308ef71659d035e
Author: Todd Wade <todd at bestpractical.com>
Date: Mon Nov 2 11:35:20 2015 -0500
failing tests
Skip externalauth and ldapimport tests when deps are not available
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index f7003c8..7ab6619 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -309,7 +309,7 @@ sub HandleRequest {
# attempt external auth
$HTML::Mason::Commands::m->comp( '/Elements/DoAuth', %$ARGS )
- if RT->Config->Get('ExernalAuth');
+ if RT->Config->Get('ExternalAuth');
# Process session-related callbacks before any auth attempts
$HTML::Mason::Commands::m->callback( %$ARGS, CallbackName => 'Session', CallbackPage => '/autohandler' );
@@ -324,7 +324,7 @@ sub HandleRequest {
# attempt external auth
$HTML::Mason::Commands::m->comp( '/Elements/DoAuth', %$ARGS )
- if RT->Config->Get('ExernalAuth');
+ if RT->Config->Get('ExternalAuth');
# Process per-page authentication callbacks
$HTML::Mason::Commands::m->callback( %$ARGS, CallbackName => 'Auth', CallbackPage => '/autohandler' );
diff --git a/t/externalauth/ldap.t b/t/externalauth/ldap.t
index 6933770..6226b43 100644
--- a/t/externalauth/ldap.t
+++ b/t/externalauth/ldap.t
@@ -1,10 +1,10 @@
use strict;
use warnings;
-use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
-eval { require Net::LDAP::Server::Test; 1; } or do {
- plan skip_all => 'Unable to test without Net::LDAP::Server::Test';
+eval { require RT::Authen::ExternalAuth; require Net::LDAP::Server::Test; 1; } or do {
+ plan skip_all => 'Unable to test without Net::LDAP and Net::LDAP::Server::Test';
};
@@ -27,6 +27,8 @@ my $entry = {
$ldap->add( $base );
$ldap->add( $dn, attr => [%$entry] );
+RT->Config->Set( ExternalAuth => 1 );
+
RT->Config->Set( ExternalAuthPriority => ['My_LDAP'] );
RT->Config->Set( ExternalInfoPriority => ['My_LDAP'] );
RT->Config->Set( AutoCreateNonExternalUsers => 0 );
diff --git a/t/externalauth/ldap_escaping.t b/t/externalauth/ldap_escaping.t
index 015dc29..cce4e0c 100644
--- a/t/externalauth/ldap_escaping.t
+++ b/t/externalauth/ldap_escaping.t
@@ -1,10 +1,10 @@
use strict;
use warnings;
-use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
-eval { require Net::LDAP::Server::Test; 1; } or do {
- plan skip_all => 'Unable to test without Net::LDAP::Server::Test';
+eval { require RT::Authen::ExternalAuth; require Net::LDAP::Server::Test; 1; } or do {
+ plan skip_all => 'Unable to test without Net::LDAP and Net::LDAP::Server::Test';
};
@@ -48,6 +48,8 @@ $ldap->add(
],
);
+RT->Config->Set( ExternalAuth => 1 );
+
RT->Config->Set( ExternalAuthPriority => ['My_LDAP'] );
RT->Config->Set( ExternalInfoPriority => ['My_LDAP'] );
RT->Config->Set( AutoCreateNonExternalUsers => 0 );
diff --git a/t/externalauth/ldap_group.t b/t/externalauth/ldap_group.t
index b6f9df6..ede53a2 100644
--- a/t/externalauth/ldap_group.t
+++ b/t/externalauth/ldap_group.t
@@ -6,10 +6,10 @@ BEGIN {
$ENV{RT_TEST_WEB_HANDLER} = 'inline';
}
-use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
-eval { require Net::LDAP::Server::Test; 1; } or do {
- plan skip_all => 'Unable to test without Net::LDAP::Server::Test';
+eval { require RT::Authen::ExternalAuth; require Net::LDAP::Server::Test; 1; } or do {
+ plan skip_all => 'Unable to test without Net::LDAP and Net::LDAP::Server::Test';
};
@@ -55,6 +55,8 @@ $ldap->add(
],
);
+RT->Config->Set( ExternalAuth => 1 );
+
#RT->Config->Set( Plugins => 'RT::Authen::ExternalAuth' );
RT->Config->Set( ExternalAuthPriority => ['My_LDAP'] );
RT->Config->Set( ExternalInfoPriority => ['My_LDAP'] );
diff --git a/t/externalauth/ldap_privileged.t b/t/externalauth/ldap_privileged.t
index 6014170..91c1c9b 100644
--- a/t/externalauth/ldap_privileged.t
+++ b/t/externalauth/ldap_privileged.t
@@ -1,10 +1,10 @@
use strict;
use warnings;
-use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
-eval { require Net::LDAP::Server::Test; 1; } or do {
- plan skip_all => 'Unable to test without Net::LDAP::Server::Test';
+eval { require RT::Authen::ExternalAuth; require Net::LDAP::Server::Test; 1; } or do {
+ plan skip_all => 'Unable to test without Net::LDAP and Net::LDAP::Server::Test';
};
my $ldap_port = 1024 + int rand(10000) + $$ % 1024;
@@ -26,6 +26,8 @@ my $entry = {
$ldap->add( $base );
$ldap->add( $dn, attr => [%$entry] );
+RT->Config->Set( ExternalAuth => 1 );
+
RT->Config->Set( ExternalAuthPriority => ['My_LDAP'] );
RT->Config->Set( ExternalInfoPriority => ['My_LDAP'] );
RT->Config->Set( AutoCreateNonExternalUsers => 0 );
diff --git a/t/externalauth/obfuscate-password.t b/t/externalauth/obfuscate-password.t
index a57be5b..cbe8286 100644
--- a/t/externalauth/obfuscate-password.t
+++ b/t/externalauth/obfuscate-password.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
RT->Config->Set(
ExternalSettings => {
diff --git a/t/externalauth/sessions.t b/t/externalauth/sessions.t
index 15470c6..9547c6b 100644
--- a/t/externalauth/sessions.t
+++ b/t/externalauth/sessions.t
@@ -1,7 +1,11 @@
use strict;
use warnings;
-use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
+
+eval { require RT::Authen::ExternalAuth; require Net::LDAP::Server::Test; 1; } or do {
+ plan skip_all => 'Unable to test without Net::LDAP and Net::LDAP::Server::Test';
+};
setup_auth_source();
@@ -90,6 +94,8 @@ sub setup_auth_source {
SQL
}
+ RT->Config->Set( ExternalAuth => 1 );
+
RT->Config->Set( ExternalAuthPriority => ['My_SQLite'] );
RT->Config->Set( ExternalInfoPriority => ['My_SQLite'] );
RT->Config->Set( AutoCreateNonExternalUsers => 0 );
diff --git a/t/externalauth/sqlite.t b/t/externalauth/sqlite.t
index 9b1f8ef..a98e7bc 100644
--- a/t/externalauth/sqlite.t
+++ b/t/externalauth/sqlite.t
@@ -1,7 +1,12 @@
use strict;
use warnings;
-use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
+
+eval { require RT::Authen::ExternalAuth; require Net::LDAP::Server::Test; 1; } or do {
+ plan skip_all => 'Unable to test without Net::LDAP and Net::LDAP::Server::Test';
+};
+
use DBI;
use File::Temp;
use Digest::MD5;
@@ -28,6 +33,8 @@ $dbh->do(
"INSERT INTO $table VALUES ( 'testuser', '$password', 'testuser\@invalid.tld')"
);
+RT->Config->Set( ExternalAuth => 1 );
+
RT->Config->Set( ExternalAuthPriority => ['My_SQLite'] );
RT->Config->Set( ExternalInfoPriority => ['My_SQLite'] );
RT->Config->Set( AutoCreateNonExternalUsers => 0 );
diff --git a/t/ldapimport/group-callbacks.t b/t/ldapimport/group-callbacks.t
index 1bbc7fc..8a7a689 100644
--- a/t/ldapimport/group-callbacks.t
+++ b/t/ldapimport/group-callbacks.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
eval { require RT::LDAPImport; require Net::LDAP::Server::Test; 1; } or do {
plan skip_all => 'Unable to test without RT::LDAPImport and Net::LDAP::Server::Test';
@@ -103,4 +103,3 @@ sub get_group {
return $group;
}
-
diff --git a/t/ldapimport/group-import.t b/t/ldapimport/group-import.t
index 56d82b9..25f8719 100644
--- a/t/ldapimport/group-import.t
+++ b/t/ldapimport/group-import.t
@@ -1,10 +1,10 @@
use strict;
use warnings;
-use RT::Test tests => 88, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
eval { require RT::LDAPImport; require Net::LDAP::Server::Test; 1; } or do {
- plan skip_all => 'Unable to test without Net::LDAP::Server::Test';
+ plan skip_all => 'Unable to test without RT::LDAPImport and Net::LDAP::Server::Test';
};
my $importer = RT::LDAPImport->new;
@@ -152,3 +152,5 @@ sub import_group_members_ok {
);
ok( !$group->Id );
}
+
+done_testing;
diff --git a/t/ldapimport/group-member-import.t b/t/ldapimport/group-member-import.t
index 7d177a7..a0a0266 100644
--- a/t/ldapimport/group-member-import.t
+++ b/t/ldapimport/group-member-import.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
eval { require RT::LDAPImport; require Net::LDAP::Server::Test; 1; } or do {
plan skip_all => 'Unable to test without RT::LDAPImport and Net::LDAP::Server::Test';
diff --git a/t/ldapimport/group-rename.t b/t/ldapimport/group-rename.t
index 48ae313..06207d4 100644
--- a/t/ldapimport/group-rename.t
+++ b/t/ldapimport/group-rename.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
eval { require RT::LDAPImport; require Net::LDAP::Server::Test; 1; } or do {
plan skip_all => 'Unable to test without RT::LDAPImport and Net::LDAP::Server::Test';
diff --git a/t/ldapimport/user-import-cfs.t b/t/ldapimport/user-import-cfs.t
index eadef51..f33ee05 100644
--- a/t/ldapimport/user-import-cfs.t
+++ b/t/ldapimport/user-import-cfs.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use RT::Test tests => 7 + 13*3 + 2*2 + 1, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
eval { require RT::LDAPImport; require Net::LDAP::Server::Test; 1; } or do {
plan skip_all => 'Unable to test without RT::LDAPImport and Net::LDAP::Server::Test';
@@ -105,3 +105,5 @@ for my $entry (@ldap_entries) {
# can't unbind earlier or the server will die
$ldap->unbind;
+
+done_testing;
diff --git a/t/ldapimport/user-import-privileged.t b/t/ldapimport/user-import-privileged.t
index d4bf179..dca751a 100644
--- a/t/ldapimport/user-import-privileged.t
+++ b/t/ldapimport/user-import-privileged.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use RT::Test tests => 5 + 13*2, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
eval { require RT::LDAPImport; require Net::LDAP::Server::Test; 1; } or do {
plan skip_all => 'Unable to test without RT::LDAPImport and Net::LDAP::Server::Test';
@@ -67,3 +67,5 @@ for my $entry (@ldap_entries) {
# can't unbind earlier or the server will die
$ldap->unbind;
+
+done_testing;
diff --git a/t/ldapimport/user-import.t b/t/ldapimport/user-import.t
index eabcc36..4c19c36 100644
--- a/t/ldapimport/user-import.t
+++ b/t/ldapimport/user-import.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use RT::Test tests => 8 + 13*2, config => 'Set($ExternalAuth, 1);';
+use RT::Test tests => undef;
eval { require RT::LDAPImport; require Net::LDAP::Server::Test; 1; } or do {
plan skip_all => 'Unable to test without RT::LDAPImport and Net::LDAP::Server::Test';
@@ -84,3 +84,5 @@ ok(!$user->Id);
# can't unbind earlier or the server will die
$ldap->unbind;
+
+done_testing;
-----------------------------------------------------------------------
More information about the rt-commit
mailing list