Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 41 lines (31 sloc) 1.142 kB
e0ccd1b @gbarr Rename the existing schema test to 03schema.t as it does not require …
gbarr authored
1 #!perl -w
2 use Net::LDAP::Schema;
3
4 print "1..7\n";
5
6 my $schema = Net::LDAP::Schema->new( "data/schema.in" ) or die "Cannot open schema";
7 print "ok 1\n";
8
9 my @atts = $schema->all_attributes();
10 print "not " unless @atts == 55;
11 print "ok 2\n";
12
13 print "The schema contains ", scalar @atts, " attributes\n";
14
15 my @ocs = $schema->all_objectclasses();
16 print "not " unless @ocs == 22;
17 print "ok 3\n";
18 print "The schema contains ", scalar @ocs, " object classes\n";
19
20 @atts = $schema->must( "person" );
21 print "not " unless join(' ', sort map $_->{name}, @atts) eq join(' ',sort qw(cn sn objectClass));
22 print "ok 4\n";
23 print "The 'person' OC must have these attributes [",
24 join( ",", map $_->{name}, @atts ),
25 "]\n";
26 @atts = $schema->may( "mhsOrganizationalUser" );
27 print "not " if @atts;
28 print "ok 5\n";
29 print "The 'mhsOrganizationalUser' OC may have these attributes [",
30 join( ",", map $_->{name}, @atts ),
31 "]\n";
32
33 print "not " if defined $schema->attribute('distinguishedName')->{max_length};
34 print "ok 6\n";
35
36 print "not " unless $schema->attribute('userPassword')->{max_length} == 128;
37 print "ok 7\n";
38
39 use Data::Dumper;
40 print Dumper($schema);
Something went wrong with that request. Please try again.