mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
further improve tests; line-up with code
This commit is contained in:
parent
6956e3d483
commit
b7c0b9ed7f
@ -45,23 +45,26 @@ insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,
|
|||||||
values (5,1,'userPassword','persons.password','persons','persons.password IS NOT NULL',NULL,NULL,3,0);
|
values (5,1,'userPassword','persons.password','persons','persons.password IS NOT NULL',NULL,NULL,3,0);
|
||||||
|
|
||||||
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
|
||||||
values (6,2,'description','documents.abstract','documents',NULL,NULL,NULL,3,0);
|
values (6,1,'seeAlso','seeAlso.dn','ldap_entries AS seeAlso,documents,authors_docs,persons',
|
||||||
|
'seeAlso.keyval=documents.id AND seeAlso.oc_map_id=2 AND authors_docs.doc_id=documents.id AND authors_docs.pers_id=persons.id',
|
||||||
|
NULL,NULL,3,0);
|
||||||
|
|
||||||
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
|
||||||
values (7,2,'documentTitle','documents.title','documents',NULL,NULL,NULL,3,0);
|
values (7,2,'description','documents.abstract','documents',NULL,NULL,NULL,3,0);
|
||||||
|
|
||||||
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
|
||||||
values (8,2,'documentAuthor','documentAuthor.dn','ldap_entries AS documentAuthor,documents,authors_docs,persons',
|
values (8,2,'documentTitle','documents.title','documents',NULL,NULL,NULL,3,0);
|
||||||
|
|
||||||
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
|
||||||
|
values (9,2,'documentAuthor','documentAuthor.dn','ldap_entries AS documentAuthor,documents,authors_docs,persons',
|
||||||
'documentAuthor.keyval=persons.id AND documentAuthor.oc_map_id=1 AND authors_docs.doc_id=documents.id AND authors_docs.pers_id=persons.id',
|
'documentAuthor.keyval=persons.id AND documentAuthor.oc_map_id=1 AND authors_docs.doc_id=documents.id AND authors_docs.pers_id=persons.id',
|
||||||
NULL,NULL,3,0);
|
NULL,NULL,3,0);
|
||||||
|
|
||||||
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
|
||||||
values (9,3,'o','institutes.name','institutes',NULL,NULL,NULL,3,0);
|
values (10,2,'documentIdentifier','concat(''document '',documents.id)','documents',NULL,NULL,NULL,3,0);
|
||||||
|
|
||||||
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
|
||||||
values (10,1,'documentIdentifier','documentIdentifier.dn','ldap_entries AS documentIdentifier,documents,authors_docs,persons',
|
values (11,3,'o','institutes.name','institutes',NULL,NULL,NULL,3,0);
|
||||||
'documentIdentifier.keyval=documents.id AND documentIdentifier.oc_map_id=2 AND authors_docs.doc_id=documents.id AND authors_docs.pers_id=persons.id',
|
|
||||||
NULL,NULL,3,0);
|
|
||||||
|
|
||||||
-- entries mapping: each entry must appear in this table, with a unique DN rooted at the database naming context
|
-- entries mapping: each entry must appear in this table, with a unique DN rooted at the database naming context
|
||||||
-- id a unique number > 0 identifying the entry
|
-- id a unique number > 0 identifying the entry
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
-- expect_return a bitmap that marks whether create_proc (1) and delete_proc (2) return a value or not
|
-- expect_return a bitmap that marks whether create_proc (1) and delete_proc (2) return a value or not
|
||||||
insert into ldap_oc_mappings (id,name,keytbl,keycol,create_proc,delete_proc,expect_return) values (1,'inetOrgPerson','persons','id','select create_person()','select delete_person(?)',0);
|
insert into ldap_oc_mappings (id,name,keytbl,keycol,create_proc,delete_proc,expect_return) values (1,'inetOrgPerson','persons','id','select create_person()','select delete_person(?)',0);
|
||||||
|
|
||||||
insert into ldap_oc_mappings (id,name,keytbl,keycol,create_proc,delete_proc,expect_return) values (2,'document','documents','id',NULL,NULL,0);
|
insert into ldap_oc_mappings (id,name,keytbl,keycol,create_proc,delete_proc,expect_return) values (2,'document','documents','id','select create_doc()','select delete_doc(?)',0);
|
||||||
|
|
||||||
insert into ldap_oc_mappings (id,name,keytbl,keycol,create_proc,delete_proc,expect_return) values (3,'organization','institutes','id',NULL,NULL,0);
|
insert into ldap_oc_mappings (id,name,keytbl,keycol,create_proc,delete_proc,expect_return) values (3,'organization','institutes','id','select create_o()','select delete_o(?)',0);
|
||||||
|
|
||||||
-- attributeType mappings: describe how an attributeType for a certain objectClass maps to the SQL data.
|
-- attributeType mappings: describe how an attributeType for a certain objectClass maps to the SQL data.
|
||||||
-- id a unique number identifying the attribute
|
-- id a unique number identifying the attribute
|
||||||
@ -35,15 +35,17 @@ insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,
|
|||||||
|
|
||||||
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (5,1,'userPassword','persons.password','persons','persons.password IS NOT NULL','update persons set password=? where id=?',NULL,3,0);
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (5,1,'userPassword','persons.password','persons','persons.password IS NOT NULL','update persons set password=? where id=?',NULL,3,0);
|
||||||
|
|
||||||
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (6,2,'description','documents.abstract','documents',NULL,NULL,NULL,3,0);
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (6,1,'seeAlso','seeAlso.dn','ldap_entries AS seeAlso,documents,authors_docs,persons','seeAlso.keyval=documents.id AND seeAlso.oc_map_id=2 AND authors_docs.doc_id=documents.id AND authors_docs.pers_id=persons.id',NULL,NULL,3,0);
|
||||||
|
|
||||||
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (7,2,'documentTitle','documents.title','documents',NULL,NULL,NULL,3,0);
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (7,2,'description','documents.abstract','documents',NULL,'update documents set abstract=? where id=?',NULL,3,0);
|
||||||
|
|
||||||
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (8,2,'documentAuthor','documentAuthor.dn','ldap_entries AS documentAuthor,documents,authors_docs,persons','documentAuthor.keyval=persons.id AND documentAuthor.oc_map_id=1 AND authors_docs.doc_id=documents.id AND authors_docs.pers_id=persons.id',NULL,NULL,3,0);
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (8,2,'documentTitle','documents.title','documents',NULL,'update documents set title=? where id=?',NULL,3,0);
|
||||||
|
|
||||||
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (9,3,'o','institutes.name','institutes',NULL,NULL,NULL,3,0);
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (9,2,'documentAuthor','documentAuthor.dn','ldap_entries AS documentAuthor,documents,authors_docs,persons','documentAuthor.keyval=persons.id AND documentAuthor.oc_map_id=1 AND authors_docs.doc_id=documents.id AND authors_docs.pers_id=persons.id','select add_doc_author(?,?)','select delete_doc_author(?,?)',3,0);
|
||||||
|
|
||||||
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (10,1,'documentIdentifier','documentIdentifier.dn','ldap_entries AS documentIdentifier,documents,authors_docs,persons','documentIdentifier.keyval=documents.id AND documentIdentifier.oc_map_id=2 AND authors_docs.doc_id=documents.id AND authors_docs.pers_id=persons.id',NULL,NULL,3,0);
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (10,2,'documentIdentifier','''document ''||text(documents.id)','documents',NULL,NULL,NULL,3,0);
|
||||||
|
|
||||||
|
insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return) values (11,3,'o','institutes.name','institutes',NULL,'update institutes set name=? where id=?',NULL,3,0);
|
||||||
|
|
||||||
|
|
||||||
-- entries mapping: each entry must appear in this table, with a unique DN rooted at the database naming context
|
-- entries mapping: each entry must appear in this table, with a unique DN rooted at the database naming context
|
||||||
@ -81,7 +83,7 @@ insert into ldap_referrals (entry_id,url) values (4,'ldap://localhost/');
|
|||||||
-- these procedures are specific for this RDBMS and are used in mapping objectClass and attributeType creation/modify/deletion
|
-- these procedures are specific for this RDBMS and are used in mapping objectClass and attributeType creation/modify/deletion
|
||||||
create function create_person () returns int
|
create function create_person () returns int
|
||||||
as '
|
as '
|
||||||
select setval (''persons_id_seq'', (select max(id) from persons));
|
select setval (''persons_id_seq'', (select case when max(id) is null then 1 else max(id) end from persons));
|
||||||
insert into persons (id,name,surname)
|
insert into persons (id,name,surname)
|
||||||
values (nextval(''persons_id_seq''),'''','''');
|
values (nextval(''persons_id_seq''),'''','''');
|
||||||
select max(id) from persons
|
select max(id) from persons
|
||||||
@ -113,7 +115,7 @@ as '
|
|||||||
|
|
||||||
create function add_phone (varchar, int) returns int
|
create function add_phone (varchar, int) returns int
|
||||||
as '
|
as '
|
||||||
select setval (''phones_id_seq'', (select max(id) from phones));
|
select setval (''phones_id_seq'', (select case when max(id) is null then 1 else max(id) end from phones));
|
||||||
insert into phones (id,phone,pers_id)
|
insert into phones (id,phone,pers_id)
|
||||||
values (nextval(''phones_id_seq''),$1,$2);
|
values (nextval(''phones_id_seq''),$1,$2);
|
||||||
select max(id) from phones
|
select max(id) from phones
|
||||||
@ -125,3 +127,51 @@ as '
|
|||||||
select $2 as result
|
select $2 as result
|
||||||
' language 'sql';
|
' language 'sql';
|
||||||
|
|
||||||
|
create function create_doc () returns int
|
||||||
|
as '
|
||||||
|
select setval (''documents_id_seq'', (select case when max(id) is null then 1 else max(id) end from documents));
|
||||||
|
insert into documents (id,title,abstract)
|
||||||
|
values (nextval(''documents_id_seq''),'''','''');
|
||||||
|
select max(id) from documents
|
||||||
|
' language 'sql';
|
||||||
|
|
||||||
|
create function delete_doc (int) returns int
|
||||||
|
as '
|
||||||
|
delete from documents where id = $1;
|
||||||
|
select $1 as return
|
||||||
|
' language 'sql';
|
||||||
|
|
||||||
|
create function create_o () returns int
|
||||||
|
as '
|
||||||
|
select setval (''institutes_id_seq'', (select case when max(id) is null then 1 else max(id) end from institutes));
|
||||||
|
insert into institutes (id,name)
|
||||||
|
values (nextval(''institutes_id_seq''),'''');
|
||||||
|
select max(id) from institutes
|
||||||
|
' language 'sql';
|
||||||
|
|
||||||
|
create function delete_o (int) returns int
|
||||||
|
as '
|
||||||
|
delete from institutes where id = $1;
|
||||||
|
select $1 as return
|
||||||
|
' language 'sql';
|
||||||
|
|
||||||
|
create function add_doc_author (varchar, int) returns int
|
||||||
|
as '
|
||||||
|
insert into authors_docs (pers_id,doc_id) values ((
|
||||||
|
select ldap_entries.keyval
|
||||||
|
from ldap_entries
|
||||||
|
where upper($1) = upper(ldap_entries.dn)
|
||||||
|
),$2);
|
||||||
|
select $2 as return
|
||||||
|
' language 'sql';
|
||||||
|
|
||||||
|
create function delete_doc_author (varchar, int) returns int
|
||||||
|
as '
|
||||||
|
delete from authors_docs where authors_docs.pers_id = (
|
||||||
|
select ldap_entries.keyval
|
||||||
|
from ldap_entries
|
||||||
|
where upper($1) = upper(ldap_entries.dn)
|
||||||
|
) and authors_docs.doc_id = $2;
|
||||||
|
select $2 as return
|
||||||
|
' language 'sql';
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ dbpasswd secret
|
|||||||
# rdbms specific directives
|
# rdbms specific directives
|
||||||
#
|
#
|
||||||
# PostgreSQL
|
# PostgreSQL
|
||||||
#postgres#insentry_query "insert into ldap_entries (id,dn,oc_map_id,parent,keyval) values ((select max(id)+1 from ldap_entries),?,?,?,?)"
|
#postgres#insentry_query "insert into ldap_entries (id,dn,oc_map_id,parent,keyval) values ((select case when max(id) is null then 1 else max(id) + 1 end from ldap_entries),?,?,?,?)"
|
||||||
#postgres#upper_func "upper"
|
#postgres#upper_func "upper"
|
||||||
#postgres#strcast_func "text"
|
#postgres#strcast_func "text"
|
||||||
#postgres#concat_pattern "?||?"
|
#postgres#concat_pattern "?||?"
|
||||||
|
@ -1,101 +1,115 @@
|
|||||||
# Testing search...
|
# Testing search...
|
||||||
# refldap://localhost/o=Example,c=RU??sub
|
|
||||||
|
|
||||||
dn: cn=Torvlobnor Puzdoy,o=Example,c=RU
|
|
||||||
objectClass: inetOrgPerson
|
|
||||||
cn: Torvlobnor Puzdoy
|
|
||||||
telephoneNumber: 545-4563
|
|
||||||
givenName: Torvlobnor
|
|
||||||
sn: Puzdoy
|
|
||||||
documentIdentifier: documentTitle=book1,o=Example,c=RU
|
|
||||||
|
|
||||||
dn: cn=Mitya Kovalev,o=Example,c=RU
|
|
||||||
objectClass: inetOrgPerson
|
|
||||||
objectClass: posixAccount
|
|
||||||
cn: Mitya Kovalev
|
|
||||||
telephoneNumber: 332-2334
|
|
||||||
telephoneNumber: 222-3234
|
|
||||||
givenName: Mitya
|
|
||||||
sn: Kovalev
|
|
||||||
documentIdentifier: documentTitle=book1,o=Example,c=RU
|
|
||||||
documentIdentifier: documentTitle=book2,o=Example,c=RU
|
|
||||||
|
|
||||||
dn: documentTitle=book2,o=Example,c=RU
|
|
||||||
objectClass: document
|
|
||||||
description: abstract2
|
|
||||||
documentTitle: book2
|
|
||||||
documentAuthor: cn=Mitya Kovalev,o=Example,c=RU
|
|
||||||
|
|
||||||
dn: documentTitle=book1,o=Example,c=RU
|
dn: documentTitle=book1,o=Example,c=RU
|
||||||
objectClass: document
|
objectClass: document
|
||||||
description: abstract1
|
description: abstract1
|
||||||
documentTitle: book1
|
documentTitle: book1
|
||||||
documentAuthor: cn=Mitya Kovalev,o=Example,c=RU
|
documentAuthor: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
documentAuthor: cn=Torvlobnor Puzdoy,o=Example,c=RU
|
documentAuthor: cn=Torvlobnor Puzdoy,o=Example,c=RU
|
||||||
|
documentIdentifier: document 1
|
||||||
|
|
||||||
|
dn: documentTitle=book2,o=Example,c=RU
|
||||||
|
objectClass: document
|
||||||
|
description: abstract2
|
||||||
|
documentTitle: book2
|
||||||
|
documentAuthor: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
|
documentIdentifier: document 2
|
||||||
|
|
||||||
dn: o=Example,c=RU
|
dn: o=Example,c=RU
|
||||||
objectClass: organization
|
objectClass: organization
|
||||||
o: Example
|
o: Example
|
||||||
|
|
||||||
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: posixAccount
|
||||||
|
cn: Mitya Kovalev
|
||||||
|
sn: Kovalev
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
seeAlso: documentTitle=book2,o=Example,c=RU
|
||||||
|
givenName: Mitya
|
||||||
|
telephoneNumber: 332-2334
|
||||||
|
telephoneNumber: 222-3234
|
||||||
|
|
||||||
|
dn: cn=Torvlobnor Puzdoy,o=Example,c=RU
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
cn: Torvlobnor Puzdoy
|
||||||
|
sn: Puzdoy
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
givenName: Torvlobnor
|
||||||
|
telephoneNumber: 545-4563
|
||||||
|
|
||||||
|
# refldap://localhost/o=Example,c=RU??sub
|
||||||
|
|
||||||
# Testing exact search...
|
# Testing exact search...
|
||||||
dn: cn=Mitya Kovalev,o=Example,c=RU
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
objectClass: inetOrgPerson
|
objectClass: inetOrgPerson
|
||||||
objectClass: posixAccount
|
objectClass: posixAccount
|
||||||
cn: Mitya Kovalev
|
cn: Mitya Kovalev
|
||||||
|
sn: Kovalev
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
seeAlso: documentTitle=book2,o=Example,c=RU
|
||||||
|
givenName: Mitya
|
||||||
telephoneNumber: 332-2334
|
telephoneNumber: 332-2334
|
||||||
telephoneNumber: 222-3234
|
telephoneNumber: 222-3234
|
||||||
givenName: Mitya
|
|
||||||
sn: Kovalev
|
|
||||||
documentIdentifier: documentTitle=book1,o=Example,c=RU
|
|
||||||
documentIdentifier: documentTitle=book2,o=Example,c=RU
|
|
||||||
|
|
||||||
# Testing substrings initial search...
|
# Testing substrings initial search...
|
||||||
dn: cn=Mitya Kovalev,o=Example,c=RU
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
objectClass: inetOrgPerson
|
objectClass: inetOrgPerson
|
||||||
objectClass: posixAccount
|
objectClass: posixAccount
|
||||||
cn: Mitya Kovalev
|
cn: Mitya Kovalev
|
||||||
|
sn: Kovalev
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
seeAlso: documentTitle=book2,o=Example,c=RU
|
||||||
|
givenName: Mitya
|
||||||
telephoneNumber: 332-2334
|
telephoneNumber: 332-2334
|
||||||
telephoneNumber: 222-3234
|
telephoneNumber: 222-3234
|
||||||
givenName: Mitya
|
|
||||||
sn: Kovalev
|
|
||||||
documentIdentifier: documentTitle=book1,o=Example,c=RU
|
|
||||||
documentIdentifier: documentTitle=book2,o=Example,c=RU
|
|
||||||
|
|
||||||
# Testing substrings any search...
|
# Testing substrings any search...
|
||||||
dn: cn=Mitya Kovalev,o=Example,c=RU
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
objectClass: inetOrgPerson
|
objectClass: inetOrgPerson
|
||||||
objectClass: posixAccount
|
objectClass: posixAccount
|
||||||
cn: Mitya Kovalev
|
cn: Mitya Kovalev
|
||||||
|
sn: Kovalev
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
seeAlso: documentTitle=book2,o=Example,c=RU
|
||||||
|
givenName: Mitya
|
||||||
telephoneNumber: 332-2334
|
telephoneNumber: 332-2334
|
||||||
telephoneNumber: 222-3234
|
telephoneNumber: 222-3234
|
||||||
givenName: Mitya
|
|
||||||
sn: Kovalev
|
|
||||||
documentIdentifier: documentTitle=book1,o=Example,c=RU
|
|
||||||
documentIdentifier: documentTitle=book2,o=Example,c=RU
|
|
||||||
|
|
||||||
# Testing substrings final search...
|
# Testing substrings final search...
|
||||||
dn: cn=Mitya Kovalev,o=Example,c=RU
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
objectClass: inetOrgPerson
|
objectClass: inetOrgPerson
|
||||||
objectClass: posixAccount
|
objectClass: posixAccount
|
||||||
cn: Mitya Kovalev
|
cn: Mitya Kovalev
|
||||||
|
sn: Kovalev
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
seeAlso: documentTitle=book2,o=Example,c=RU
|
||||||
|
givenName: Mitya
|
||||||
telephoneNumber: 332-2334
|
telephoneNumber: 332-2334
|
||||||
telephoneNumber: 222-3234
|
telephoneNumber: 222-3234
|
||||||
givenName: Mitya
|
|
||||||
sn: Kovalev
|
|
||||||
documentIdentifier: documentTitle=book1,o=Example,c=RU
|
|
||||||
documentIdentifier: documentTitle=book2,o=Example,c=RU
|
|
||||||
|
|
||||||
# Testing approx search...
|
# Testing approx search...
|
||||||
dn: cn=Mitya Kovalev,o=Example,c=RU
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
objectClass: inetOrgPerson
|
objectClass: inetOrgPerson
|
||||||
objectClass: posixAccount
|
objectClass: posixAccount
|
||||||
cn: Mitya Kovalev
|
cn: Mitya Kovalev
|
||||||
|
sn: Kovalev
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
seeAlso: documentTitle=book2,o=Example,c=RU
|
||||||
|
givenName: Mitya
|
||||||
telephoneNumber: 332-2334
|
telephoneNumber: 332-2334
|
||||||
telephoneNumber: 222-3234
|
telephoneNumber: 222-3234
|
||||||
givenName: Mitya
|
|
||||||
|
# Testing extensible filter search...
|
||||||
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: posixAccount
|
||||||
|
cn: Mitya Kovalev
|
||||||
sn: Kovalev
|
sn: Kovalev
|
||||||
documentIdentifier: documentTitle=book1,o=Example,c=RU
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
documentIdentifier: documentTitle=book2,o=Example,c=RU
|
seeAlso: documentTitle=book2,o=Example,c=RU
|
||||||
|
givenName: Mitya
|
||||||
|
telephoneNumber: 332-2334
|
||||||
|
telephoneNumber: 222-3234
|
||||||
|
|
||||||
# Testing attribute inheritance in filter...
|
# Testing attribute inheritance in filter...
|
||||||
dn: o=Example,c=RU
|
dn: o=Example,c=RU
|
||||||
@ -103,60 +117,96 @@ objectClass: organization
|
|||||||
o: Example
|
o: Example
|
||||||
|
|
||||||
# Testing objectClass inheritance in filter...
|
# Testing objectClass inheritance in filter...
|
||||||
# refldap://localhost/o=Example,c=RU??sub
|
|
||||||
|
|
||||||
dn: cn=Torvlobnor Puzdoy,o=Example,c=RU
|
|
||||||
objectClass: inetOrgPerson
|
|
||||||
cn: Torvlobnor Puzdoy
|
|
||||||
telephoneNumber: 545-4563
|
|
||||||
givenName: Torvlobnor
|
|
||||||
sn: Puzdoy
|
|
||||||
documentIdentifier: documentTitle=book1,o=Example,c=RU
|
|
||||||
|
|
||||||
dn: cn=Mitya Kovalev,o=Example,c=RU
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
objectClass: inetOrgPerson
|
objectClass: inetOrgPerson
|
||||||
objectClass: posixAccount
|
objectClass: posixAccount
|
||||||
cn: Mitya Kovalev
|
cn: Mitya Kovalev
|
||||||
|
sn: Kovalev
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
seeAlso: documentTitle=book2,o=Example,c=RU
|
||||||
|
givenName: Mitya
|
||||||
telephoneNumber: 332-2334
|
telephoneNumber: 332-2334
|
||||||
telephoneNumber: 222-3234
|
telephoneNumber: 222-3234
|
||||||
givenName: Mitya
|
|
||||||
sn: Kovalev
|
dn: cn=Torvlobnor Puzdoy,o=Example,c=RU
|
||||||
documentIdentifier: documentTitle=book1,o=Example,c=RU
|
objectClass: inetOrgPerson
|
||||||
documentIdentifier: documentTitle=book2,o=Example,c=RU
|
cn: Torvlobnor Puzdoy
|
||||||
|
sn: Puzdoy
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
givenName: Torvlobnor
|
||||||
|
telephoneNumber: 545-4563
|
||||||
|
|
||||||
|
# refldap://localhost/o=Example,c=RU??sub
|
||||||
|
|
||||||
# Testing "auxiliary" objectClass in filter...
|
# Testing "auxiliary" objectClass in filter...
|
||||||
dn: cn=Mitya Kovalev,o=Example,c=RU
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
objectClass: inetOrgPerson
|
objectClass: inetOrgPerson
|
||||||
objectClass: posixAccount
|
objectClass: posixAccount
|
||||||
cn: Mitya Kovalev
|
cn: Mitya Kovalev
|
||||||
|
sn: Kovalev
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
seeAlso: documentTitle=book2,o=Example,c=RU
|
||||||
|
givenName: Mitya
|
||||||
telephoneNumber: 332-2334
|
telephoneNumber: 332-2334
|
||||||
telephoneNumber: 222-3234
|
telephoneNumber: 222-3234
|
||||||
givenName: Mitya
|
|
||||||
sn: Kovalev
|
# Testing hasSubordinates in filter...
|
||||||
documentIdentifier: documentTitle=book1,o=Example,c=RU
|
dn: o=Example,c=RU
|
||||||
documentIdentifier: documentTitle=book2,o=Example,c=RU
|
objectClass: organization
|
||||||
|
o: Example
|
||||||
|
|
||||||
|
# refldap://localhost/o=Example,c=RU??sub
|
||||||
|
|
||||||
# Testing attribute inheritance in requested attributes...
|
# Testing attribute inheritance in requested attributes...
|
||||||
dn: cn=Mitya Kovalev,o=Example,c=RU
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
cn: Mitya Kovalev
|
cn: Mitya Kovalev
|
||||||
givenName: Mitya
|
|
||||||
sn: Kovalev
|
sn: Kovalev
|
||||||
|
givenName: Mitya
|
||||||
|
|
||||||
# Testing objectClass in requested attributes...
|
# Testing objectClass in requested attributes...
|
||||||
Additional information: bad_referral object
|
dn: documentTitle=book1,o=Example,c=RU
|
||||||
dn: cn=Torvlobnor Puzdoy,o=Example,c=RU
|
|
||||||
objectClass: inetOrgPerson
|
|
||||||
|
|
||||||
dn: cn=Mitya Kovalev,o=Example,c=RU
|
|
||||||
objectClass: inetOrgPerson
|
|
||||||
objectClass: posixAccount
|
|
||||||
|
|
||||||
dn: documentTitle=book2,o=Example,c=RU
|
|
||||||
objectClass: document
|
objectClass: document
|
||||||
|
|
||||||
dn: documentTitle=book1,o=Example,c=RU
|
dn: documentTitle=book2,o=Example,c=RU
|
||||||
objectClass: document
|
objectClass: document
|
||||||
|
|
||||||
dn: o=Example,c=RU
|
dn: o=Example,c=RU
|
||||||
objectClass: organization
|
objectClass: organization
|
||||||
|
|
||||||
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: posixAccount
|
||||||
|
|
||||||
|
dn: cn=Torvlobnor Puzdoy,o=Example,c=RU
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
|
||||||
|
# refldap://localhost/o=Example,c=RU??sub
|
||||||
|
|
||||||
|
# Testing operational attributes in request...
|
||||||
|
dn: documentTitle=book1,o=Example,c=RU
|
||||||
|
structuralObjectClass: document
|
||||||
|
subschemaSubentry: cn=Subschema
|
||||||
|
hasSubordinates: FALSE
|
||||||
|
|
||||||
|
dn: documentTitle=book2,o=Example,c=RU
|
||||||
|
structuralObjectClass: document
|
||||||
|
subschemaSubentry: cn=Subschema
|
||||||
|
hasSubordinates: FALSE
|
||||||
|
|
||||||
|
dn: o=Example,c=RU
|
||||||
|
structuralObjectClass: organization
|
||||||
|
subschemaSubentry: cn=Subschema
|
||||||
|
hasSubordinates: TRUE
|
||||||
|
|
||||||
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
|
structuralObjectClass: inetOrgPerson
|
||||||
|
subschemaSubentry: cn=Subschema
|
||||||
|
hasSubordinates: FALSE
|
||||||
|
|
||||||
|
dn: cn=Torvlobnor Puzdoy,o=Example,c=RU
|
||||||
|
structuralObjectClass: inetOrgPerson
|
||||||
|
subschemaSubentry: cn=Subschema
|
||||||
|
hasSubordinates: FALSE
|
||||||
|
|
||||||
|
# refldap://localhost/o=Example,c=RU??sub
|
||||||
|
|
||||||
|
@ -1,37 +1,48 @@
|
|||||||
dn: cn=Pierangelo Masarati,o=Example,c=RU
|
dn: documentTitle=book1,o=Example,c=RU
|
||||||
objectClass: inetOrgPerson
|
objectClass: document
|
||||||
cn: Pierangelo Masarati
|
description: abstract1
|
||||||
telephoneNumber: +39 333 ZZZ 1234
|
documentTitle: book1
|
||||||
givenName: Pierangelo
|
documentAuthor: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
sn: Masarati
|
documentAuthor: cn=Pierangelo Masarati,o=Example,c=RU
|
||||||
|
documentIdentifier: document 1
|
||||||
# refldap://localhost/o=Example,c=RU??sub
|
|
||||||
|
|
||||||
dn: cn=Mitya Kovalev,o=Example,c=RU
|
|
||||||
objectClass: inetOrgPerson
|
|
||||||
objectClass: posixAccount
|
|
||||||
cn: Mitya Kovalev
|
|
||||||
telephoneNumber: 332-2334
|
|
||||||
telephoneNumber: 222-3234
|
|
||||||
telephoneNumber: +1 800 123 4567
|
|
||||||
givenName: Mitya
|
|
||||||
sn: Kovalev
|
|
||||||
documentIdentifier: documentTitle=book1,o=Example,c=RU
|
|
||||||
documentIdentifier: documentTitle=book2,o=Example,c=RU
|
|
||||||
|
|
||||||
dn: documentTitle=book2,o=Example,c=RU
|
dn: documentTitle=book2,o=Example,c=RU
|
||||||
objectClass: document
|
objectClass: document
|
||||||
description: abstract2
|
description: abstract2
|
||||||
documentTitle: book2
|
documentTitle: book2
|
||||||
documentAuthor: cn=Mitya Kovalev,o=Example,c=RU
|
documentAuthor: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
|
documentAuthor: cn=Pierangelo Masarati,o=Example,c=RU
|
||||||
dn: documentTitle=book1,o=Example,c=RU
|
documentIdentifier: document 2
|
||||||
objectClass: document
|
|
||||||
description: abstract1
|
|
||||||
documentTitle: book1
|
|
||||||
documentAuthor: cn=Mitya Kovalev,o=Example,c=RU
|
|
||||||
|
|
||||||
dn: o=Example,c=RU
|
dn: o=Example,c=RU
|
||||||
objectClass: organization
|
objectClass: organization
|
||||||
o: Example
|
o: Example
|
||||||
|
|
||||||
|
dn: o=Another Org,o=Example,c=RU
|
||||||
|
objectClass: organization
|
||||||
|
o: Another Org
|
||||||
|
|
||||||
|
dn: cn=Mitya Kovalev,o=Example,c=RU
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: posixAccount
|
||||||
|
cn: Mitya Kovalev
|
||||||
|
sn: Kovalev
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
seeAlso: documentTitle=book2,o=Example,c=RU
|
||||||
|
givenName: Mitya
|
||||||
|
telephoneNumber: 332-2334
|
||||||
|
telephoneNumber: 222-3234
|
||||||
|
telephoneNumber: +1 800 123 4567
|
||||||
|
|
||||||
|
# refldap://localhost/o=Example,c=RU??sub
|
||||||
|
|
||||||
|
dn: cn=Pierangelo Masarati,o=Example,c=RU
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
cn: Pierangelo Masarati
|
||||||
|
sn: Masarati
|
||||||
|
seeAlso: documentTitle=book1,o=Example,c=RU
|
||||||
|
seeAlso: documentTitle=book2,o=Example,c=RU
|
||||||
|
givenName: Pierangelo
|
||||||
|
telephoneNumber: +39 02 XXXX ZZZZ
|
||||||
|
telephoneNumber: +39 333 ZZZ 1234
|
||||||
|
|
||||||
|
@ -148,6 +148,18 @@ if test $RC != 0 ; then
|
|||||||
exit $RC
|
exit $RC
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Testing extensible filter search..."
|
||||||
|
echo "# Testing extensible filter search..." >> $SEARCHOUT
|
||||||
|
$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
|
||||||
|
"(sn:caseExactMatch:=Kovalev)" >> $SEARCHOUT 2>&1
|
||||||
|
|
||||||
|
RC=$?
|
||||||
|
if test $RC != 0 ; then
|
||||||
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||||
|
exit $RC
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Testing attribute inheritance in filter..."
|
echo "Testing attribute inheritance in filter..."
|
||||||
echo "# Testing attribute inheritance in filter..." >> $SEARCHOUT
|
echo "# Testing attribute inheritance in filter..." >> $SEARCHOUT
|
||||||
$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
|
$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
|
||||||
@ -184,6 +196,18 @@ if test $RC != 0 ; then
|
|||||||
exit $RC
|
exit $RC
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Testing hasSubordinates in filter..."
|
||||||
|
echo "# Testing hasSubordinates in filter..." >> $SEARCHOUT
|
||||||
|
$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
|
||||||
|
"(hasSubordinates=TRUE)" >> $SEARCHOUT 2>&1
|
||||||
|
|
||||||
|
RC=$?
|
||||||
|
if test $RC != 0 ; then
|
||||||
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||||
|
exit $RC
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Testing attribute inheritance in requested attributes..."
|
echo "Testing attribute inheritance in requested attributes..."
|
||||||
echo "# Testing attribute inheritance in requested attributes..." >> $SEARCHOUT
|
echo "# Testing attribute inheritance in requested attributes..." >> $SEARCHOUT
|
||||||
$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
|
$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
|
||||||
@ -208,9 +232,21 @@ if test $RC != 0 ; then
|
|||||||
exit $RC
|
exit $RC
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Testing operational attributes in request..."
|
||||||
|
echo "# Testing operational attributes in request..." >> $SEARCHOUT
|
||||||
|
$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
|
||||||
|
'+' >> $SEARCHOUT 2>&1
|
||||||
|
|
||||||
|
RC=$?
|
||||||
|
if test $RC != 0 ; then
|
||||||
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||||
|
exit $RC
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Filtering ldapsearch results..."
|
echo "Filtering ldapsearch results..."
|
||||||
. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
|
. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
|
||||||
echo "Filtering original ldif used to create database..."
|
echo "Filtering original ldif..."
|
||||||
. $LDIFFILTER < $SQLMASTER > $LDIFFLT
|
. $LDIFFILTER < $SQLMASTER > $LDIFFLT
|
||||||
echo "Comparing filter output..."
|
echo "Comparing filter output..."
|
||||||
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
|
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
|
||||||
@ -261,6 +297,28 @@ telephoneNumber: +39 333 ZZZ 1234
|
|||||||
dn: cn=Torvlobnor Puzdoy,${BASEDN}
|
dn: cn=Torvlobnor Puzdoy,${BASEDN}
|
||||||
changetype: delete
|
changetype: delete
|
||||||
|
|
||||||
|
dn: o=An Org,${BASEDN}
|
||||||
|
changetype: add
|
||||||
|
objectClass: organization
|
||||||
|
o: An Org
|
||||||
|
|
||||||
|
dn: o=An Org,${BASEDN}
|
||||||
|
changetype: modrdn
|
||||||
|
newrdn: o=Another Org
|
||||||
|
deleteoldrdn: 1
|
||||||
|
|
||||||
|
dn: documentTitle=book1,${BASEDN}
|
||||||
|
changetype: modify
|
||||||
|
add: documentAuthor
|
||||||
|
documentAuthor: cn=Pierangelo Masarati,${BASEDN}
|
||||||
|
-
|
||||||
|
|
||||||
|
dn: documentTitle=book2,${BASEDN}
|
||||||
|
changetype: modify
|
||||||
|
add: documentAuthor
|
||||||
|
documentAuthor: cn=Pierangelo Masarati,${BASEDN}
|
||||||
|
-
|
||||||
|
|
||||||
EOMODS
|
EOMODS
|
||||||
|
|
||||||
RC=$?
|
RC=$?
|
||||||
@ -283,7 +341,7 @@ EOMODS
|
|||||||
|
|
||||||
echo "Filtering ldapsearch results..."
|
echo "Filtering ldapsearch results..."
|
||||||
. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
|
. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
|
||||||
echo "Filtering original ldif used to create database..."
|
echo "Filtering modified ldif..."
|
||||||
. $LDIFFILTER < $SQLMODS > $LDIFFLT
|
. $LDIFFILTER < $SQLMODS > $LDIFFLT
|
||||||
echo "Comparing filter output..."
|
echo "Comparing filter output..."
|
||||||
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
|
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
|
||||||
|
Loading…
Reference in New Issue
Block a user