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

ugaston
29.55.2008 372f964d50aca30e7dd47f4862c69852065a8a14
Code clean-up
2 files modified
156 ■■■■■ changed files
opends/tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml 87 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/replication/encryption/encryption.xml 69 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml
@@ -39,7 +39,9 @@
          <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
@@ -48,7 +50,8 @@
          -->
          
          <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>
@@ -57,9 +60,11 @@
          
          <!--- 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
@@ -69,7 +74,8 @@
            <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'">
@@ -110,10 +116,14 @@
              <!-- 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>
@@ -121,15 +131,18 @@
                  <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>
@@ -149,11 +162,13 @@
                  '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>
@@ -165,7 +180,8 @@
          #@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
@@ -175,7 +191,8 @@
            <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
@@ -183,7 +200,8 @@
                [_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,
@@ -191,7 +209,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>
              
@@ -204,7 +223,8 @@
                  'dsInstanceDn'   : master.getRootDn(),
                  'dsInstancePswd' : master.getRootPwd(),
                  'taskID'         : 'import task',
                  'ldifFile'       : '%s/replication/Example.ldif' % masterDataDir
                  'ldifFile'       : '%s/replication/Example.ldif' \
                                     % masterDataDir
                }
              </call>
              
@@ -232,17 +252,22 @@
                  '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>
@@ -250,8 +275,10 @@
                  <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>
@@ -264,7 +291,8 @@
                      '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>
@@ -278,11 +306,13 @@
                  '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>
@@ -291,7 +321,8 @@
          </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>
opends/tests/functional-tests/testcases/replication/encryption/encryption.xml
@@ -63,78 +63,15 @@
          <call function="'replication_setup'">
            {  'topologyFile'    : '%s/config/replication/3server_topology.txt'\
                                     % TESTS_DIR,
              'secureReplication': True  }
              'secureReplication': True,
              'dataFile'         : 'Example.ldif'
            }
          </call>
                                    
          <script>
            consumer = consumerList[0]              
            synchroSuffix = master.getSynchronizedSuffixList()[0].getSuffixDn()
          </script>        
            
          <!-- Load entries into "master" server -->
          <!-- Stop "master" Directory Server -->
          <call function="'StopDsWithScript'">
            { 'location'  : masterHost,
              'dsPath'    : masterPath,
              'dsHost'    : masterHost,
              'dsPort'    : master.getPort(),
              'dsBindDN'  : master.getRootDn(),
              'dsBindPwd' : master.getRootPwd()
            }
          </call>
          <!-- Import data into "master" Directory Server -->
          <call function="'ImportLdifWithScript'">
            { 'location'     : masterHost,
              'dsPath'       : masterPath,
              'dsBackEnd'    : 'userRoot',
              'dsLdifFile'   : '%s/replication/Example.ldif' % masterDataDir
            }
          </call>
          <!-- Start the Directory Server -->
          <call function="'StartDsWithScript'">
            { 'location'  : masterHost,
              'dsPath'    : masterPath
            }
          </call>
          <!-- Wait for DS to start -->
          <call function="'isAlive'">
            { 'location'         : masterHost,
              'dsPath'           : masterPath,
              'dsInstanceHost'   : masterHost,
              'dsInstancePort'   : master.getPort() ,
              'dsInstanceDn'     : master.getRootDn() ,
              'dsInstancePswd'   : master.getRootPwd() ,
              'noOfLoops'        : 10 ,
              'noOfMilliSeconds' : 2000
            }
          </call>
          <!-- Initialise the servers in the topology -->
<!--
          <call function="'initializeReplication'">
            { 'location'  :  clientHost,
              'dsPath'  :  clientPath,
              'sourceInstanceHost'  :  masterHost,
              'sourceInstancePort'  :  master.getPort(),
              'replicationDnList'  :  [synchroSuffix]
            }
          </call>
-->
          <iterate var="server" in="consumerList">
            <call function="'initializeReplication'">
              { 'location'           : clientHost,
                'dsPath'             : clientPath,
                'dsInstanceHost'     : server.getHostname(),
                'dsInstancePort'     : server.getPort(),
                'sourceInstanceHost' : masterHost,
                'sourceInstancePort' : master.getPort(),
                'replicationDnList'  : [synchroSuffix]
              }
            </call>
          </iterate>
            
                        
          <!--- Test Case information