X-Git-Url: http://git.rot13.org/?p=virtual-ldap;a=blobdiff_plain;f=t%2Fldap-rewrite.pl;fp=t%2Fldap-rewrite.pl;h=0000000000000000000000000000000000000000;hp=5e88dbfcdd8e0ea9f638820271e8f4e50f7115da;hb=7279da95fb2ab53a7ee6251f74c2d1efcf79f116;hpb=b3ae75eb4453ba56cf335a822e46483c4defe1ce diff --git a/t/ldap-rewrite.pl b/t/ldap-rewrite.pl deleted file mode 100755 index 5e88dbf..0000000 --- a/t/ldap-rewrite.pl +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/perl - -use warnings; -use strict; - -use Test::More tests => 9; -use Data::Dump qw(dump); - -BEGIN { - use_ok 'Net::LDAP'; -} - -our $config; -ok( require( ( shift @ARGV || 't/config.pl' ) ), 'config.pl' ); - -sub ldap_check_error { - my $o = shift; - ok( ! $o->code, 'no errror' ); - diag $o->error if $o->code; -} - -ok( my $ldap = Net::LDAP->new( $config->{server} ), 'new Net::LDAP ' . dump( $config->{server} ) ); - -ok( my $bind = $ldap->bind( $config->{bind_as}, password => $config->{password} ), 'bind ' . $config->{bind_as} ); -ldap_check_error $bind; - -ok( my $search = $ldap->search( %{ $config->{search} } ), 'search ' . dump( $config->{search} ) ); -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' );