Skip to content

Commit

Permalink
Testcase tweaks to cope with differences between different openldap
Browse files Browse the repository at this point in the history
server versions. Tested with 1.2.11 2.0.27 and 2.1.19
  • Loading branch information
gbarr committed May 9, 2003
1 parent b6aed35 commit 8d2ae15
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
6 changes: 3 additions & 3 deletions data/50-cmp.ldif
Expand Up @@ -30,7 +30,7 @@ objectclass: top
objectclass: organizationalUnit
ou: Groups

dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=All Staff, ou=Groups, o=University of Michigan, c=US
member: cn=Manager, o=University of Michigan, c=US
member: cn=Barbara Jensen, ou=Information Technology Division, ou=People, o=Un
iversity of Michigan, c=US
Expand All @@ -57,7 +57,7 @@ cn: All Staff
description: Everyone in the sample data
objectclass: groupofnames

dn: cn=Alumni Assoc Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=Alumni Assoc Staff, ou=Groups, o=University of Michigan, c=US
member: cn=Manager, o=University of Michigan, c=US
member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of
Michigan, c=US
Expand All @@ -76,7 +76,7 @@ description: All Alumni Assoc Staff
cn: Alumni Assoc Staff
objectclass: groupofnames

dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
owner: cn=Manager, o=University of Michigan, c=US
description: All ITD Staff
cn: ITD Staff
Expand Down
6 changes: 3 additions & 3 deletions data/51b-cmp.ldif
@@ -1,4 +1,4 @@
dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=All Staff, ou=Groups, o=University of Michigan, c=US
member: cn=Manager, o=University of Michigan, c=US
member: cn=Barbara Jensen, ou=Information Technology Division, ou=People, o=Un
iversity of Michigan, c=US
Expand All @@ -25,7 +25,7 @@ cn: All Staff
description: Everyone in the sample data
objectclass: groupofnames

dn: cn=Alumni Assoc Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=Alumni Assoc Staff, ou=Groups, o=University of Michigan, c=US
member: cn=Manager, o=University of Michigan, c=US
member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of
Michigan, c=US
Expand All @@ -44,7 +44,7 @@ description: All Alumni Assoc Staff
cn: Alumni Assoc Staff
objectclass: groupofnames

dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
owner: cn=Manager, o=University of Michigan, c=US
description: All ITD Staff
cn: ITD Staff
Expand Down
4 changes: 2 additions & 2 deletions data/51c-cmp.ldif
@@ -1,4 +1,4 @@
dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=All Staff, ou=Groups, o=University of Michigan, c=US
member: cn=Manager, o=University of Michigan, c=US
member: cn=Barbara Jensen, ou=Information Technology Division, ou=People, o=Un
iversity of Michigan, c=US
Expand All @@ -25,7 +25,7 @@ cn: All Staff
description: Everyone in the sample data
objectclass: groupofnames

dn: cn=Alumni Assoc Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=Alumni Assoc Staff, ou=Groups, o=University of Michigan, c=US
member: cn=Manager, o=University of Michigan, c=US
member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of
Michigan, c=US
Expand Down
6 changes: 3 additions & 3 deletions data/51d-cmp.ldif
Expand Up @@ -20,7 +20,7 @@ objectclass: top
objectclass: organizationalUnit
ou: Groups

dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=All Staff, ou=Groups, o=University of Michigan, c=US
member: cn=Manager, o=University of Michigan, c=US
member: cn=Barbara Jensen, ou=Information Technology Division, ou=People, o=Un
iversity of Michigan, c=US
Expand All @@ -47,7 +47,7 @@ cn: All Staff
description: Everyone in the sample data
objectclass: groupofnames

dn: cn=Alumni Assoc Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=Alumni Assoc Staff, ou=Groups, o=University of Michigan, c=US
member: cn=Manager, o=University of Michigan, c=US
member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of
Michigan, c=US
Expand All @@ -66,7 +66,7 @@ description: All Alumni Assoc Staff
cn: Alumni Assoc Staff
objectclass: groupofnames

dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
owner: cn=Manager, o=University of Michigan, c=US
description: All ITD Staff
cn: ITD Staff
Expand Down
6 changes: 3 additions & 3 deletions data/52-cmp.ldif
Expand Up @@ -30,13 +30,13 @@ objectclass: top
objectclass: organizationalUnit
ou: Groups

dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=All Staff, ou=Groups, o=University of Michigan, c=US
owner: cn=Manager, o=University of Michigan, c=US
cn: All Staff
description: Everyone in the sample data
objectclass: groupofnames

dn: cn=Alumni Assoc Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=Alumni Assoc Staff, ou=Groups, o=University of Michigan, c=US
member: cn=Manager, o=University of Michigan, c=US
member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of
Michigan, c=US
Expand All @@ -55,7 +55,7 @@ description: All Alumni Assoc Staff
cn: Alumni Assoc Staff
objectclass: groupofnames

dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
owner: cn=Manager, o=University of Michigan, c=US
description: All ITD Staff
cn: ITD Staff
Expand Down
8 changes: 7 additions & 1 deletion t/common.pl
Expand Up @@ -52,6 +52,7 @@ BEGIN

use Net::LDAP;
use Net::LDAP::LDIF;
use Net::LDAP::Util qw(canonical_dn);
use File::Path qw(rmtree);
use File::Basename qw(basename);

Expand Down Expand Up @@ -143,7 +144,7 @@ sub client {
}
}
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;
}
Expand All @@ -165,9 +166,14 @@ sub compare_ldif {
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);
}
Expand Down

0 comments on commit 8d2ae15

Please sign in to comment.