| | |
| | | ! |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | ! Portions Copyright 2006-2007-2008 Sun Microsystems, Inc. |
| | | ! --> |
| | | <stax> |
| | | <function name="createTopology"> |
| | |
| | | This function creates the topology required by the Test Group/Suite. |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="topologyDescFile" type="optional" default="None"> |
| | | <function-arg-def name="topologyDescFile" |
| | | type="optional" |
| | | default="None"> |
| | | <function-arg-description> |
| | | Topology Description file |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filePath"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="initialiseInstance" type="optional" default="False"> |
| | | <function-arg-def name="initialiseInstance" |
| | | type="optional" |
| | | default="False"> |
| | | <function-arg-description> |
| | | Specifies whether the instance should be initialised with some default data. |
| | | Specifies whether the instance should be initialised with |
| | | some default data. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="boolean"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="sharedDataFolder" type="optional" default="''"> |
| | | <function-arg-def name="sharedDataFolder" |
| | | type="optional" |
| | | default="''"> |
| | | <function-arg-description> |
| | | Specifies a relative folder that holds the shared data for the tests |
| | | </function-arg-description> |
| | |
| | | </call> |
| | | |
| | | <if expr="topologyDescFile == None"> |
| | | <!-- SINGLE instance deployment: read parameters from config.py (done by default) --> |
| | | <!-- SINGLE instance deployment: read parameters from config.py (done |
| | | by default) --> |
| | | <sequence> |
| | | <message> |
| | | 'SINGLE instance deployment: read parameters from config.py' |
| | |
| | | </if> |
| | | </sequence> |
| | | <else> |
| | | <!-- MULTIPLE instance deployment: read parameters from topologyDescFile --> |
| | | <!-- MULTIPLE instance deployment: read parameters from |
| | | topologyDescFile --> |
| | | <sequence> |
| | | <message> |
| | | 'MULTIPLE instance deployment: read parameters from %s' % topologyDescFile |
| | | 'MULTIPLE instance deployment: read parameters from %s' \ |
| | | % topologyDescFile |
| | | </message> |
| | | |
| | | <!-- Parse the topology description file and set _topologyServerList --> |
| | | <!-- Parse the topology description file and set |
| | | _topologyServerList --> |
| | | <call function="'readTopology'"> |
| | | { 'file' : topologyDescFile } |
| | | </call> |
| | | |
| | | <message> |
| | | 'Number of server instances required by the deployment: %s' % len(_topologyServerList) |
| | | 'Number of server instances required by the deployment: %s' \ |
| | | % len(_topologyServerList) |
| | | </message> |
| | | |
| | | <iterate var="server" in="_topologyServerList"> |
| | |
| | | } |
| | | </call> |
| | | |
| | | <!-- Configure replication if required so by the server |
| | | ! (i.e. server is a changelog server and/or has synchronized suffixes) |
| | | --> |
| | | <!-- <if expr="server.requiresSynchronization()"> |
| | | <sequence> |
| | | <message> |
| | | 'Instance requires REPLICATION configuration.' |
| | | </message> |
| | | <call function="'configureReplication'"> |
| | | [server] |
| | | </call> |
| | | </sequence> |
| | | </if> |
| | | --> |
| | | </sequence> |
| | | </iterate> |
| | | </sequence> |
| | |
| | | files to create an instance: data zip file and OpenDS zip file. |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="groupDataDir" type="optional" default="''"> |
| | | <function-arg-def name="groupDataDir" |
| | | type="optional" |
| | | default="''"> |
| | | <function-arg-description> |
| | | Specifies a relative folder that holds the shared data for the test group |
| | | Specifies a relative folder that holds the shared data for the test |
| | | group |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | |
| | | <call function="'GetEntry'"> |
| | | { 'location' : STAXServiceMachine, |
| | | 'entry' : localTestsGroupDir, |
| | | 'attribute' : 'TYPE' } |
| | | 'attribute' : 'TYPE' |
| | | } |
| | | </call> |
| | | |
| | | <!-- If the test data is already created then don't redo it --> |
| | |
| | | </function-prolog> |
| | | |
| | | <function-map-args> |
| | | <function-arg-def name="dsHost" type="optional" default="DIRECTORY_INSTANCE_HOST"> |
| | | <function-arg-def name="dsHost" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_HOST"> |
| | | <function-arg-description> |
| | | Hostname where the instance is to be created |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | Hostname where the instance is to be created |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsDir" type="optional" default="DIRECTORY_INSTANCE_DIR"> |
| | | <function-arg-def name="dsDir" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_DIR"> |
| | | <function-arg-description> |
| | | Directory where OpenDS will be installed |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsPort" type="optional" default="DIRECTORY_INSTANCE_PORT"> |
| | | <function-arg-description> |
| | | Directory Server port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number"/> |
| | | Directory where OpenDS will be installed |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsSslPort" type="optional" default="DIRECTORY_INSTANCE_SSL_PORT"> |
| | | <function-arg-def name="dsPort" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_PORT"> |
| | | <function-arg-description> |
| | | Directory Server SSL port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number"/> |
| | | Directory Server port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsJmxPort" type="optional" default="None"> |
| | | <function-arg-def name="dsSslPort" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_SSL_PORT"> |
| | | <function-arg-description> |
| | | Directory Server JMX port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number"/> |
| | | Directory Server SSL port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsJmxPort" |
| | | type="optional" |
| | | default="None"> |
| | | <function-arg-description> |
| | | Directory Server JMX port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsBindDN" type="optional" default="DIRECTORY_INSTANCE_DN"> |
| | | <function-arg-def name="dsBindDN" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_DN"> |
| | | <function-arg-description> |
| | | Directory Manager DN |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN"/> |
| | | Directory Manager DN |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsBindPwd" type="optional" default="DIRECTORY_INSTANCE_PSWD"> |
| | | <function-arg-def name="dsBindPwd" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_PSWD"> |
| | | <function-arg-description> |
| | | Directory Server SSL port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | Directory Server SSL port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsBaseDN" type="optional" default="DIRECTORY_INSTANCE_SFX"> |
| | | <function-arg-def name="dsBaseDN" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_SFX"> |
| | | <function-arg-description> |
| | | Directory Server base suffix dn |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN"/> |
| | | Directory Server base suffix dn |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | |
| | |
| | | if not os.path.exists('%s/coverage' % TMPDIR): |
| | | os.mkdir('%s/coverage' % TMPDIR) |
| | | mylog+=" ::mkdir %s/coverage on\n" % TMPDIR |
| | | if not os.path.exists('%s/coverage/%s' % (TMPDIR,CurrentTestPath['group'])): |
| | | if not os.path.exists('%s/coverage/%s' |
| | | % (TMPDIR,CurrentTestPath['group'])): |
| | | os.mkdir('%s/coverage/%s' % (TMPDIR,CurrentTestPath['group'])) |
| | | mylog+=" ::mkdir %s/coverage/%s on\n" % (TMPDIR,CurrentTestPath['group']) |
| | | mylog+=" ::writing to %s/classes/emma.properties" % dsPath |
| | | mylog+=" ::mkdir %s/coverage/%s on\n" \ |
| | | % (TMPDIR,CurrentTestPath['group']) |
| | | mylog+=" ::writing to %s/classes/emma.properties" \ |
| | | % dsPath |
| | | coveragefh = open( '%s/classes/emma.properties' % dsPath, 'w' ) |
| | | coveragefh.write( 'coverage.out.file=%s/coverage/%s/coverage.ec\n' % (TMPDIR,CurrentTestPath['group']) ) |
| | | coveragefh.write( 'coverage.out.file=%s/coverage/%s/coverage.ec\n' \ |
| | | % (TMPDIR,CurrentTestPath['group']) ) |
| | | coveragefh.close() |
| | | |
| | | </script> |
| | |
| | | <function-list-args> |
| | | <function-arg-def name="syncserverMap" type="required"> |
| | | <function-arg-description> |
| | | Map containing a Server class instance representing the server to configure. |
| | | Map containing a Server class instance representing the server to |
| | | configure. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="map"/> |
| | | </function-arg-def> |
| | |
| | | </script> |
| | | |
| | | <message> |
| | | 'Configure replication on server on host %s at directory %s' % (syncserver.getHostname(),syncserver.getDir()) |
| | | 'Configure replication on server on host %s at directory %s' \ |
| | | % (syncserver.getHostname(),syncserver.getDir()) |
| | | </message> |
| | | |
| | | <!-- Copy the replication_conf ldif to remote host --> |
| | |
| | | <sequence> |
| | | <!--- Configure replication using dsconfig --> |
| | | <message> |
| | | 'Configure replication on server on host %s at directory %s' % (syncserver.getHostname(),syncserver.getDir()) |
| | | 'Configure replication on server on host %s at directory %s' \ |
| | | % (syncserver.getHostname(),syncserver.getDir()) |
| | | </message> |
| | | |
| | | <script> |
| | |
| | | 'dsInstancePort' : syncserver.getPort(), |
| | | 'dsInstanceDn' : syncserver.getRootDn(), |
| | | 'dsInstancePswd' : syncserver.getRootPwd(), |
| | | 'entryToBeAdded' : '%s/%s/replication/workaround-2201.ldif' % (syncserver.getDir(), relativeDataDir) } |
| | | 'entryToBeAdded' : '%s/%s/replication/workaround-2201.ldif' \ |
| | | % (syncserver.getDir(), relativeDataDir) |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | |
| | | <if expr="replicationServer"> |
| | | <sequence> |
| | | <message> |
| | | 'Create replication server listening on port: %s' % replicationServer.getPort() |
| | | 'Create replication server listening on port: %s' \ |
| | | % replicationServer.getPort() |
| | | </message> |
| | | <call function="'createReplicationServer'"> |
| | | { 'location' : syncserver.getHostname(), |
| | |
| | | <sequence> |
| | | <!-- Local variables --> |
| | | <script> |
| | | mylocation=location |
| | | STAFCmdParams='' |
| | | STAFCmd='' |
| | | |
| | |
| | | |
| | | |
| | | |
| | | <!-- Initialize replicated suffix with the contents of a source server using dsreplication --> |
| | | <!-- Initialize replicated suffix with the contents of a source server using |
| | | dsreplication --> |
| | | <function name="initializeReplication"> |
| | | <function-prolog> |
| | | This function initializes replicated suffixes with the contents |
| | |
| | | <sequence> |
| | | <!-- Local variables --> |
| | | <script> |
| | | mylocation=location |
| | | STAFCmdParams='' |
| | | STAFCmd='' |
| | | |
| | |
| | | <!-- Disable replication for given baseDN on server using dsreplication --> |
| | | <function name="disableReplication"> |
| | | <function-prolog> |
| | | This function disables replication for a given baseDN on a server using dsreplication. |
| | | This function disables replication for a given baseDN on a server using |
| | | dsreplication. |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="location" |
| | |
| | | <sequence> |
| | | <!-- Local variables --> |
| | | <script> |
| | | mylocation=location |
| | | STAFCmdParams='' |
| | | STAFCmd='' |
| | | |
| | |
| | | <function name="readTopology"> |
| | | <function-prolog> |
| | | This function reads the topology from a given file. |
| | | It parses the topology description file and sets _topologyServerList, a list of the servers |
| | | that form the topology. |
| | | It parses the topology description file and sets _topologyServerList, a |
| | | list of the servers that form the topology. |
| | | </function-prolog> |
| | | |
| | | <function-map-args> |
| | |
| | | elif line.find('ChangelogServer') != -1: |
| | | changelogList.append( line[line.find('ChangelogServer') + 16:].strip() ) |
| | | elif (line.isspace()) or (len(line) == 0): |
| | | server = Server(hostname, dir, port, sslport, jmxport, rootDn, rootPwd, baseDn) |
| | | server = Server(hostname, dir, port, sslport, jmxport, rootDn, |
| | | rootPwd, baseDn) |
| | | |
| | | if changelogport != None: |
| | | changelogServer = ChangelogServer(changelogport, serverId) |
| | |
| | | serverId += 1 |
| | | |
| | | if hostname != None: |
| | | server = Server(hostname, dir, port, sslport, jmxport, rootDn, rootPwd, baseDn) |
| | | server = Server(hostname, dir, port, sslport, jmxport, rootDn, |
| | | rootPwd, baseDn) |
| | | |
| | | if changelogport != None: |
| | | changelogServer = ChangelogServer(changelogport, serverId) |
| | |
| | | </function-prolog> |
| | | |
| | | <function-map-args> |
| | | <function-arg-def name="dsHost" type="optional" default="DIRECTORY_INSTANCE_HOST"> |
| | | <function-arg-def name="dsHost" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_HOST"> |
| | | <function-arg-description> |
| | | Hostname where the instance is to be created |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsDir" type="optional" default="DIRECTORY_INSTANCE_DIR"> |
| | | <function-arg-def name="dsDir" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_DIR"> |
| | | <function-arg-description> |
| | | Directory where OpenDS will be installed |
| | | </function-arg-description> |
| | |
| | | This function removes the topology created for the Test Group/Suite. |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="multipleInstanceTopology" type="optional" default="False"> |
| | | <function-arg-def name="multipleInstanceTopology" |
| | | type="optional" |
| | | default="False"> |
| | | <function-arg-description> |
| | | Tells whether it is a single (i.e. parameters read from config.py) or |
| | | a multiple-instance topology (i.e. parameters read from topology desc file). |
| | | a multiple-instance topology (i.e. parameters read from topology desc |
| | | file). |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="boolean"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <if expr="multipleInstanceTopology == False"> |
| | | <!-- SINGLE instance deployment: parameters read from config.py (done by default) --> |
| | | <!-- SINGLE instance deployment: parameters read from config.py (done by |
| | | default) --> |
| | | <call function="'removeInstance'" /> |
| | | <else> |
| | | <!-- MULTIPLE instance deployment: parameters read from topologyDescFile --> |
| | | <!-- MULTIPLE instance deployment: parameters read from |
| | | topologyDescFile --> |
| | | <iterate var="server" in="_topologyServerList"> |
| | | <call function="'removeInstance'"> |
| | | { 'dsHost' : server.getHostname(), |
| | |
| | | </if> |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | |
| | | <!-- Prepare instance(s) for external re-initialisation of replicated suffix |
| | | using dsreplication --> |
| | | <function name="preInitializeReplication"> |
| | | <function-prolog> |
| | | This function prepares one or all instances in a topology for the external |
| | | re-initialisation of replicated suffixes using dsreplication. |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="location" |
| | | type="optional" |
| | | default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsPath" |
| | | type="optional" |
| | | default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)"> |
| | | <function-arg-description> |
| | | Pathname to installation root |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstanceHost" |
| | | type="optional" |
| | | default="None"> |
| | | <function-arg-description> |
| | | Directory server hostname or IP address |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstancePort" |
| | | type="optional" |
| | | default="None"> |
| | | <function-arg-description> |
| | | Directory server port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="localOnly" |
| | | type="optional" |
| | | default="None"> |
| | | <function-arg-description> |
| | | Only the contents of the specified server will be initialised. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="boolean" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="replicationDnList" type="required"> |
| | | <function-arg-description> |
| | | DN of the replicated suffix |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN list" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="adminUID" |
| | | type="optional" |
| | | default="AdminUID"> |
| | | <function-arg-description> |
| | | Global Administrator UID |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="UID" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="adminPswd" |
| | | type="optional" |
| | | default="AdminPswd"> |
| | | <function-arg-description> |
| | | Global Administrator password |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | Expected return code value. Default value is 0 |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <message> |
| | | 'Preparing instance %s:%s for external initialization' \ |
| | | % (dsInstanceHost,dsInstancePort) |
| | | </message> |
| | | |
| | | <!-- Local variables --> |
| | | <script> |
| | | STAFCmdParams='' |
| | | STAFCmd='' |
| | | |
| | | if dsPath: |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt) |
| | | |
| | | STAFCmdParamsList=[] |
| | | |
| | | STAFCmdParamsList.append('pre-external-initialization') |
| | | STAFCmdParamsList.append('-n') |
| | | STAFCmdParamsList.append('-Q') |
| | | |
| | | if dsInstanceHost: |
| | | STAFCmdParamsList.append('-h %s' % dsInstanceHost) |
| | | |
| | | if dsInstancePort: |
| | | STAFCmdParamsList.append('-p %s' % dsInstancePort) |
| | | |
| | | if localOnly: |
| | | STAFCmdParamsList.append('-l') |
| | | |
| | | if replicationDnList: |
| | | for dn in replicationDnList: |
| | | STAFCmdParamsList.append('-b "%s"' % dn) |
| | | |
| | | if adminUID: |
| | | STAFCmdParamsList.append('-I "%s"' % adminUID) |
| | | |
| | | if adminPswd: |
| | | STAFCmdParamsList.append('-w "%s"' % adminPswd) |
| | | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Pre-Initialize Replication', |
| | | 'location' : location, |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | | </script> |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : STAXCode, |
| | | 'result' : STAXReason, |
| | | 'expected' : expectedRC |
| | | } |
| | | </call> |
| | | <return> |
| | | STAXReason |
| | | </return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- End process of instance(s) external re-initialisation of replicated |
| | | suffix using dsreplication --> |
| | | <function name="postInitializeReplication"> |
| | | <function-prolog> |
| | | This function ends the process of the external re-initialisation of |
| | | replicated suffixes in one or all instances in a topology using |
| | | dsreplication. |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="location" |
| | | type="optional" |
| | | default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsPath" |
| | | type="optional" |
| | | default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)"> |
| | | <function-arg-description> |
| | | Pathname to installation root |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstanceHost" |
| | | type="optional" |
| | | default="None"> |
| | | <function-arg-description> |
| | | Directory server hostname or IP address |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstancePort" |
| | | type="optional" |
| | | default="None"> |
| | | <function-arg-description> |
| | | Directory server port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="replicationDnList" type="required"> |
| | | <function-arg-description> |
| | | DN of the replicated suffix |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN list" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="adminUID" |
| | | type="optional" |
| | | default="AdminUID"> |
| | | <function-arg-description> |
| | | Global Administrator UID |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="UID" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="adminPswd" |
| | | type="optional" |
| | | default="AdminPswd"> |
| | | <function-arg-description> |
| | | Global Administrator password |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | Expected return code value. Default value is 0 |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <message> |
| | | 'Post-processing external initialization of instance %s:%s' \ |
| | | % (dsInstanceHost,dsInstancePort) |
| | | </message> |
| | | |
| | | <!-- Local variables --> |
| | | <script> |
| | | STAFCmdParams='' |
| | | STAFCmd='' |
| | | |
| | | if dsPath: |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt) |
| | | |
| | | STAFCmdParamsList=[] |
| | | |
| | | STAFCmdParamsList.append('post-external-initialization') |
| | | STAFCmdParamsList.append('-n') |
| | | STAFCmdParamsList.append('-Q') |
| | | |
| | | if dsInstanceHost: |
| | | STAFCmdParamsList.append('-h %s' % dsInstanceHost) |
| | | |
| | | if dsInstancePort: |
| | | STAFCmdParamsList.append('-p %s' % dsInstancePort) |
| | | |
| | | if replicationDnList: |
| | | for dn in replicationDnList: |
| | | STAFCmdParamsList.append('-b "%s"' % dn) |
| | | |
| | | if adminUID: |
| | | STAFCmdParamsList.append('-I "%s"' % adminUID) |
| | | |
| | | if adminPswd: |
| | | STAFCmdParamsList.append('-w "%s"' % adminPswd) |
| | | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Post-Initialize Replication', |
| | | 'location' : location, |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | | </script> |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : STAXCode, |
| | | 'result' : STAXReason, |
| | | 'expected' : expectedRC |
| | | } |
| | | </call> |
| | | <return> |
| | | STAXReason |
| | | </return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | |
| | | <!-- Reset replicated suffix with the backup of a source server using |
| | | dsreplication --> |
| | | <function name="resetReplicationData"> |
| | | <function-prolog> |
| | | This function resets the data in a replicated suffix with the backup |
| | | of a source server and re-initialises the topology using dsreplication. |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="location" |
| | | type="optional" |
| | | default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsPath" |
| | | type="optional" |
| | | default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)"> |
| | | <function-arg-description> |
| | | Pathname to installation root |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="sourceInstanceHost" |
| | | type="optional" |
| | | default="None"> |
| | | <function-arg-description> |
| | | Directory server hostname or IP address |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="sourceInstancePort" |
| | | type="optional" |
| | | default="None"> |
| | | <function-arg-description> |
| | | Directory server port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="sourceInstanceDn" type="required"> |
| | | <function-arg-description> |
| | | Bind DN |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="sourceInstancePswd" type="required"> |
| | | <function-arg-description> |
| | | Bind password |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="backupDir" type="required"> |
| | | <function-arg-description> |
| | | The name of the backup directory |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="pathname"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="suffixDn" type="required"> |
| | | <function-arg-description> |
| | | DN of the replicated suffix |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="adminUID" |
| | | type="optional" |
| | | default="AdminUID"> |
| | | <function-arg-description> |
| | | Global Administrator UID |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="UID" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="adminPswd" |
| | | type="optional" |
| | | default="AdminPswd"> |
| | | <function-arg-description> |
| | | Global Administrator password |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="expectedRC" |
| | | type="optional" |
| | | default="0"> |
| | | <function-arg-description> |
| | | Expected return code value. Default value is 0 |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <message> |
| | | 'Resetting %s data in replication topology using backup %s on instance \ |
| | | %s:%s' % (suffixDn,backupDir,sourceInstanceHost,sourceInstancePort) |
| | | </message> |
| | | |
| | | |
| | | <!-- Pre-initialise the servers in the topology --> |
| | | <call function="'preInitializeReplication'"> |
| | | { 'location' : location, |
| | | 'dsPath' : dsPath, |
| | | 'dsInstanceHost' : sourceInstanceHost, |
| | | 'dsInstancePort' : sourceInstancePort, |
| | | 'localOnly' : True, |
| | | 'replicationDnList' : [suffixDn], |
| | | 'adminUID' : adminUID, |
| | | 'adminPswd' : adminPswd |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | import random |
| | | import java.util.Date |
| | | random.seed(java.util.Date().getTime()) |
| | | resetCounter = '%s#%d' \ |
| | | % (strftime('%Y-%m-%d %H:%M:%S',localtime()),random.randint(0,999)) |
| | | </script> |
| | | <!-- Restore the data in the server --> |
| | | <call function="'restoreTask'"> |
| | | { 'location' : location, |
| | | 'dsPath' : dsPath, |
| | | 'dsInstanceHost' : sourceInstanceHost, |
| | | 'dsInstancePort' : sourceInstancePort, |
| | | 'dsInstanceDn' : sourceInstanceDn, |
| | | 'dsInstancePswd' : sourceInstancePswd, |
| | | 'taskID' : 'restore task - %s' % resetCounter, |
| | | 'backupDir' : backupDir |
| | | } |
| | | </call> |
| | | |
| | | <!-- Post-initialise the servers in the topology --> |
| | | <call function="'postInitializeReplication'"> |
| | | { 'location' : location, |
| | | 'dsPath' : dsPath, |
| | | 'dsInstanceHost' : sourceInstanceHost, |
| | | 'dsInstancePort' : sourceInstancePort, |
| | | 'replicationDnList' : [suffixDn], |
| | | 'adminUID' : adminUID, |
| | | 'adminPswd' : adminPswd |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!-- Initialise the servers in the topology --> |
| | | <call function="'initializeReplication'"> |
| | | { 'location' : location, |
| | | 'dsPath' : dsPath, |
| | | 'sourceInstanceHost' : sourceInstanceHost, |
| | | 'sourceInstancePort' : sourceInstancePort, |
| | | 'replicationDnList' : [suffixDn], |
| | | 'adminUID' : adminUID, |
| | | 'adminPswd' : adminPswd |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | | </script> |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : STAXCode, |
| | | 'result' : STAXReason, |
| | | 'expected' : expectedRC |
| | | } |
| | | </call> |
| | | <return> |
| | | STAXReason |
| | | </return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | </stax> |