This function uses make ldif to generate LDIF data files Location of target host Pathname to installation root Display Directory Server version information Path to the template file Path to the LDIF file The seed to use to initialize the random number generator Help option Expected return code value. Default value is 0. Wildcard 'noCheck' to not check the RC { 'name' : 'Make Ldif Script', 'location' : location, 'command' : STAFCmd, 'arguments' : STAFCmdParams, 'expectedRC': expectedRC } [RC, STAXResult] This function makes a make-ldif template file Number of entries Template file name Extra line to add to the mkae-ldif template 'creation of a make-ldif template failed (Code=%s,Reason=%s).' % (STAXCode,STAXReason) { 'returncode' : STAXCode , 'result' : STAXReason } [STAXCode, STAXReason] This function compares two LDIF files and reports the differences in LDIF format Location of target host Pathname to installation root Display Directory Server version information LDIF file to use as the source data LDIF file to use as the target data File to which the diffs should be written Overwrite existing output file rather than append to it Write each attribute-level change as a separate modification per attribute value rather than one modification per entry Help option 'Running command:\n %s %s\nlocation: %s\nworkdir: %s' \ % (STAFCmd,STAFCmdParams,location,dsBinPath) location STAFCmd STAFCmdParams dsBinPath ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] outputLdif diffRC This function modifies an LDIF file with the changes contained in another LDIF file Location of target host Pathname to installation root Display Directory Server version information LDIF file containing the data to be updated LDIF file that will contain the updated data LDIF file containing the changes to apply Help option Expected return code value. Default value is 0. Wildcard 'noCheck' to not check the RC { 'name' : 'LDIF Modify Script', 'location' : location, 'command' : STAFCmd, 'arguments' : STAFCmdParams, 'expectedRC': expectedRC } STAXResult This function verifies that the trees in a group of ldap servers are synchronized. Location of target host Pathname to installation root Server that should be taken as reference. List of the servers to verify against the referenceServer. Suffix of the tree to verify. 'Verify tree %s taking %s as reference.' % (treeSuffix, referenceServerPath) { 'location' : location, 'dsPath' : dsPath, 'dsInstanceHost' : referenceServer.getHostname(), 'dsInstancePort' : referenceServer.getPort(), 'dsInstanceDn' : referenceServer.getRootDn(), 'dsInstancePswd' : referenceServer.getRootPwd(), 'dsBaseDN' : treeSuffix, 'dsFilter' : 'objectclass=*', 'outputFile' : referenceTree } [1, None] { 'location' : location, 'dsPath' : dsPath, 'dsInstanceHost' : server.getHostname(), 'dsInstancePort' : server.getPort(), 'dsInstanceDn' : server.getRootDn(), 'dsInstancePswd' : server.getRootPwd(), 'dsBaseDN' : treeSuffix, 'dsFilter' : 'objectclass=*', 'outputFile' : sampleTree } { 'location' : location, 'dsPath' : dsPath, 'sourceLdif' : '%s/../%s' % (dsPath, sampleTree), 'targetLdif' : '%s/../%s' % (dsPath, referenceTree), 'outputLdif' : '%s/../%s' % (dsPath, treeDiffs) } 'All servers synchronized (tree verify SUCCEEDED).' { 'returncode' : myRC, 'result' : failingServerList, 'expected' : 0 } [myRC, failedServers] This function verifies that a schema file is synchronized all over a group of servers. Location of target host Pathname to installation root Server that should be taken as reference. List of the servers to verify against the referenceServer. Schema file to verify. 'Verify schema file %s taking %s as reference.' % (schemaFile, referenceServerPath) { 'location' : referenceServer.getHostname(), 'remotehost' : server.getHostname(), 'srcfile' : referenceSchema, 'destfile' : '%s/reference_%s' % (server.getDir(),schemaFile) } { 'location' : location, 'dsPath' : dsPath, 'sourceLdif' : '%s/config/schema/%s' % (serverPath, schemaFile), 'targetLdif' : '%s/reference_%s' % (server.getDir(), schemaFile), 'outputLdif' : '%s/%s' % (server.getDir(), schemaDiffs) } 'All servers synchronized (schema verify SUCCEEDED).' { 'returncode' : myRC, 'result' : failingServerList , 'expected' : 0 } [myRC, failedServers] This function deletes a (sub)tree from a list of servers. List of the servers (instances of "Server" class) where the tree will be deleted. Suffix of the tree to delete. Need to start the Directory Servers before deleting. [serverList] 'Delete suffix %s on server running on host %s on port %s' % (treeSuffix, server.getHostname(), server.getPort()) { 'location' : server.getHostname(), 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME), 'dsInstanceHost' : server.getHostname(), 'dsInstancePort' : server.getPort(), 'dsInstanceDn' : server.getRootDn(), 'dsInstancePswd' : server.getRootPwd(), 'dsDn' : [treeSuffix], 'dsDeleteSubtree' : True } [serverList] This function starts a list of servers. List of the servers (instances of "Server" class) to be started. 'Start DS on host %s to run on port %s' % (server.getHostname(),server.getPort()) { 'location' : server.getHostname(), 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME) } { 'location' : server.getHostname(), 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME), 'dsInstanceHost' : server.getHostname(), 'dsInstancePort' : server.getPort(), 'dsInstanceDn' : server.getRootDn(), 'dsInstancePswd' : server.getRootPwd(), 'noOfLoops' : 5 , 'noOfMilliSeconds' : 2000 } This function stops a list of servers. List of the servers (instances of "Server" class) to be stopped. 'Stop DS on host %s running on port %s' % (server.getHostname(),server.getPort()) { 'location' : server.getHostname(), 'dsHost' : server.getHostname(), 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME), 'dsPort' : server.getPort(), 'dsBindDN' : server.getRootDn(), 'dsBindPwd' : server.getRootPwd() } This wraps the rebuild-index tool to make it easy to use from STAX Location of target host Pathname to installation root Specify a back-end supporting indexing and triggers a rebuild of all indexes in the scope of the provided baseDN Specify a list of attributes to trigger index rebuild on This should be passed on as a python array like [ 'uid', 'telephonenumber' ] Expected return code value. Default value is 0. Wildcard 'noCheck' to not check the RC { 'name' : 'rebuild index', 'location' : location, 'command' : _cmd, 'arguments' : _args, 'expectedRC': expectedRC } STAXResult This wraps the verify-index tool to make it easy to use from STAX Specify a back-end supporting indexing and triggers a verification of all indexes in the scope of the provided baseDN Specify a list of attributes to trigger index verification on This should be passed as a python array like [ 'uid','telephonenumber' ] Specify a list of attributes to trigger index verification on Expected return code value. Default value is 0. Wildcard 'noCheck' to not check the RC { 'name' : 'verify index', 'location' : location, 'command' : _cmd, 'arguments' : _args, 'expectedRC': expectedRC } STAXResult This function perform a search operation in a LDIF file Location of target host Pathname to installation root The baseDN for the search operation File containing a list of search filter strings LDIF file to use as the source data File to which the search results should be written Overwrite the output file specified The scope of the search operation Maximum length of time in seconds to allow for the search Maximum number of entries to return from the search Do not wrap long lines Display this usage information Display Directory Server version information The filter for the search operation Only return these attributes Expected return code value. Default value is 0 Wildcard 'noCheck' to not check the RC { 'name' : 'LDIF Search Script', 'command' : STAFCmd, 'arguments' : STAFCmdParams, 'location' : location, 'expectedRC' : expectedRC } STAXResult