| | |
| | | file="'%s/testcases/replication/replication_setup.xml' |
| | | % (TESTS_DIR)"/> |
| | | <call function="'replication_setup'" /> |
| | | |
| | | <script> |
| | | synchroSuffix = master.getSynchronizedSuffixList()[0].getSuffixDn() |
| | | </script> |
| | | |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Replication Binary Copy Tests |
| | |
| | | #@TestPurpose Initialise replicated servers using off-line |
| | | backup/restore |
| | | #@TestPreamble |
| | | #@TestSteps |
| | | #@TestSteps Call dsreplication pre-external-initialization |
| | | #@TestSteps Stop servers |
| | | #@TestSteps Import data on server A |
| | | #@TestSteps Back-up server A |
| | | #@TestSteps Restore back-up on other servers |
| | | #@TestSteps Start servers |
| | | #@TestSteps Call dsreplication post-external-initialization |
| | | #@TestSteps Add entry on server A |
| | | #@TestPostamble |
| | | #@TestResult |
| | | #@TestResult Success if trees synchronized |
| | | --> |
| | | <testcase name="getTestCaseName('Off-line initialisation')"> |
| | | <sequence> |
| | |
| | | 'Replication: Binary Copy: Off-line initialisation. \ |
| | | Initialise replicated servers using off-line backup/restore' |
| | | </message> |
| | | |
| | | |
| | | <!-- Pre-initialise the servers in the topology --> |
| | | <message> |
| | | '+++++ binary copy off-line: prepare servers for external \ |
| | | initialization' |
| | | </message> |
| | | <call function="'preInitializeReplication'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'localOnly' : False, |
| | | 'replicationDnList' : [synchroSuffix], |
| | | 'adminUID' : adminUID, |
| | | 'adminPswd' : adminPswd |
| | | } |
| | | </call> |
| | | |
| | | <!-- Stop the servers in the topology --> |
| | | <call function="'stopServers'"> |
| | | [_topologyServerList] |
| | | </call> |
| | | |
| | | <!-- Import data into "master" server --> |
| | | <message> |
| | | '+++++ binary copy off-line: import data on %s:%s' \ |
| | | % (masterHost, master.getPort()) |
| | | </message> |
| | | <call function="'ImportLdifWithScript'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath, |
| | |
| | | 'dsLdifFile' : '%s/replication/Example.ldif' % masterDataDir |
| | | } |
| | | </call> |
| | | |
| | | <!-- Check some data was imported into "master" server --> |
| | | <call function="'checkImport'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | | 'dsHost' : masterHost, |
| | | 'dsPort' : master.getPort(), |
| | | 'dsDn' : master.getRootDn(), |
| | | 'dsPswd' : master.getRootPwd(), |
| | | 'expectedEntries' : ['uid=scarter,ou=People,o=example', |
| | | 'uid=dmiller, ou=People, o=example', |
| | | 'uid=rhunt, ou=People, o=example'] |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!-- Backup "master" server --> |
| | | <message> |
| | | '+++++ binary copy off-line: back-up server %s:%s' \ |
| | | % (masterHost, master.getPort()) |
| | | </message> |
| | | <call function="'backup'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath, |
| | |
| | | <!-- Copy backup to "consumer" servers and restore it --> |
| | | <paralleliterate var="consumer" in="consumerList"> |
| | | <sequence> |
| | | <if expr="os.path.exists('%s/config/schematokens.dat' |
| | | % masterPath)" > |
| | | <call function="'copyFile'"> |
| | | { 'location' : masterHost, |
| | | 'srcfile' : '%s/config/schematokens.dat' \ |
| | | % masterPath, |
| | | 'destfile' : '%s/%s/config/schematokens.dat' \ |
| | | % (consumer.getDir(),OPENDSNAME), |
| | | 'remotehost' : consumer.getHostname() |
| | | } |
| | | </call> |
| | | </if> |
| | | <call function="'CopyFolderByExtension'"> |
| | | { 'location' : masterHost, |
| | | 'remotehost' : consumer.getHostname(), |
| | |
| | | 'extension' : '*' |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | '+++++ binary copy off-line: restore back-up on %s:%s' \ |
| | | % (consumer.getHostname(), consumer.getPort()) |
| | | </message> |
| | | <call function="'restore'"> |
| | | { 'location' : consumer.getHostname(), |
| | | 'dsPath' : '%s/%s' % (consumer.getDir(), OPENDSNAME), |
| | |
| | | <call function="'startServers'"> |
| | | [_topologyServerList] |
| | | </call> |
| | | |
| | | |
| | | |
| | | <!-- Check some data was imported into "master" server --> |
| | | <call function="'checkImport'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | | 'dsHost' : masterHost, |
| | | 'dsPort' : master.getPort(), |
| | | 'dsDn' : master.getRootDn(), |
| | | 'dsPswd' : master.getRootPwd(), |
| | | 'expectedEntries' : ['uid=scarter,ou=People,o=example', |
| | | 'uid=dmiller, ou=People, o=example', |
| | | 'uid=rhunt, ou=People, o=example'], |
| | | 'startDS' : 'no' |
| | | } |
| | | </call> |
| | | |
| | | <!-- Post-initialise the servers in the topology --> |
| | | <message> |
| | | '+++++ binary copy off-line: end external server initialization' |
| | | </message> |
| | | <call function="'postInitializeReplication'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'replicationDnList' : [synchroSuffix], |
| | | 'adminUID' : adminUID, |
| | | 'adminPswd' : adminPswd |
| | | } |
| | | </call> |
| | | |
| | | <!-- Add entry to "master" server --> |
| | | <message> |
| | | '+++++ binary copy off-line: add entry to %s:%s' \ |
| | | % (masterHost, master.getPort()) |
| | | </message> |
| | | <call function="'addEntry'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | |
| | | #@TestPurpose Initialise replicated servers using on-line |
| | | backup/restore |
| | | #@TestPreamble |
| | | #@TestSteps |
| | | #@TestSteps Call dsreplication pre-external-initialization |
| | | #@TestSteps Import data on server A |
| | | #@TestSteps Back-up server A |
| | | #@TestSteps Restore back-up on other servers |
| | | #@TestSteps Call dsreplication post-external-initialization |
| | | #@TestSteps Add entry on server A |
| | | #@TestPostamble |
| | | #@TestResult |
| | | #@TestResult Success if trees synchronized |
| | | --> |
| | | <testcase name="getTestCaseName('On-line initialisation')"> |
| | | <sequence> |
| | |
| | | 'Replication: Binary Copy: On-line initialisation. Initialise \ |
| | | replicated servers using on-line backup/restore' |
| | | </message> |
| | | |
| | | <!-- Clean the servers in the topology |
| | | <call function="'deleteTrees'"> |
| | | [_topologyServerList, synchroSuffix, False] |
| | | </call> --> |
| | | |
| | | <!-- Delete manually added entry so that replication server won't |
| | | add it automatically later on --> |
| | | <call function="'ldapDeleteWithScript'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | | 'dsInstanceHost' : master.getHostname(), |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'dsDn' : ['uid=tfitter, ou=People,%s' \ |
| | | % synchroSuffix] |
| | | |
| | | <!-- Pre-initialise the servers in the topology --> |
| | | <message> |
| | | '+++++ binary copy on-line: prepare servers for external \ |
| | | initialization' |
| | | </message> |
| | | <call function="'preInitializeReplication'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'localOnly' : False, |
| | | 'replicationDnList' : [synchroSuffix], |
| | | 'adminUID' : adminUID, |
| | | 'adminPswd' : adminPswd |
| | | } |
| | | </call> |
| | | |
| | | </call> |
| | | |
| | | <!-- Import data into "master" server --> |
| | | <message> |
| | | '+++++ binary copy on-line: import data on %s:%s' \ |
| | | % (masterHost, master.getPort()) |
| | | </message> |
| | | <call function="'importLdifTask'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | |
| | | </call> |
| | | |
| | | <!-- Backup "master" server --> |
| | | <message> |
| | | '+++++ binary copy on-line: back-up server %s:%s' \ |
| | | % (masterHost, master.getPort()) |
| | | </message> |
| | | <call function="'backupTask'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | |
| | | <!-- Copy backup to "consumer" servers and restore it --> |
| | | <paralleliterate var="consumer" in="consumerList"> |
| | | <sequence> |
| | | <if expr="os.path.exists |
| | | ('%s/config/schematokens.dat' % masterPath)"> |
| | | <call function="'copyFile'"> |
| | | { 'location' : masterHost, |
| | | 'srcfile' : '%s/config/schematokens.dat' \ |
| | | % masterPath, |
| | | 'destfile' : '%s/%s/config/schematokens.dat' \ |
| | | % (consumer.getDir(),OPENDSNAME), |
| | | 'remotehost' : consumer.getHostname() |
| | | } |
| | | </call> |
| | | </if> |
| | | <call function="'CopyFolderByExtension'"> |
| | | { 'location' : masterHost, |
| | | 'remotehost' : consumer.getHostname(), |
| | |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | '+++++ binary copy on-line: restore back-up on %s:%s' \ |
| | | % (consumer.getHostname(), consumer.getPort()) |
| | | </message> |
| | | <call function="'restoreTask'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | |
| | | </sequence> |
| | | </paralleliterate> |
| | | |
| | | <!-- Post-initialise the servers in the topology --> |
| | | <message> |
| | | '+++++ binary copy on-line: end external server initialization' |
| | | </message> |
| | | <call function="'postInitializeReplication'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'replicationDnList' : [synchroSuffix], |
| | | 'adminUID' : adminUID, |
| | | 'adminPswd' : adminPswd |
| | | } |
| | | </call> |
| | | |
| | | <!-- Add entry to "master" server --> |
| | | <message> |
| | | '+++++ binary copy on-line: add entry to %s:%s' \ |
| | | % (masterHost, master.getPort()) |
| | | </message> |
| | | <call function="'addEntry'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |