3 |
use warnings; |
use warnings; |
4 |
use strict; |
use strict; |
5 |
|
|
6 |
use Test::More tests => 8; |
use Test::More tests => 9; |
7 |
use Data::Dump qw(dump); |
use Data::Dump qw(dump); |
8 |
|
|
9 |
BEGIN { |
BEGIN { |
11 |
} |
} |
12 |
|
|
13 |
our $config; |
our $config; |
14 |
ok( require "t/config.pl", 'config.pl' ); |
ok( require( ( shift @ARGV || 't/config.pl' ) ), 'config.pl' ); |
15 |
|
|
16 |
sub ldap_check_error { |
sub ldap_check_error { |
17 |
my $o = shift; |
my $o = shift; |
28 |
ldap_check_error $search; |
ldap_check_error $search; |
29 |
|
|
30 |
foreach my $entry ( $search->entries ) { |
foreach my $entry ( $search->entries ) { |
31 |
|
|
32 |
diag dump $entry; |
diag dump $entry; |
33 |
|
|
34 |
|
my $missing = 0; |
35 |
|
my @required = @{ $config->{attributes_required} }; |
36 |
|
foreach my $attr ( @required ) { |
37 |
|
next if grep { /^\Q$attr\E$/i } $entry->attributes; |
38 |
|
$missing++; |
39 |
|
diag "$missing missing $attr\n"; |
40 |
|
} |
41 |
|
|
42 |
|
ok( ! $missing, "attributes " . dump( @required ) ); |
43 |
} |
} |
44 |
|
|
45 |
ok( $ldap->unbind, 'unbind' ); |
ok( $ldap->unbind, 'unbind' ); |