| | |
| | | ! Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | ! --> |
| | | <stax> |
| | | |
| | | <defaultcall function="replication_resynchronization"/> |
| | | |
| | | <function name="replication_resynchronization"> |
| | | |
| | | <sequence> |
| | | |
| | | <block name="'resynchronization'"> |
| | | |
| | | <sequence> |
| | | |
| | | <script> |
| | | if not CurrentTestPath.has_key('group'): |
| | | CurrentTestPath['group']='replication' |
| | | CurrentTestPath['suite']=STAXCurrentBlock |
| | | </script> |
| | | |
| | | <call function="'testSuite_Preamble'"/> |
| | | |
| | | <!--- Test Suite information |
| | | #@TestSuiteName Replication Re-Synchronization Tests |
| | | #@TestSuitePurpose Verify that the servers in a replicated topology can be initialised with an old backup and still re-synchronize. |
| | |
| | | #@TestHTMLLink http://opends.dev.java.net/ |
| | | --> |
| | | |
| | | |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/replication/replication_setup.xml' % (TESTS_DIR)"/> |
| | | <call function="'replication_setup'" /> |
| | |
| | | [_topologyServerList] |
| | | </call> |
| | | |
| | | |
| | | <!-- Import data into "master" server --> |
| | | <call function="'ImportLdifWithScript'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath, |
| | | 'dsBackEnd' : 'userRoot', |
| | | 'dsLdifFile' : '%s/replication/Example.ldif' % masterDataDir } |
| | | 'dsLdifFile' : '%s/replication/Example.ldif' % masterDataDir |
| | | } |
| | | </call> |
| | | |
| | | <!-- Check some data was imported into "master" server --> |
| | |
| | | 'dsPswd' : master.getRootPwd(), |
| | | 'expectedEntries' : ['uid=scarter,ou=People,o=example', |
| | | 'uid=dmiller, ou=People, o=example', |
| | | 'uid=rhunt, ou=People, o=example'] } |
| | | 'uid=rhunt, ou=People, o=example'] |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!-- Backup "master" server --> |
| | | <call function="'backup'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath, |
| | | 'backupDir' : '%s/replication/master_backup' % masterDataDir } |
| | | 'backupDir' : '%s/replication/master_backup' % masterDataDir |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!-- Start the "master" server --> |
| | | <call function="'StartDsWithScript'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath } |
| | | 'dsPath' : masterPath |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!-- Add entry to "master" server --> |
| | | <call function="'addEntry'"> |
| | | { 'location' : clientHost, |
| | |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'entryToBeAdded' : '%s/replication/tfitter.ldif' % clientDataDir } |
| | | 'entryToBeAdded' : '%s/replication/tfitter.ldif' % clientDataDir |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!-- Copy backup to "consumer" servers and restore it --> |
| | | <paralleliterate var="consumer" in="consumerList"> |
| | | <sequence> |
| | | <call function="'copyFile'"> |
| | | { 'srcfile' : '%s/config/schematokens.dat' % dsPath, |
| | | 'destfile' : '%s/%s/config/schematokens.dat' % (consumer.getDir(),OPENDSNAME), |
| | | 'remotehost' : consumer.getHostname() |
| | | } |
| | | </call> |
| | | <call function="'CopyFolderByExtension'"> |
| | | { 'location' : masterHost, |
| | | 'remotehost' : consumer.getHostname(), |
| | | 'srcfolder' : '%s/replication/master_backup' % masterDataDir, |
| | | 'destfolder' : '%s/%s/replication/master_backup' % (consumer.getDir(),relativeDataDir), |
| | | 'extension' : '*' } |
| | | 'extension' : '*' |
| | | } |
| | | </call> |
| | | |
| | | <call function="'restore'"> |
| | | { 'location' : consumer.getHostname(), |
| | | 'dsPath' : '%s/%s' % (consumer.getDir(), OPENDSNAME), |
| | | 'backupDir' : '%s/%s/replication/master_backup' % (consumer.getDir(),relativeDataDir) } |
| | | 'backupDir' : '%s/%s/replication/master_backup' % (consumer.getDir(),relativeDataDir) |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </paralleliterate> |
| | | |
| | | |
| | | |
| | | <!-- Start the "consumer" servers --> |
| | | <call function="'startServers'"> |
| | | [consumerList] |
| | | </call> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- Verify the synchronization of the trees among the servers in the topology --> |
| | | <call function="'verifyTrees'"> |
| | | [ clientHost, clientPath, master, consumerList, synchroSuffix ] |
| | | </call> |
| | | |
| | | <call function="'testCase_Postamble'"/> |
| | | </sequence> |
| | | </testcase> |
| | | |
| | | |
| | | |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Replication Re-Synchronization Tests |
| | | #@TestName Replication: Re-Synchronization: On-line initialisation |
| | |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'dsDn' : ['uid=tfitter, ou=People,%s' % synchroSuffix] } |
| | | 'dsDn' : ['uid=tfitter, ou=People,%s' % synchroSuffix] |
| | | } |
| | | </call> |
| | | |
| | | <!-- Import data into "master" server --> |
| | |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'taskID' : 'import task', |
| | | 'ldifFile' : '%s/replication/Example.ldif' % masterDataDir } |
| | | 'ldifFile' : '%s/replication/Example.ldif' % masterDataDir |
| | | } |
| | | </call> |
| | | |
| | | <!-- Check some data was imported into "master" server --> |
| | |
| | | 'expectedEntries' : ['uid=scarter,ou=People,o=example', |
| | | 'uid=dmiller, ou=People, o=example', |
| | | 'uid=rhunt, ou=People, o=example'], |
| | | 'startDS' : 'no' } |
| | | 'startDS' : 'no' |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!-- Backup "master" server --> |
| | | <call function="'backupTask'"> |
| | | { 'location' : clientHost, |
| | |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'taskID' : 'backup task', |
| | | 'backupDir' : '%s/replication/master_backup_online' % masterDataDir } |
| | | 'backupDir' : '%s/replication/master_backup_online' % masterDataDir |
| | | } |
| | | </call> |
| | | |
| | | |
| | | |
| | | <!-- Add entry to "master" server --> |
| | | <call function="'addEntry'"> |
| | | { 'location' : clientHost, |
| | |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'entryToBeAdded' : '%s/replication/tfitter.ldif' % clientDataDir } |
| | | 'entryToBeAdded' : '%s/replication/tfitter.ldif' % clientDataDir |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!-- Copy backup to "consumer" servers and restore it --> |
| | | <paralleliterate var="consumer" in="consumerList"> |
| | | <sequence> |
| | | <call function="'copyFile'"> |
| | | { 'srcfile' : '%s/config/schematokens.dat' % dsPath, |
| | | 'destfile' : '%s/%s/config/schematokens.dat' % (consumer.getDir(),OPENDSNAME), |
| | | 'remotehost' : consumer.getHostname() |
| | | } |
| | | </call> |
| | | <call function="'CopyFolderByExtension'"> |
| | | { 'location' : masterHost, |
| | | 'remotehost' : consumer.getHostname(), |
| | | 'srcfolder' : '%s/replication/master_backup_online' % masterDataDir, |
| | | 'destfolder' : '%s/%s/replication/master_backup_online' % (consumer.getDir(),relativeDataDir), |
| | | 'extension' : '*' } |
| | | 'extension' : '*' |
| | | } |
| | | </call> |
| | | |
| | | <call function="'restoreTask'"> |
| | |
| | | 'dsInstanceDn' : consumer.getRootDn(), |
| | | 'dsInstancePswd' : consumer.getRootPwd(), |
| | | 'taskID' : 'restore task', |
| | | 'backupDir' : '%s/%s/replication/master_backup_online' % (consumer.getDir(),relativeDataDir) } |
| | | 'backupDir' : '%s/%s/replication/master_backup_online' % (consumer.getDir(),relativeDataDir) |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </paralleliterate> |
| | | |
| | | |
| | | |
| | | <!-- Verify the synchronization of the trees among the servers in the topology --> |
| | | <call function="'verifyTrees'"> |
| | | [ clientHost, clientPath, master, consumerList, synchroSuffix ] |
| | |
| | | </sequence> |
| | | </testcase> |
| | | |
| | | |
| | | |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/replication/replication_cleanup.xml' % (TESTS_DIR)"/> |
| | | <call function="'replication_cleanup'" /> |
| | | |
| | | <call function="'testSuite_Postamble'"/> |
| | | |
| | | </sequence> |
| | | |
| | | </block> |
| | | |
| | | </sequence> |
| | | |
| | | </function> |
| | | |
| | | </stax> |