[Rt-commit] rt branch, 4.4/external-auth, updated. rt-4.2.11-178-g302c1a0

Todd Wade todd at bestpractical.com
Thu Oct 29 17:18:09 EDT 2015


The branch, 4.4/external-auth has been updated
       via  302c1a0a41caec842232977ff549145d92f275c3 (commit)
      from  381b5c114b50b9e71a93e05bdfcd423f808395b0 (commit)

Summary of changes:
 sbin/rt-ldapimport.in                 | 7 ++++++-
 t/ldapimport/group-callbacks.t        | 7 ++++---
 t/ldapimport/group-import.t           | 7 ++++---
 t/ldapimport/group-member-import.t    | 7 ++++---
 t/ldapimport/group-rename.t           | 7 ++++---
 t/ldapimport/user-import-cfs.t        | 7 ++++---
 t/ldapimport/user-import-privileged.t | 7 ++++---
 t/ldapimport/user-import.t            | 7 ++++---
 8 files changed, 34 insertions(+), 22 deletions(-)

- Log -----------------------------------------------------------------
commit 302c1a0a41caec842232977ff549145d92f275c3
Author: Todd Wade <todd at bestpractical.com>
Date:   Thu Oct 29 17:17:44 2015 -0400

    help tests for ldapimport without --enable-externalauth pass

diff --git a/sbin/rt-ldapimport.in b/sbin/rt-ldapimport.in
index 7975b48..0d0f9e0 100644
--- a/sbin/rt-ldapimport.in
+++ b/sbin/rt-ldapimport.in
@@ -74,7 +74,12 @@ BEGIN {
     RT::Init();
 };
 
-use RT::LDAPImport;
+eval { require RT::LDAPImport; 1; } or do {
+    print "Unable to run rt-ldapimport without dependencies.\n";
+    print "Rerun configure with the --enable-externalauth option.";
+    exit 0;
+};
+
 
 my %OPT = (
     users  => 1,
diff --git a/t/ldapimport/group-callbacks.t b/t/ldapimport/group-callbacks.t
index 89aca32..1bbc7fc 100644
--- a/t/ldapimport/group-callbacks.t
+++ b/t/ldapimport/group-callbacks.t
@@ -1,10 +1,11 @@
 use strict;
 use warnings;
 
-use RT::Test tests => undef;
-use Net::LDAP::Server::Test;
+use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
 
-use Net::LDAP::Entry;
+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';
+};
 
 my $importer = RT::LDAPImport->new;
 isa_ok($importer,'RT::LDAPImport');
diff --git a/t/ldapimport/group-import.t b/t/ldapimport/group-import.t
index 99b2742..56d82b9 100644
--- a/t/ldapimport/group-import.t
+++ b/t/ldapimport/group-import.t
@@ -1,10 +1,11 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 88;
-use Net::LDAP::Server::Test;
+use RT::Test tests => 88, config => 'Set($ExternalAuth, 1);';
 
-use Net::LDAP::Entry;
+eval { require RT::LDAPImport; require Net::LDAP::Server::Test; 1; } or do {
+    plan skip_all => 'Unable to test without Net::LDAP::Server::Test';
+};
 
 my $importer = RT::LDAPImport->new;
 isa_ok($importer,'RT::LDAPImport');
diff --git a/t/ldapimport/group-member-import.t b/t/ldapimport/group-member-import.t
index 1783296..7d177a7 100644
--- a/t/ldapimport/group-member-import.t
+++ b/t/ldapimport/group-member-import.t
@@ -1,10 +1,11 @@
 use strict;
 use warnings;
 
-use RT::Test tests => undef;
-use Net::LDAP::Server::Test;
+use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
 
-use Net::LDAP::Entry;
+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';
+};
 
 my $importer = RT::LDAPImport->new;
 isa_ok($importer,'RT::LDAPImport');
diff --git a/t/ldapimport/group-rename.t b/t/ldapimport/group-rename.t
index bb5f2a3..48ae313 100644
--- a/t/ldapimport/group-rename.t
+++ b/t/ldapimport/group-rename.t
@@ -1,10 +1,11 @@
 use strict;
 use warnings;
 
-use RT::Test tests => undef;
-use Net::LDAP::Server::Test;
+use RT::Test tests => undef, config => 'Set($ExternalAuth, 1);';
 
-use Net::LDAP::Entry;
+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';
+};
 
 my $importer = RT::LDAPImport->new;
 isa_ok($importer,'RT::LDAPImport');
diff --git a/t/ldapimport/user-import-cfs.t b/t/ldapimport/user-import-cfs.t
index 5e32112..eadef51 100644
--- a/t/ldapimport/user-import-cfs.t
+++ b/t/ldapimport/user-import-cfs.t
@@ -1,10 +1,11 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 7 + 13*3 + 2*2 + 1;
-use Net::LDAP::Server::Test;
+use RT::Test tests => 7 + 13*3 + 2*2 + 1, config => 'Set($ExternalAuth, 1);';
 
-use Net::LDAP::Entry;
+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';
+};
 
 {
     my $cf = RT::CustomField->new(RT->SystemUser);
diff --git a/t/ldapimport/user-import-privileged.t b/t/ldapimport/user-import-privileged.t
index feb79bb..d4bf179 100644
--- a/t/ldapimport/user-import-privileged.t
+++ b/t/ldapimport/user-import-privileged.t
@@ -1,10 +1,11 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 5 + 13*2;
-use Net::LDAP::Server::Test;
+use RT::Test tests => 5 + 13*2, config => 'Set($ExternalAuth, 1);';
 
-use Net::LDAP::Entry;
+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';
+};
 
 my $importer = RT::LDAPImport->new;
 isa_ok($importer,'RT::LDAPImport');
diff --git a/t/ldapimport/user-import.t b/t/ldapimport/user-import.t
index 12b3ab5..eabcc36 100644
--- a/t/ldapimport/user-import.t
+++ b/t/ldapimport/user-import.t
@@ -1,10 +1,11 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 8 + 13*2;
-use Net::LDAP::Server::Test;
+use RT::Test tests => 8 + 13*2, config => 'Set($ExternalAuth, 1);';
 
-use Net::LDAP::Entry;
+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';
+};
 
 my $importer = RT::LDAPImport->new;
 isa_ok($importer,'RT::LDAPImport');

-----------------------------------------------------------------------


More information about the rt-commit mailing list