Update of /cvsroot/perl-ldap/ldap/t
In directory sc8-pr-cvs1:/tmp/cvs-serv29763/t
Modified Files:
common.pl
Log Message:
Testcase tweaks to cope with differences between different openldap
server versions. Tested with 1.2.11 2.0.27 and 2.1.19
Index: common.pl
===================================================================
RCS file: /cvsroot/perl-ldap/ldap/t/common.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- common.pl 9 May 2003 11:58:04 -0000 1.7
+++ common.pl 9 May 2003 14:58:42 -0000 1.8
@@ -52,6 +52,7 @@
use Net::LDAP;
use Net::LDAP::LDIF;
+use Net::LDAP::Util qw(canonical_dn);
use File::Path qw(rmtree);
use File::Basename qw(basename);
@@ -143,7 +144,7 @@
}
}
else {
- until($ldap = Net::LDAP->new($HOST, port => $PORT)) {
+ until($ldap = Net::LDAP->new($HOST, port => $PORT, version => $LDAP_VERSION)) {
die "ldap://$HOST:$PORT/ $@" if ++$count > 10;
sleep 1;
}
@@ -165,9 +166,14 @@
return;
}
+ my @canon_opt = (casefold => 'lower', separator => ', ');
foreach $entry (@_) {
+ $entry->dn(canonical_dn($entry->dn, @canon_opt));
foreach $attr ($entry->attributes) {
$entry->delete($attr) if $attr =~ /^(modifiersname|modifytimestamp|creatorsname|createtimestamp)$/i;
+ if ($attr =~ /^(seealso|member|owner)$/i) {
+ $entry->replace($attr => [ map { canonical_dn($_, @canon_opt) } $entry->get_value($attr) ]);
+ }
}
$ldif->write($entry);
}
|