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

al_xipe
25.53.2007 f59aa69ed1f648cdbb94bda62778d787c38e9cc4
fix for replication binary copy tests
2 files modified
94 ■■■■■ changed files
opends/tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml 82 ●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/replication/replication.xml 12 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml
@@ -26,25 +26,17 @@
 !      Portions Copyright 2006-2007 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="replication_binarycopy"/>
  <function name="replication_binarycopy">
    <sequence>
      <block name="'binarycopy'">
        <sequence>
          <script>
            if not CurrentTestPath.has_key('group'):
              CurrentTestPath['group']='replication'                 
            CurrentTestPath['suite']=STAXCurrentBlock
          </script>
          <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).
@@ -55,7 +47,6 @@
          #@TestHTMLLink        http://opends.dev.java.net/
          -->
            
          <import machine="STAF_LOCAL_HOSTNAME"
            file="'%s/testcases/replication/replication_setup.xml' % (TESTS_DIR)"/>
          <call function="'replication_setup'" />
@@ -80,19 +71,18 @@
              <message>
                 'Replication: Binary Copy: Off-line initialisation. Initialise replicated servers using off-line backup/restore'
              </message>
              <!-- Stop the servers in the topology -->  
              <call function="'stopServers'">
                [_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 -->    
@@ -105,45 +95,50 @@
                  '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>                
                
              <!-- 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 servers in the topology -->  
              <call function="'startServers'">
                [_topologyServerList]
              </call>                
                
              <!-- Add entry to "master" server -->                       
              <call function="'addEntry'">
                { 'location'       : clientHost,
@@ -152,20 +147,18 @@
                  '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 -->          
              <call function="'verifyTrees'">
                [ clientHost, clientPath, master, consumerList, synchroSuffix ]
              </call> 
              <call function="'testCase_Postamble'"/>
            </sequence>
          </testcase>                     
          
          <!--- Test Case information
          #@TestMarker          Replication Binary Copy Tests
          #@TestName            Replication: Binary Copy: On-line initialisation
@@ -196,7 +189,8 @@
                  '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 -->              
@@ -208,7 +202,8 @@
                  '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 -->    
@@ -222,10 +217,10 @@
                  '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,
@@ -235,18 +230,26 @@
                  '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>
                  <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'">
@@ -257,13 +260,12 @@
                      '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>
                
              <!-- Add entry to "master" server -->                       
              <call function="'addEntry'">
                { 'location'       : clientHost,
@@ -272,32 +274,24 @@
                  '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 -->          
              <call function="'verifyTrees'">
                [ clientHost, clientPath, master, consumerList, synchroSuffix ]
              </call> 
              <call function="'testCase_Postamble'"/>
            </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>
opends/tests/functional-tests/testcases/replication/replication.xml
@@ -26,23 +26,16 @@
 !      Portions Copyright 2006-2007 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="main_replication"/>
  <function name="main_replication">
    <sequence>
      <block name="'replication'">
        <sequence>
          <script>
            CurrentTestPath={}
            envAlreadyLoaded='true'
            CurrentTestPath['group']='replication'
          </script>
          <call function="'testGroup_Preamble'"/>
            
          <import machine="STAF_LOCAL_HOSTNAME"
@@ -70,13 +63,8 @@
          <call function="'replication_schema'" />          
            
          <call function="'testGroup_Postamble'"/>
        </sequence>
      </block>
    </sequence>
  </function>
</stax>