@William Brown
I am attaching the main script where i am facing the problem .
F4 gives me the following :
With search_s:
(Pdb) topo.standalone.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE, F4)
[dn: uid=bhall,ou=People,dc=example,dc=com
cn: Benjamin Hall
gidNumber: 2000
givenName: Benjamin
homeDirectory: /home/bhall
l: sunnyvale
mail: bhall@xxxxxxxx
manager: uid=trigden,ou=People,dc=example,dc=com
objectClass: top
objectClass: account
objectClass: posixaccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: nsMemberOf
objectClass: nsAccount
objectClass: person
ou: Product Development
ou: People
roomNumber: 2511
sn: Hall
telephoneNumber: +1 408 555 6067
uid: bhall
uidNumber: 1000
userPassword: {PBKDF2_SHA256}AAAIAAlpB8Yaw03XDVfXkH++eiCaugb3D660gbb6xBE3dkSCXOiCVqvM80dTPhPuSBISkY8IWJZgZXXoDt54brqRweEpqZ4YPrMTtqBAd/2kCsX+ZRM9phJLZFd9k7bIAM3joCnxVPFwyR1ETDSHkes0RSql7Isi+oKb8dloC+m5vzj1NG1M/o0TxdICTMxIBvuln+BdANOS9waGyqJgZfZBnQfw2t3lHOKXFxiduaWSZJvwVV8JtYkHt/ofdmqKItayc00eG6EM44qPS19XZa+3drTADPkL7HNAVhMHg1Y8iIWIXKvlZ7WJ1V/ySrHL6SU6XzcXtMNjBT/qi+GCHpu2Bc+Ka2C0iUZwY5ZiJ7YUANa3UYxh6oIVUgKNVmX+4CkJczJLcEgoI43zFCFnFsjtNHYwflPuIPFtwaXvgeBojItZ
]
[dn: uid=bhall,ou=People,dc=example,dc=com
cn: Benjamin Hall
gidNumber: 2000
givenName: Benjamin
homeDirectory: /home/bhall
l: sunnyvale
mail: bhall@xxxxxxxx
manager: uid=trigden,ou=People,dc=example,dc=com
objectClass: top
objectClass: account
objectClass: posixaccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: nsMemberOf
objectClass: nsAccount
objectClass: person
ou: Product Development
ou: People
roomNumber: 2511
sn: Hall
telephoneNumber: +1 408 555 6067
uid: bhall
uidNumber: 1000
userPassword: {PBKDF2_SHA256}AAAIAAlpB8Yaw03XDVfXkH++eiCaugb3D660gbb6xBE3dkSCXOiCVqvM80dTPhPuSBISkY8IWJZgZXXoDt54brqRweEpqZ4YPrMTtqBAd/2kCsX+ZRM9phJLZFd9k7bIAM3joCnxVPFwyR1ETDSHkes0RSql7Isi+oKb8dloC+m5vzj1NG1M/o0TxdICTMxIBvuln+BdANOS9waGyqJgZfZBnQfw2t3lHOKXFxiduaWSZJvwVV8JtYkHt/ofdmqKItayc00eG6EM44qPS19XZa+3drTADPkL7HNAVhMHg1Y8iIWIXKvlZ7WJ1V/ySrHL6SU6XzcXtMNjBT/qi+GCHpu2Bc+Ka2C0iUZwY5ZiJ7YUANa3UYxh6oIVUgKNVmX+4CkJczJLcEgoI43zFCFnFsjtNHYwflPuIPFtwaXvgeBojItZ
]
With filter:
(Pdb) Accounts(topo.standalone, DEFAULT_SUFFIX).filter(F4)[0].dn
'uid=bhall,ou=People,dc=example,dc=com'
(Pdb) Accounts(topo.standalone, DEFAULT_SUFFIX).filter(F4)[0]._unsafe_raw_entry()
dn: uid=bhall,ou=People,dc=example,dc=com
cn: Benjamin Hall
gidNumber: 2000
givenName: Benjamin
homeDirectory: /home/bhall
l: sunnyvale
mail: bhall@xxxxxxxx
manager: uid=trigden,ou=People,dc=example,dc=com
objectClass: top
objectClass: account
objectClass: posixaccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: nsMemberOf
objectClass: nsAccount
objectClass: person
ou: Product Development
ou: People
roomNumber: 2511
sn: Hall
telephoneNumber: +1 408 555 6067
uid: bhall
uidNumber: 1000
userPassword: {PBKDF2_SHA256}AAAIAAlpB8Yaw03XDVfXkH++eiCaugb3D660gbb6xBE3dkSCXOiCVqvM80dTPhPuSBISkY8IWJZgZXXoDt54brqRweEpqZ4YPrMTtqBAd/2kCsX+ZRM9phJLZFd9k7bIAM3joCnxVPFwyR1ETDSHkes0RSql7Isi+oKb8dloC+m5vzj1NG1M/o0TxdICTMxIBvuln+BdANOS9waGyqJgZfZBnQfw2t3lHOKXFxiduaWSZJvwVV8JtYkHt/ofdmqKItayc00eG6EM44qPS19XZa+3drTADPkL7HNAVhMHg1Y8iIWIXKvlZ7WJ1V/ySrHL6SU6XzcXtMNjBT/qi+GCHpu2Bc+Ka2C0iUZwY5ZiJ7YUANa3UYxh6oIVUgKNVmX+4CkJczJLcEgoI43zFCFnFsjtNHYwflPuIPFtwaXvgeBojItZ
'uid=bhall,ou=People,dc=example,dc=com'
(Pdb) Accounts(topo.standalone, DEFAULT_SUFFIX).filter(F4)[0]._unsafe_raw_entry()
dn: uid=bhall,ou=People,dc=example,dc=com
cn: Benjamin Hall
gidNumber: 2000
givenName: Benjamin
homeDirectory: /home/bhall
l: sunnyvale
mail: bhall@xxxxxxxx
manager: uid=trigden,ou=People,dc=example,dc=com
objectClass: top
objectClass: account
objectClass: posixaccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: nsMemberOf
objectClass: nsAccount
objectClass: person
ou: Product Development
ou: People
roomNumber: 2511
sn: Hall
telephoneNumber: +1 408 555 6067
uid: bhall
uidNumber: 1000
userPassword: {PBKDF2_SHA256}AAAIAAlpB8Yaw03XDVfXkH++eiCaugb3D660gbb6xBE3dkSCXOiCVqvM80dTPhPuSBISkY8IWJZgZXXoDt54brqRweEpqZ4YPrMTtqBAd/2kCsX+ZRM9phJLZFd9k7bIAM3joCnxVPFwyR1ETDSHkes0RSql7Isi+oKb8dloC+m5vzj1NG1M/o0TxdICTMxIBvuln+BdANOS9waGyqJgZfZBnQfw2t3lHOKXFxiduaWSZJvwVV8JtYkHt/ofdmqKItayc00eG6EM44qPS19XZa+3drTADPkL7HNAVhMHg1Y8iIWIXKvlZ7WJ1V/ySrHL6SU6XzcXtMNjBT/qi+GCHpu2Bc+Ka2C0iUZwY5ZiJ7YUANa3UYxh6oIVUgKNVmX+4CkJczJLcEgoI43zFCFnFsjtNHYwflPuIPFtwaXvgeBojItZ
Now consider the following condition ,
(Pdb) topo.standalone.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE, F4,['modifiersName','modifyTimestamp'])
[dn: uid=bhall,ou=People,dc=example,dc=com
modifiersName: cn=directory manager
modifyTimestamp: 20190509030743Z
]
[dn: uid=bhall,ou=People,dc=example,dc=com
modifiersName: cn=directory manager
modifyTimestamp: 20190509030743Z
]
Problem is :
modifiersName and modifyTimestamp can never get with filter .
Regards
Anuj Borah
On Wed, May 8, 2019 at 6:08 AM William Brown <wbrown@xxxxxxx> wrote:
> On 7 May 2019, at 23:56, Viktor Ashirov <vashirov@xxxxxxxxxx> wrote:
>
> On Tue, May 7, 2019 at 2:09 PM William Brown <wbrown@xxxxxxx> wrote:
>>
>>
>>
>>> On 7 May 2019, at 22:03, Viktor Ashirov <vashirov@xxxxxxxxxx> wrote:
>>>
>>> On Mon, Apr 29, 2019 at 6:48 AM William Brown <wbrown@xxxxxxx> wrote:
>>>>
>>>>
>>>>
>>>>> On 29 Apr 2019, at 12:33, Anuj Borah <aborah@xxxxxxxxxx> wrote:
>>>>>
>>>>> @William Brown
>>>>>
>>>>> Thanks for the tip!
>>>>>
>>>>> (Pdb) len(topo.standalone.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE,"testUserAccountControl:1.2.840.113556.1.4.803:=8388608", ['attrlist=cn:sn:uid:testUserAccountControl']))
>>>>> 6
>>>>> (Pdb) len(Accounts(topo.standalone, DEFAULT_SUFFIX).filter("(testUserAccountControl:1.2.840.113556.1.4.803:=8388608)"))
>>>>> 6
>>>>>
>>>>> We cant not mix up ['attrlist=cn:sn:uid:testUserAccountControl'] with filter , like we do with search_s .
>>>>>
>>>>> (Pdb) len(Accounts(topo.standalone, DEFAULT_SUFFIX).filter("(testUserAccountControl:1.2.840.113556.1.4.803:=8388608)", ['attrlist=cn:sn:uid:testUserAccountControl']))
>>>>> *** TypeError: filter() takes 2 positional arguments but 3 were given
>>>>> (Pdb) len(Accounts(topo.standalone, DEFAULT_SUFFIX).filter("(testUserAccountControl:1.2.840.113556.1.4.803:=8388608), ['attrlist=cn:sn:uid:testUserAccountControl']"))
>>>>> *** ldap.FILTER_ERROR: {'desc': 'Bad search filter', 'errno': 2, 'info': 'No such file or directory'}
>>>>>
>>>>> Again i have to use "re" module for the same .
>>>>>
>>>>>
>>>>
>>>> What are you trying to achieve?
>>> Test case is very simple: search for entries using different filters
>>> and request specific attributes.
>>
>> But those entries have types and classes - you know what you are expecting to get.
>>
>>> The problem that Anuj is facing is that filter() doesn't support
>>> attrlist. Moreover, _unsafe_raw_entry() doesn't return *all*
>>> attributes, it omits operational attributes (like nsRoleDN).
>>> IMHO, search_s is good enough here.
>>
>> If you want to avoid any of the "magic" use DSLdapObjects(instance).filter() then because that doesn't prescribe any classes. But it does take a lot of the safety out of the library, and I still think that there is something missing in the approach here.
> I have a problem with DSLdapObjects(instance).filter() is that it
> takes way more effort to write *test* code with a very little benefit.
> Consider this example: I need to fetch all regular attributes,
> operational attributes and entry state information from the server.
> With DSLdapObjects I had to do the following:
> (Pdb) _ = Accounts(topo.standalone, DEFAULT_SUFFIX)
> (Pdb) _._filterattrs=["*", "+", "nscpEntryWSI"]
> (Pdb) _.filter(F10)[0].get_all_attrs()
>
> get_all_attrs() doesn't return nscpEntryWSI at all, and, as a bonus,
> lowercases some of the attribute names.
>
> vs.
>
> (Pdb) topo.standalone.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE,
> attrlist=["*", "+", "nscpEntryWSI"])
>
> Safety here is not a main concern, since it's a test code. In tests we
> need more than often to have a raw LDAP access without too much
> abstractions. Main concern is precision and certainty.
> Abstractions are good when they increase clarity and make things
> certain. In case of the very common search pattern above, DSLdapObject
> doesn't work really well. For me at least.
And that's fine, search_s can still work - the issue here is that Anuj has not articulated what he's trying to achieve, and has previously misunderstood the api :(. So honestly, I need to see this in a test case, with proper code structures to comment more.
The main reason to avoid search_s is that today in DirSrv it uses a really horrid hack to get Entry, which I have wanted to purge with fire for a long time - so the main reason to minimise it's use is to limit damage when I do eventually change that api.
>>
>>
>>>>
>>>>
>>>> Sincerely,
>>>>
>>>> William Brown
>>>>
>>>> Senior Software Engineer, 389 Directory Server
>>>> SUSE Labs
>>>> _______________________________________________
>>>> 389-devel mailing list -- 389-devel@xxxxxxxxxxxxxxxxxxxxxxx
>>>> To unsubscribe send an email to 389-devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
>>>> Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
>>>> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
>>>> List Archives: https://lists.fedoraproject.org/archives/list/389-devel@xxxxxxxxxxxxxxxxxxxxxxx
>>>
>>>
>>>
>>> --
>>> Viktor
>>> _______________________________________________
>>> 389-devel mailing list -- 389-devel@xxxxxxxxxxxxxxxxxxxxxxx
>>> To unsubscribe send an email to 389-devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
>>> Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
>>> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
>>> List Archives: https://lists.fedoraproject.org/archives/list/389-devel@xxxxxxxxxxxxxxxxxxxxxxx
>>
>> —
>> Sincerely,
>>
>> William Brown
>>
>> Senior Software Engineer, 389 Directory Server
>> SUSE Labs
>> _______________________________________________
>> 389-devel mailing list -- 389-devel@xxxxxxxxxxxxxxxxxxxxxxx
>> To unsubscribe send an email to 389-devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
>> Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
>> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
>> List Archives: https://lists.fedoraproject.org/archives/list/389-devel@xxxxxxxxxxxxxxxxxxxxxxx
>
>
>
> --
> Viktor
> _______________________________________________
> 389-devel mailing list -- 389-devel@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to 389-devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedoraproject.org/archives/list/389-devel@xxxxxxxxxxxxxxxxxxxxxxx
—
Sincerely,
William Brown
Senior Software Engineer, 389 Directory Server
SUSE Labs
# --- BEGIN COPYRIGHT BLOCK --- # Copyright (C) 2019 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). # See LICENSE for details. # --- END COPYRIGHT BLOCK --- """ This script will test different type of Filers. """ import os import re import pytest from lib389._constants import DEFAULT_SUFFIX, PW_DM from lib389.topologies import topology_st as topo from lib389.idm.user import UserAccount, UserAccounts, TEST_USER_PROPERTIES from lib389.idm.organizationalunit import OrganizationalUnits from lib389.schema import Schema from lib389.idm.account import Accounts import ldap F1 = "(sn=Hall)" F2 = "(nsRoleDN=cn=new managed role)" F3 = "(l=sunnyvale)" F5 = "(uid=rjense2)" F6 = "(nsRoleDN=cn=new managed *)" F7 = "(uid=*tal*2)" F9 = "(uid=mtyler)" F4 = "(& (| {} {}) {})".format(F2, F1, F3) F8 = "(& {} {})".format(F7, F6) F10 = "(& {} {})".format(F6, F9) LIST_OF_USER = ['scarter', 'tmorris', 'kvaughan', 'abergin', 'dmiller', 'gfarmer', 'kwinters', 'trigden', 'cschmith', 'jwallace', 'jwalker', 'tclow', 'rdaugherty', 'jreuter', 'tmason', 'btalbot', 'mward', 'bjablons', 'jmcFarla', 'llabonte', 'jcampaig', 'bhal2', 'alutz', 'achassin', 'hmiller', 'jcampai2', 'lulrich', 'mlangdon', 'striplet', 'gtriplet', 'jfalena', 'speterso', 'ejohnson', 'prigden', 'bwalker', 'kjensen', 'mlott', 'cwallace', 'tpierce', 'rbannist', 'bplante', 'rmills', 'bschneid', 'skellehe', 'brentz', 'dsmith', 'scarte2', 'dthorud', 'ekohler', 'lcampbel', 'tlabonte', 'slee', 'bfree', 'tschneid', 'prose', 'jhunter', 'ashelton', 'mmcinnis', 'falbers', 'mschneid', 'pcruse', 'tkelly', 'gtyler'] @pytest.fixture(scope="module") def _user_create(topo): """ :param topo: :return: Will create users used for this test script . """ users_people = UserAccounts(topo.standalone, DEFAULT_SUFFIX) for demo1 in LIST_OF_USER: users_people.create(properties={ 'uid': demo1, 'cn': demo1, 'sn': demo1, 'uidNumber': str(1000), 'gidNumber': '2000', 'homeDirectory': '/home/' + demo1, 'givenname': demo1, 'userpassword': PW_DM }) users_people.create(properties={ 'uid': 'bhall', 'cn': 'Benjamin Hall', 'sn': 'Hall', 'uidNumber': str(1000), 'gidNumber': '2000', 'homeDirectory': '/home/' + 'bhall', 'mail': 'bhall@xxxxxxxx', 'givenname': 'Benjamin', 'ou': ['Product Development', 'People'], 'l': 'sunnyvale', 'telephonenumber': '+1 408 555 6067', 'roomnumber': '2511', 'manager': 'uid=trigden, ou=People, dc=example, dc=com', 'nsRoleDN': 'cn=new managed role, ou=People, dc=example, dc=com', 'userpassword': PW_DM, }) ous = OrganizationalUnits(topo.standalone, DEFAULT_SUFFIX) ou_ou = ous.create(properties={'ou': 'COS'}) ous = OrganizationalUnits(topo.standalone, ou_ou.dn) ous.create(properties={'ou': 'MailSchemeClasses'}) Schema(topo.standalone).\ add('attributetypes', "( 9.9.8.4 NAME 'emailclass' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 " "X-ORIGIN 'RFC 2256' )") Schema(topo.standalone).\ add('objectclasses', "( 9.9.8.2 NAME 'mailSchemeUser' DESC " "'User Defined ObjectClass' SUP 'top' MUST " "( objectclass ) MAY (aci $ emailclass) X-ORIGIN 'RFC 2256' )") users_people.create(properties={ 'cn': 'Randy Jensen', 'sn': 'Jensen', 'givenname': 'Randy', 'objectclass': 'top account person organizationalPerson inetOrgPerson mailSchemeUser ' 'mailRecipient posixaccount'.split(), 'l': 'sunnyvale', 'uid': 'rjense2', 'uidNumber': str(1000), 'gidNumber': str(1000), 'homeDirectory': '/home/' + 'rjense2', 'mail': 'rjense2@xxxxxxxxxxx', 'telephonenumber': '+1 408 555 9045', 'roomnumber': '1984', 'manager': 'uid=jwalker, ou=People, dc=example,dc=com', 'nsRoleDN': 'cn=new managed role, ou=People, dc=example, dc=com', 'emailclass': 'vpemail', 'mailquota': '600', 'userpassword': PW_DM, }) users_people.create(properties={ 'cn': 'Bjorn Talbot', 'sn': 'Talbot', 'givenname': 'Bjorn', 'objectclass': 'top account person organizationalPerson inetOrgPerson posixaccount'.split(), 'ou': ['Product Development', 'People'], 'l': 'Santa Clara', 'uid': 'btalbo2', 'mail': 'btalbo2@xxxxxxxxxxx', 'telephonenumber': '+1 408 555 4234', 'roomnumber': '1205', 'uidNumber': str(1000), 'gidNumber': str(1000), 'homeDirectory': '/home/' + 'btalbo2', 'manager': 'uid=trigden, ou=People, dc=example,dc=com', 'nsRoleDN': 'cn=new managed role, ou=People, dc=example, dc=com', 'userpassword': PW_DM }) users_people.create(properties={ 'objectclass': 'top ' 'account ' 'person ' 'organizationalPerson ' 'inetOrgPerson ' 'mailRecipient ' 'mailSchemeUser ' 'posixaccount'.split(), 'cn': 'Matthew Tyler', 'sn': 'Tyler', 'givenname': 'Matthew', 'ou': ['Human Resources', 'People'], 'l': 'Cupertino', 'uid': 'mtyler', 'mail': 'mtyler@xxxxxxxxxxx', 'telephonenumber': '+1 408 555 7907', 'roomnumber': '2701', 'uidNumber': str(1000), 'gidNumber': str(1000), 'homeDirectory': '/home/' + 'mtyler', 'manager': 'uid=jwalker, ou=People, dc=example,dc=com', 'nsRoleDN': 'cn=new managed role, ou=People, dc=example, dc=com', 'mailquota': '600', 'userpassword': PW_DM}) VALUES = ["len(re.findall('cn:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4, ['cn', 'cn', 'cn'])))) == 1", "len(re.findall('cn:',str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4, ['*', 'cn'])))) == 1", "len(re.findall('cn:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4, ['cn', 'Cn', 'CN'])))) == 1", "len(re.findall('Cn:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4, ['cn', 'Cn', 'CN'])))) == 0", "len(re.findall('CN:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4, ['cn', 'Cn', 'CN'])))) == 0", "len(re.findall('cn:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4, ['cn', '*'])))) == 1", "len(re.findall('mailquota:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F5, ['*', 'mailquota'])))) == 1", "len(re.findall('mailquota:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F5, ['mailquota', '*'])))) == 1", "len(re.findall('mailquota:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F5, ['*', 'mailquota'])))) == 1", "len(re.findall('modifiersName:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4,['modifiersName','modifyTimestamp'])))) == 1", "len(re.findall('modifyTimestamp:', str(conn.search_s(DEFAULT_SUFFIX," "ldap.SCOPE_SUBTREE, F4,['modifiersName','modifyTimestamp']))))== 1", "len(re.findall('modifiersName:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4,['*', 'modifiersName', 'modifyTimestamp'])))) == 1", "len(re.findall('modifyTimestamp:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4,['*', 'modifiersName','modifyTimestamp'])))) == 1", "len(re.findall('modifiersName:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4,['cn', 'modifiersName','modifyTimestamp'])))) == 1", "len(re.findall('modifyTimestamp:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4,['cn', 'modifiersName','modifyTimestamp'])))) == 1", "len(re.findall('cn:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F4,['cn', 'modifiersName', 'modifyTimestamp'])))) == 1", "len(re.findall('cn:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F8,['cn', 'nsRoleDN'])))) == 1", "len(re.findall('nsRoleDN:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F8,['cn', 'nsRoleDN'])))) == 1", "len(re.findall('cn:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE,F4, ['cn', 'modifiersName', 'nsRoleDN'])))) == 1", "len(re.findall('modifiersName:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE,F4, ['cn', 'modifiersName', 'nsRoleDN'])))) == 1", "len(re.findall('nsRoleDN:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE,F4, ['cn', 'modifiersName', 'nsRoleDN'])))) == 1", "len(re.findall('modifiersName:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE,F4,['cn', '*', 'modifiersName','nsRoleDN'])))) == 1", "len(re.findall('nsRoleDN:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE,F4,['cn', '*', 'modifiersName', 'nsRoleDN'])))) == 1", "len(re.findall('cn:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE,F4,['cn', '*', 'modifiersName', 'nsRoleDN'])))) == 1", "len(re.findall('mailquota:',str(conn.search_s(DEFAULT_SUFFIX," "ldap.SCOPE_SUBTREE, F5, ['mailquota'])))) == 1", "len(re.findall('mailquota:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F10, ['mailquota', 'nsRoleDN'])))) == 1", "len(re.findall('nsRoleDN:', str(conn.search_s(DEFAULT_SUFFIX," "ldap.SCOPE_SUBTREE, F10, ['mailquota', 'nsRoleDN'])))) == 1", "len(re.findall('mailquota:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE,F10,['mailquota', 'modifiersName', 'nsRoleDN'])))) == 1", "len(re.findall('modifiersName:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE,F10,['mailquota', 'modifiersName', 'nsRoleDN'])))) == 1", "len(re.findall('nsRoleDN:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE, F10,['mailquota', 'modifiersName', 'nsRoleDN'])))) == 1", "len(re.findall('nsRoleDN:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE,F10, ['*', 'modifiersName', 'nsRoleDN'])))) == 1", "len(re.findall('modifiersName:', str(conn.search_s(DEFAULT_SUFFIX, " "ldap.SCOPE_SUBTREE,F10, ['*', 'modifiersName', 'nsRoleDN'])))) == 1"] IDS = ['verify that duplicate attributes are not returned from a search even if requested', 'More than 1 cn requested', 'More than 1 cn requested', 'More than 1 cn requested', 'More than 1 cn requested', 'More than 1 cn requested', 'More than 1 cn requested', 'More than 1 cn requested', 'More than 1 cn requested', 'More than 1 cn requested', 'more than 1 cos attribute requested', 'Verify that searches requesting combinations of ' 'regular and operational,irtual, and real attributes works correctly', 'Verify that searches requesting combinations of ' 'regular and operational, virtual, and real attributes works correctly', 'Requesting ALL + operational attributes', 'Requesting regular plus operational attributes', 'Requesting regular plus operational attributes', 'Requesting regular plus operational attributes', 'Regular and operational vaddr', 'Regular and operational vaddr', 'Requesting regular + operational + operational vaddr', 'Requesting regular + operational + operational vaddr', 'Requesting ALL + operational + operational vaddr', 'Requesting ALL + operational + operational vaddr', 'Requesting ALL + operational + operational vaddr', 'Requesting only cos attribute', 'Regular vaddr + operational vaddr requested', 'Regular vaddr + operational vaddr requested', 'Requesting regular vaddr + operational vaddr + operational addr', 'Requesting regular vaddr + operational vaddr + operational addr', 'Requesting regular vaddr + operational vaddr + operational addr', 'Requesting ALL + operational vaddr + operational addr', 'Requesting ALL + operational vaddr + operational addr'] @pytest.mark.parametrize("realvalue", VALUES, ids=IDS) def test_all_together(topo, _user_create, realvalue): """Target_set_with_ldap_instead_of_ldap :id: 51924a38-9baa-11e8-b22a-8c16451d917b :setup: Standalone Server :steps: 1. Create Filter rules. 2. Try to pass filter rules as per the condition . :expectedresults: 1. It should pass 2. It should pass """ assert eval(realvalue) if __name__ == '__main__': CURRENT_FILE = os.path.realpath(__file__) pytest.main("-s -v %s" % CURRENT_FILE)
_______________________________________________ 389-devel mailing list -- 389-devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to 389-devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/389-devel@xxxxxxxxxxxxxxxxxxxxxxx