Hi.

Our environment has unique generated naming attributes for user objects
and I need to do an LDAP search to find the object I want to delete in
Setup/Cleanup stages of my test.

I thought this was easy, just do an "Get Object FDN and Set variable",
store the DN in a variable and then do a "Delete objects" action
referring to that variable.

This works fine as long as the object I want to delete exists in the
directory. However if the object does not exist Validator will try and
remove the top of the tree (fortunatly this is denied by eDirectory).

How can I do an LDAP search to delete objects and make sure it is
working even if the object is not found?


Code:
--------------------
06/08/2016 14:39:23 INFO: ================================= TEST =======================================
06/08/2016 14:39:23 INFO: Executing test: Sanitized log
06/08/2016 14:39:23 INFO: -------------------------------- SETUP ACTION --------------------------------
06/08/2016 14:39:23 INFO: IDV: findObject() - Base DN: ou=Users,o=IDV Matching rule: {workforceID=[384273843], objectClass=[inetOrgPerson]}
06/08/2016 14:39:23 INFO: IDV: findObject() - Setting Variable: Staff-TestPerson1-DN
06/08/2016 14:39:23 INFO: LDAP filter: (&(workforceID=384273843)(objectClass=inetOrgPerso n))
06/08/2016 14:39:23 INFO: Object not found. Base DN: ou=Users,o=IDV Matching rule: {workforceID=[384273843], objectClass=[inetOrgPerson]}
06/08/2016 14:39:23 INFO: IDV: findObject() - retry 1 of 5
06/08/2016 14:39:24 INFO: LDAP filter: (&(workforceID=384273843)(objectClass=inetOrgPerso n))
06/08/2016 14:39:24 INFO: Object not found. Base DN: ou=Users,o=IDV Matching rule: {workforceID=[384273843], objectClass=[inetOrgPerson]}
06/08/2016 14:39:24 INFO: IDV: findObject() - retry 2 of 5
06/08/2016 14:39:25 INFO: LDAP filter: (&(workforceID=384273843)(objectClass=inetOrgPerso n))
06/08/2016 14:39:25 INFO: Object not found. Base DN: ou=Users,o=IDV Matching rule: {workforceID=[384273843], objectClass=[inetOrgPerson]}
06/08/2016 14:39:25 INFO: IDV: findObject() - retry 3 of 5
06/08/2016 14:39:26 INFO: LDAP filter: (&(workforceID=384273843)(objectClass=inetOrgPerso n))
06/08/2016 14:39:26 INFO: Object not found. Base DN: ou=Users,o=IDV Matching rule: {workforceID=[384273843], objectClass=[inetOrgPerson]}
06/08/2016 14:39:26 INFO: IDV: findObject() - retry 4 of 5
06/08/2016 14:39:27 INFO: LDAP filter: (&(workforceID=384273843)(objectClass=inetOrgPerso n))
06/08/2016 14:39:27 INFO: Object not found. Base DN: ou=Users,o=IDV Matching rule: {workforceID=[384273843], objectClass=[inetOrgPerson]}
06/08/2016 14:39:27 INFO: IDV: findObject() - retry 5 of 5
06/08/2016 14:39:28 INFO: LDAP filter: (&(workforceID=384273843)(objectClass=inetOrgPerso n))
06/08/2016 14:39:28 INFO: Object not found. Base DN: ou=Users,o=IDV Matching rule: {workforceID=[384273843], objectClass=[inetOrgPerson]}
06/08/2016 14:39:28 WARNING: WARNING: Object was not found.
06/08/2016 14:39:29 INFO: -------------------------------- SETUP ACTION --------------------------------
06/08/2016 14:39:29 INFO: IDV: deleteObjects() - values: []
06/08/2016 14:39:29 INFO: Deleting 1 object(s)...
06/08/2016 14:39:29 INFO: Error while executing action method deleteObjects: java.lang.AssertionError: LDAPException: Other (80) Other
LDAPException: Server Message: NDS error: partition root (-667)
LDAPException: Matched DN:
06/08/2016 14:39:29 INFO: *********** FAILING TEST Sanitized log - CONTINUE TO NEXT TEST ***********
06/08/2016 14:39:29 INFO: FAILED - Sanitized log
--------------------


Thank you!

Best Regards
Marcus


--
marcus_jonsson
------------------------------------------------------------------------
marcus_jonsson's Profile: https://forums.netiq.com/member.php?userid=1157
View this thread: https://forums.netiq.com/showthread.php?t=56000