mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

al_xipe
25.28.2007 34f13c3b2911e3c41aaccbd6422f529a80bb04a2
fix for replication resynchronization tests to account for the new index key map
1 files modified
308 ■■■■ changed files
opends/tests/functional-tests/testcases/replication/resynchronization/resynchronization.xml 308 ●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/replication/resynchronization/resynchronization.xml
@@ -26,25 +26,17 @@
 !      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['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.
@@ -54,16 +46,15 @@
          #@TestScript          replication_resynchronization.xml
          #@TestHTMLLink        http://opends.dev.java.net/
          -->
          <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>
            synchroSuffix = master.getSynchronizedSuffixList()[0].getSuffixDn()
          </script>
            synchroSuffix = master.getSynchronizedSuffixList()[0].getSuffixDn()
          </script>
          <!--- Test Case information
          #@TestMarker          Replication Re-Synchronization Tests
          #@TestName            Replication: Re-Synchronization: Off-line initialisation
@@ -73,58 +64,58 @@
          #@TestSteps
          #@TestPostamble
          #@TestResult
          -->
          -->
          <testcase name="getTestCaseName('Off-line initialisation')">
            <sequence>
            <sequence>
              <call function="'testCase_Preamble'"/>
              <message>
                 'Replication: Re-Synchronization: Off-line initialisation. Initialise replicated servers using off-line backup/restore'
                'Replication: Re-Synchronization: Off-line initialisation. Initialise replicated servers using off-line backup/restore'
              </message>
              <!-- Stop the servers in the topology -->
              <!-- Stop the servers in the topology -->
              <call function="'stopServers'">
                [_topologyServerList]
              </call>
              
              <!-- Import data into "master" server -->
              <!-- Import data into "master" server -->
              <call function="'ImportLdifWithScript'">
                { 'location'     : masterHost,
                  'dsPath'       : masterPath,
                  'dsBackEnd'    : 'userRoot',
                  'dsLdifFile'   : '%s/replication/Example.ldif' % masterDataDir }
                { 'location'   : masterHost,
                  'dsPath'     : masterPath,
                  'dsBackEnd'  : 'userRoot',
                  'dsLdifFile' : '%s/replication/Example.ldif' % masterDataDir
                }
              </call>
              <!-- Check some data was imported into "master" server -->
              <!-- 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(),
                { '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'] }
                                       'uid=rhunt, ou=People, o=example']
                }
              </call>
              
              <!-- Backup "master" server -->
              <!-- Backup "master" server -->
              <call function="'backup'">
                { 'location'  :  masterHost,
                  'dsPath'  :  masterPath,
                  'backupDir'  :  '%s/replication/master_backup' % masterDataDir }
              </call>
                  'dsPath'    :  masterPath,
                  '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 -->
              <!-- Add entry to "master" server -->
              <call function="'addEntry'">
                { 'location'       : clientHost,
                  'dsPath'         : clientPath,
@@ -132,51 +123,50 @@
                  'dsInstancePort' : master.getPort(), 
                  'dsInstanceDn'   : master.getRootDn(),
                  'dsInstancePswd' : master.getRootPwd(),
                  'entryToBeAdded' : '%s/replication/tfitter.ldif' % clientDataDir }
              </call>
                  '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'  : '*' }
                  </call>
                    { 'location'   : masterHost,
                      'remotehost' : consumer.getHostname(),
                      '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) }
                  </call>
                </sequence>
                      'dsPath'    :  '%s/%s' % (consumer.getDir(), OPENDSNAME),
                      'backupDir' :  '%s/%s/replication/master_backup' % (consumer.getDir(),relativeDataDir)
                    }
                  </call>
                </sequence>
              </paralleliterate>
              <!-- Start the "consumer" servers -->
              <!-- Start the "consumer" servers -->
              <call function="'startServers'">
                [consumerList]
              </call>
              </call>
              <!-- Verify the synchronization of the trees among the servers in the topology -->          
              <call function="'verifyTrees'">
                [ clientHost, clientPath, master, consumerList, synchroSuffix ]
              </call>
              </call>
              <call function="'testCase_Postamble'"/>
            </sequence>
          </testcase>
          </testcase>
          <!--- Test Case information
          #@TestMarker          Replication Re-Synchronization Tests
          #@TestName            Replication: Re-Synchronization: On-line initialisation
@@ -186,71 +176,72 @@
          #@TestSteps
          #@TestPostamble
          #@TestResult
          -->
          -->
          <testcase name="getTestCaseName('On-line initialisation')">
            <sequence>
            <sequence>
              <call function="'testCase_Preamble'"/>
              <message>
                 'Replication: Re-Synchronization: On-line initialisation. Initialise replicated servers using on-line backup/restore'
                'Replication: Re-Synchronization: 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> -->
              </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] }
              </call>
              <!-- Import data into "master" server -->
              <call function="'importLdifTask'">
                { 'location'  :  clientHost,
                  'dsPath'  :  clientPath,
                  'dsInstanceHost'  : masterHost,
                  'dsInstancePort'  :  master.getPort(),
                  'dsInstanceDn'  :  master.getRootDn(),
                  'dsInstancePswd'  :  master.getRootPwd(),
                  'taskID'  :  'import task',
                  'ldifFile'  :  '%s/replication/Example.ldif' % masterDataDir }
                { 'location'       : clientHost,
                  'dsPath'         : clientPath,
                  'dsInstanceHost' : master.getHostname(),
                  'dsInstancePort' : master.getPort(),
                  'dsInstanceDn'   : master.getRootDn(),
                  'dsInstancePswd' : master.getRootPwd(),
                  'dsDn'           : ['uid=tfitter, ou=People,%s' % synchroSuffix]
                }
              </call>
              <!-- Import data into "master" server -->
              <call function="'importLdifTask'">
                { 'location'       : clientHost,
                  'dsPath'         : clientPath,
                  'dsInstanceHost' : masterHost,
                  'dsInstancePort' : master.getPort(),
                  'dsInstanceDn'   : master.getRootDn(),
                  'dsInstancePswd' : master.getRootPwd(),
                  'taskID'         : 'import task',
                  'ldifFile'       : '%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(),
                { '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' }
                  'startDS'         :  'no'
                }
              </call>
                
              <!-- Backup "master" server -->  
              <call function="'backupTask'">
                { 'location'  :  clientHost,
                  'dsPath'  :  clientPath,
                  'dsInstanceHost'  : masterHost,
                  'dsInstancePort'  :  master.getPort(),
                  'dsInstanceDn'  :  master.getRootDn(),
                  'dsInstancePswd'  :  master.getRootPwd(),
                  'taskID'  :  'backup task',
                  'backupDir'  :  '%s/replication/master_backup_online' % masterDataDir }
                { 'location'       : clientHost,
                  'dsPath'         : clientPath,
                  'dsInstanceHost' : masterHost,
                  'dsInstancePort' : master.getPort(),
                  'dsInstanceDn'   : master.getRootDn(),
                  'dsInstancePswd' : master.getRootPwd(),
                  'taskID'         : 'backup task',
                  'backupDir'      : '%s/replication/master_backup_online' % masterDataDir
                }
              </call>
              <!-- Add entry to "master" server -->                       
              <call function="'addEntry'">
                { 'location'       : clientHost,
@@ -259,59 +250,58 @@
                  'dsInstancePort' : master.getPort(), 
                  'dsInstanceDn'   : master.getRootDn(),
                  'dsInstancePswd' : master.getRootPwd(),
                  'entryToBeAdded' : '%s/replication/tfitter.ldif' % clientDataDir }
              </call>
                  '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'  : '*' }
                  </call>
                    { 'location'   : masterHost,
                      'remotehost' : consumer.getHostname(),
                      'srcfolder'  : '%s/replication/master_backup_online' % masterDataDir,
                      'destfolder' : '%s/%s/replication/master_backup_online' % (consumer.getDir(),relativeDataDir),
                      'extension'  : '*'
                    }
                  </call>
                  <call function="'restoreTask'">
                    { 'location'  :  clientHost,
                      'dsPath'  :  clientPath,
                      'dsInstanceHost'  :  consumer.getHostname(),
                      'dsInstancePort'  : consumer.getPort(),
                      'dsInstanceDn'  :  consumer.getRootDn(),
                      'dsInstancePswd'  :  consumer.getRootPwd(),
                      'taskID'  :  'restore task',
                      'backupDir'  :  '%s/%s/replication/master_backup_online' % (consumer.getDir(),relativeDataDir) }
                  </call>
                </sequence>
                    { 'location'       : clientHost,
                      'dsPath'         : clientPath,
                      'dsInstanceHost' : consumer.getHostname(),
                      'dsInstancePort' : consumer.getPort(),
                      'dsInstanceDn'   : consumer.getRootDn(),
                      'dsInstancePswd' : consumer.getRootPwd(),
                      'taskID'         : 'restore task',
                      '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 -->
              <!-- Verify the synchronization of the trees among the servers in the topology -->
              <call function="'verifyTrees'">
                [ clientHost, clientPath, master, consumerList, synchroSuffix ]
              </call>
              </call>
              <call function="'testCase_Postamble'"/>
            </sequence>
          </testcase>
          </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>
      </block>
    </sequence>
  </function>
</stax>