| | |
| | | <call function="'testSuite_Preamble'"/> |
| | | <!--- Test Suite information |
| | | #@TestSuiteName Replication Binary Copy Tests |
| | | #@TestSuitePurpose Verify that the servers in a replicated topology can be initialised by the means of a binary copy (backup-restore). |
| | | #@TestSuitePurpose Verify that the servers in a replicated topology |
| | | can be initialised by the means of a binary copy |
| | | (backup-restore). |
| | | #@TestSuiteID Binary Copy Tests |
| | | #@TestSuiteGroup Binary Copy |
| | | #@TestGroup Replication |
| | |
| | | --> |
| | | |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/replication/replication_setup.xml' % (TESTS_DIR)"/> |
| | | file="'%s/testcases/replication/replication_setup.xml' |
| | | % (TESTS_DIR)"/> |
| | | <call function="'replication_setup'" /> |
| | | |
| | | <script> |
| | |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Replication Binary Copy Tests |
| | | #@TestName Replication: Binary Copy: Off-line initialisation |
| | | #@TestName Replication: Binary Copy: Off-line |
| | | initialisation |
| | | #@TestID Off-line initialisation |
| | | #@TestPurpose Initialise replicated servers using off-line backup/restore |
| | | #@TestPurpose Initialise replicated servers using off-line |
| | | backup/restore |
| | | #@TestPreamble |
| | | #@TestSteps |
| | | #@TestPostamble |
| | |
| | | <sequence> |
| | | <call function="'testCase_Preamble'"/> |
| | | <message> |
| | | 'Replication: Binary Copy: Off-line initialisation. Initialise replicated servers using off-line backup/restore' |
| | | 'Replication: Binary Copy: Off-line initialisation. \ |
| | | Initialise replicated servers using off-line backup/restore' |
| | | </message> |
| | | <!-- Stop the servers in the topology --> |
| | | <call function="'stopServers'"> |
| | |
| | | <!-- Copy backup to "consumer" servers and restore it --> |
| | | <paralleliterate var="consumer" in="consumerList"> |
| | | <sequence> |
| | | <if expr="os.path.exists('%s/config/schematokens.dat' % dsPath)" > |
| | | <if expr="os.path.exists('%s/config/schematokens.dat' |
| | | % masterPath)" > |
| | | <call function="'copyFile'"> |
| | | { 'srcfile' : '%s/config/schematokens.dat' % dsPath, |
| | | 'destfile' : '%s/%s/config/schematokens.dat' % (consumer.getDir(),OPENDSNAME), |
| | | { 'location' : masterHost, |
| | | 'srcfile' : '%s/config/schematokens.dat' \ |
| | | % masterPath, |
| | | '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), |
| | | 'srcfolder' : '%s/replication/master_backup' \ |
| | | % masterDataDir, |
| | | 'destfolder' : '%s/%s/replication/master_backup' \ |
| | | % (consumer.getDir(),relativeDataDir), |
| | | '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> |
| | |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'entryToBeAdded' : '%s/replication/tfitter.ldif' % clientDataDir |
| | | 'entryToBeAdded' : '%s/replication/tfitter.ldif' \ |
| | | % clientDataDir |
| | | } |
| | | </call> |
| | | |
| | | <!-- Verify the synchronization of the trees among the servers in the topology --> |
| | | <!-- Verify the synchronization of the trees among the servers in |
| | | the topology --> |
| | | <call function="'verifyTrees'"> |
| | | [ clientHost, clientPath, master, consumerList, synchroSuffix ] |
| | | </call> |
| | |
| | | #@TestMarker Replication Binary Copy Tests |
| | | #@TestName Replication: Binary Copy: On-line initialisation |
| | | #@TestID On-line initialisation |
| | | #@TestPurpose Initialise replicated servers using on-line backup/restore |
| | | #@TestPurpose Initialise replicated servers using on-line |
| | | backup/restore |
| | | #@TestPreamble |
| | | #@TestSteps |
| | | #@TestPostamble |
| | |
| | | <sequence> |
| | | <call function="'testCase_Preamble'"/> |
| | | <message> |
| | | 'Replication: Binary Copy: On-line initialisation. Initialise replicated servers using on-line backup/restore' |
| | | 'Replication: Binary Copy: On-line initialisation. Initialise \ |
| | | replicated servers using on-line backup/restore' |
| | | </message> |
| | | |
| | | <!-- Clean the servers in the topology |
| | |
| | | [_topologyServerList, synchroSuffix, False] |
| | | </call> --> |
| | | |
| | | <!-- Delete manually added entry so that replication server won't add it automatically later on --> |
| | | <!-- Delete manually added entry so that replication server won't |
| | | add it automatically later on --> |
| | | <call function="'ldapDeleteWithScript'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'dsDn' : ['uid=tfitter, ou=People,%s' % synchroSuffix] |
| | | 'dsDn' : ['uid=tfitter, ou=People,%s' \ |
| | | % synchroSuffix] |
| | | } |
| | | </call> |
| | | |
| | |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'taskID' : 'import task', |
| | | 'ldifFile' : '%s/replication/Example.ldif' % masterDataDir |
| | | 'ldifFile' : '%s/replication/Example.ldif' \ |
| | | % masterDataDir |
| | | } |
| | | </call> |
| | | |
| | |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'taskID' : 'backup task', |
| | | 'backupDir' : '%s/replication/master_backup_online' % masterDataDir |
| | | 'backupDir' : '%s/replication/master_backup_online' \ |
| | | % masterDataDir |
| | | } |
| | | </call> |
| | | |
| | | <!-- Copy backup to "consumer" servers and restore it --> |
| | | <paralleliterate var="consumer" in="consumerList"> |
| | | <sequence> |
| | | <if expr="os.path.exists('%s/config/schematokens.dat' % dsPath)"> |
| | | <if expr="os.path.exists |
| | | ('%s/config/schematokens.dat' % masterPath)"> |
| | | <call function="'copyFile'"> |
| | | { 'srcfile' : '%s/config/schematokens.dat' % dsPath, |
| | | 'destfile' : '%s/%s/config/schematokens.dat' % (consumer.getDir(),OPENDSNAME), |
| | | { 'location' : masterHost, |
| | | 'srcfile' : '%s/config/schematokens.dat' \ |
| | | % masterPath, |
| | | '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), |
| | | 'srcfolder' : '%s/replication/master_backup_online' \ |
| | | % masterDataDir, |
| | | 'destfolder' : '%s/%s/replication/master_backup_online' \ |
| | | % (consumer.getDir(),relativeDataDir), |
| | | 'extension' : '*' |
| | | } |
| | | </call> |
| | |
| | | '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> |
| | |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'entryToBeAdded' : '%s/replication/tfitter.ldif' % clientDataDir |
| | | 'entryToBeAdded' : '%s/replication/tfitter.ldif' \ |
| | | % clientDataDir |
| | | } |
| | | </call> |
| | | |
| | | <!-- Verify the synchronization of the trees among the servers in the topology --> |
| | | <!-- Verify the synchronization of the trees among the servers in |
| | | the topology --> |
| | | <call function="'verifyTrees'"> |
| | | [ clientHost, clientPath, master, consumerList, synchroSuffix ] |
| | | </call> |
| | |
| | | </testcase> |
| | | |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/replication/replication_cleanup.xml' % (TESTS_DIR)"/> |
| | | file="'%s/testcases/replication/replication_cleanup.xml' |
| | | % (TESTS_DIR)"/> |
| | | <call function="'replication_cleanup'" /> |
| | | <call function="'testSuite_Postamble'"/> |
| | | </sequence> |