1691N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
1691N/A ! The contents of this file are subject to the terms of the 1691N/A ! Common Development and Distribution License, Version 1.0 only 1691N/A ! (the "License"). You may not use this file except in compliance 1691N/A ! You can obtain a copy of the license at 1691N/A ! See the License for the specific language governing permissions 1691N/A ! and limitations under the License. 1691N/A ! When distributing Covered Code, include this CDDL HEADER in each 1691N/A ! file and include the License file at 1691N/A ! add the following below this CDDL HEADER, with the fields enclosed 1691N/A ! by brackets "[]" replaced with your own identifying information: 1691N/A ! Portions Copyright [yyyy] [name of copyright owner] 4618N/A ! Copyright 2007-2009 Sun Microsystems, Inc. 4618N/A <
defaultcall function="dynamic"/>
4618N/A applicationDn='uid=my_application,dc=groups,dc=com'
4618N/A applicationPswd='pw_my_application'
4618N/A dynamicGroupDn='cn=my_dynamicgroup1,dc=groups,dc=com'
4618N/A newDynamicGroup='my_newDynamicGroup'
4618N/A newDynamicGroupDn='cn=%s,dc=groups,dc=com' % (newDynamicGroup)
4618N/A newDynamicGroupPswd='pw_%s' % (newDynamicGroup)
4618N/A user0Dn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user0)
4618N/A user1Dn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user1)
4618N/A user2Dn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2)
4618N/A user2AddDn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2Add)
4618N/A user2AddRenamed='%s_bis' % (user2Add)
4618N/A user2AddRenamedDn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2AddRenamed)
4618N/A CurrentTestPath['group']='groups'
4618N/A CurrentTestPath['suite']=STAXCurrentBlock
4618N/A <
call function="'testSuite_Preamble'"/>
4618N/A <!--- Test Suite information 4618N/A #@TestSuiteName Group test suite 4618N/A #@TestSuitePurpose Test this feature 4618N/A #@TestSuiteGroup Dynamic Group 4618N/A <
import machine="STAF_LOCAL_HOSTNAME" 4618N/A <
import machine="STAF_LOCAL_HOSTNAME" 4618N/A <
call function="'common_setup'">
4618N/A <
call function="'group_setup'"/>
4618N/A <!--- Test Case information 4618N/A #@TestMarker Dynamic Group Tests 4618N/A #@TestName Group: Dynamic: add a dynamic group entry 4618N/A <
testcase name="getTestCaseName('add a dynamic group entry')">
4618N/A <
call function="'testCase_Preamble'"/>
4618N/A '++++ Application add group entry %s' % newDynamicGroupDn
4618N/A <
call function="'addAnEntry'">
4618N/A 'dsInstanceDn' : applicationDn ,
4618N/A 'dsInstancePswd' : applicationPswd ,
4618N/A 'DNToAdd' : newDynamicGroupDn,
4618N/A 'listAttributes' : listAttr
4618N/A <!-- ******************** --> 4618N/A '++++ Application do a search to check the entry has been created'
4618N/A <
call function="'ldapSearchWithScript'">
4618N/A 'dsInstanceDn' : applicationDn ,
4618N/A 'dsInstancePswd' : applicationPswd ,
4618N/A 'dsBaseDN' : newDynamicGroupDn ,
4618N/A 'dsFilter' : 'objectclass=*' ,
4618N/A 'dsAttributes' : 'uniquemember' }
4618N/A <!-- ******************** --> 4618N/A <
call function="'CheckIsMemberOf'">
4618N/A 'string2find' : newDynamicGroupDn ,
4618N/A <
call function="'testCase_Postamble'"/>
4618N/A <!--- Test Case information 4618N/A #@TestMarker Dynamic Group Tests 4618N/A #@TestName Group: Dynamic: delete a dynamic group entry 4618N/A <
testcase name="getTestCaseName('delete a dynamic group entry')">
4618N/A <
call function="'testCase_Preamble'"/>
4618N/A '++++ Delete the group entry %s' % newDynamicGroupDn
4618N/A <
call function="'DeleteEntry'">
4618N/A 'dsInstanceDn' : applicationDn ,
4618N/A 'dsInstancePswd' : applicationPswd ,
4618N/A 'dsBaseDN' : newDynamicGroupDn,
4618N/A '++++ Check the group entry %s no more exist' % newDynamicGroup
4618N/A <
call function="'ldapSearchWithScript'">
4618N/A 'dsInstanceDn' : applicationDn ,
4618N/A 'dsInstancePswd' : applicationPswd ,
4618N/A 'dsBaseDN' : newDynamicGroupDn ,
4618N/A 'dsFilter' : 'objectclass=*' ,
4618N/A <!-- ******************** --> 4618N/A <
call function="'CheckIsMemberOf'">
4618N/A 'string2find' : newDynamicGroupDn ,
4618N/A <
call function="'testCase_Postamble'"/>
4618N/A <!--- Test Case information 4618N/A #@TestMarker Dynamic Group Tests 4618N/A #@TestName Group: Dynamic: no group user do a search 4618N/A <
testcase name="getTestCaseName('no group user do a search')">
4618N/A <
call function="'testCase_Preamble'"/>
4618N/A '++++ %s search itself (should PASS as not a member of dynamic group)' % user1
4618N/A <
call function="'ldapSearchWithScript'">
4618N/A 'dsInstancePswd' : user1Pswd ,
4618N/A 'dsFilter' : 'objectclass=*' ,
4618N/A <!-- ******************** --> 4618N/A <
call function="'CheckIsMemberOf'">
4618N/A 'string2find' : dynamicGroupDn ,
4618N/A <
call function="'testCase_Postamble'"/>
4618N/A <!--- Test Case information 4618N/A #@TestMarker Dynamic Group Tests 4618N/A #@TestName Group: Dynamic: group user do a search 4618N/A <
testcase name="getTestCaseName('group user do a search')">
4618N/A <
call function="'testCase_Preamble'"/>
4618N/A '++++ %s search itself (should be refused as dynamic group does not have the permission)' % user2
4618N/A <
call function="'ldapSearchWithScript'">
4618N/A 'dsInstancePswd' : user2Pswd ,
4618N/A 'dsFilter' : 'objectclass=*' ,
4618N/A '++++ Check the search returns nothing'
4618N/A <
call function="'CheckMatches'">
4618N/A 'mainString' : STAXResult[0][1] ,
4618N/A <!-- ******************** --> 4618N/A <
call function="'CheckIsMemberOf'">
4618N/A 'string2find' : dynamicGroupDn ,
4618N/A <
call function="'testCase_Postamble'"/>
4618N/A <!--- Test Case information 4618N/A #@TestMarker Dynamic Group Tests 4618N/A #@TestName Group: Dynamic: application add entry that belong to a group 4618N/A <
testcase name="getTestCaseName('application add entry that belong to a group')">
4618N/A <
call function="'testCase_Preamble'"/>
4618N/A '++++ Application add a new user %s / %s ' % (user2AddDn,user2AddPswd)
4618N/A <
call function="'addAnEntry'">
4618N/A 'dsInstanceDn' : applicationDn ,
4618N/A 'dsInstancePswd' : applicationPswd ,
4618N/A 'listAttributes' : listAttr
4618N/A <!-- ******************** --> 4618N/A '++++ %s search itself (should be refused as dynamic group does not have permission)' % user2Add
4618N/A <
call function="'ldapSearchWithScript'">
4618N/A 'dsInstanceDn' : user2AddDn ,
4618N/A 'dsInstancePswd' : user2AddPswd ,
4618N/A 'dsFilter' : 'objectclass=*' ,
4618N/A '++++ Check the search returns nothing'
4618N/A <
call function="'CheckMatches'">
4618N/A 'mainString' : STAXResult[0][1] ,
4618N/A <!-- ******************** --> 4618N/A <
call function="'CheckIsMemberOf'">
4618N/A 'string2find' : dynamicGroupDn ,
4618N/A <
call function="'testCase_Postamble'"/>
4618N/A <!--- Test Case information 4618N/A #@TestMarker Dynamic Group Tests 4618N/A #@TestName Group: Dynamic: application rename entry that belong to a group 4618N/A <testcase name="getTestCaseName('application rename entry that belong to a group')"> 4618N/A <call function="'testCase_Preamble'"/> 4618N/A '++++ Application rename %s into %s ' % (user2Add,user2AddRenamed) 4618N/A <call function="'modifyDn'"> 4618N/A 'dsInstanceDn' : applicationDn , 4618N/A 'dsInstancePswd' : applicationPswd , 4618N/A 'DNToModify' : user2AddDn , 4618N/A 'newRDN' : user2AddRenamed, 4618N/A <!-- ******************** --> 4618N/A '++++ %s search itself (should be refused as dynamic group does not have permission)' % user2AddRenamed 4618N/A <call function="'ldapSearchWithScript'"> 4618N/A 'dsInstanceDn' : user2AddRenamedDn , 4618N/A 'dsInstancePswd' : user2AddPswd , 4618N/A 'dsBaseDN' : user2AddRenamedDn , 4618N/A 'dsFilter' : 'objectclass=*' , 4618N/A '++++ Check the search returns nothing' 4618N/A <call function="'CheckMatches'"> 4618N/A 'mainString' : STAXResult[0][1] , 4618N/A <!-- ******************** --> 4618N/A <call function="'CheckIsMemberOf'"> 4618N/A { 'baseDn' : user2AddRenamedDn , 4618N/A 'string2find' : dynamicGroupDn , 4618N/A <call function="'testCase_Postamble'"/> 4618N/A <!--- Test Case information 4618N/A #@TestMarker Dynamic Group Tests 4618N/A #@TestName Group: Dynamic: application delete entry belonging to a group 4618N/A <
testcase name="getTestCaseName('application delete entry belonging to a group')">
4618N/A <
call function="'testCase_Preamble'"/>
4618N/A '++++ Application delete user %s' % user2Add
4618N/A <
call function="'DeleteEntry'">
4618N/A 'dsInstanceDn' : applicationDn ,
4618N/A 'dsInstancePswd' : applicationPswd ,
4618N/A <!-- ******************** --> 4618N/A '++++ Check the entry %s no more exist' % user2Add
4618N/A <
call function="'ldapSearchWithScript'">
4618N/A 'dsInstanceDn' : applicationDn ,
4618N/A 'dsInstancePswd' : applicationPswd ,
4618N/A 'dsFilter' : 'objectclass=*' ,
4618N/A <!-- ******************** --> 4618N/A '++++ %s do a search (should fail)' % user2Add
4618N/A <
call function="'ldapSearchWithScript'">
4618N/A 'dsInstanceDn' : user2AddDn ,
4618N/A 'dsInstancePswd' : user2AddPswd ,
4618N/A 'dsFilter' : 'objectclass=*' ,
4618N/A <
call function="'testCase_Postamble'"/>
4618N/A <!-- Test Suite Cleanup --> 4618N/A <
message>'Finally: Global Groups Cleanup.'</
message>
4618N/A <
call function="'common_cleanup'" />
4618N/A <
catch exception="'STAFException'">
4618N/A <
message log="1" level="'fatal'">'Cleanup of test suite failed.'</
message>
4618N/A <
call function="'testSuite_Postamble'"/>