X-Git-Url: http://git.rot13.org/?p=virtual-ldap;a=blobdiff_plain;f=t%2Fldap-rewrite.pl;h=5e88dbfcdd8e0ea9f638820271e8f4e50f7115da;hp=e5cc3eb13743712912309d134326a4b2ea1bfe7c;hb=540828cf1619eb1da5b9bfd28b51e50201ba41f7;hpb=3453117170e7835d7e5f1c4c4a8f481a33351bcf;ds=sidebyside diff --git a/t/ldap-rewrite.pl b/t/ldap-rewrite.pl index e5cc3eb..5e88dbf 100755 --- a/t/ldap-rewrite.pl +++ b/t/ldap-rewrite.pl @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 8; +use Test::More tests => 9; use Data::Dump qw(dump); BEGIN { @@ -11,7 +11,7 @@ BEGIN { } our $config; -ok( require "t/config.pl", 'config.pl' ); +ok( require( ( shift @ARGV || 't/config.pl' ) ), 'config.pl' ); sub ldap_check_error { my $o = shift; @@ -28,7 +28,18 @@ ok( my $search = $ldap->search( %{ $config->{search} } ), 'search ' . dump( $con ldap_check_error $search; foreach my $entry ( $search->entries ) { + diag dump $entry; + + my $missing = 0; + my @required = @{ $config->{attributes_required} }; + foreach my $attr ( @required ) { + next if grep { /^\Q$attr\E$/i } $entry->attributes; + $missing++; + diag "$missing missing $attr\n"; + } + + ok( ! $missing, "attributes " . dump( @required ) ); } ok( $ldap->unbind, 'unbind' );