From ba86e4e4d6c4debd4a24ae908b0eb4f203f414ff Mon Sep 17 00:00:00 2001
From: Gary Williams <gary.williams@forgerock.com>
Date: Fri, 16 Sep 2011 16:28:35 +0000
Subject: [PATCH] Clean of use of data and temp data in functional tests

---
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/fractional-replication_setup.xml |    7 
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml                                    |   11 
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/core/psearch/core_psearch_tests.xml                     |   41 +-
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/encryption/encryption.xml                   |   25 +-
 opendj-sdk/opends/tests/staf-tests/shared/python/common.py                                                            |   23 +
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml                        |   67 +++-
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml                   |   38 ++-
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/basic/basic.xml                             |   29 +-
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/resynchronization/resynchronization.xml     |   60 +++-
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_target.xml                                      |    3 
 opendj-sdk/opends/tests/staf-tests/shared/python/replication.py                                                       |   23 +
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/structure/schema_structure.xml                   |    2 
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog.xml                     |   87 ++++---
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/ldifimport/ldifimport.xml                   |   43 +-
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_backup_task.xml                   |   20 
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_restore_task.xml                  |   22 +
 opendj-sdk/opends/tests/staf-tests/shared/functions/dsadm.xml                                                         |   14 +
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/basic/replication_basic_setup.xml           |   17 
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_export_task.xml                   |   21 
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/conflict/conflict.xml                       |    2 
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/replication_setup.xml                       |    9 
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/failover/failover.xml                       |    1 
 opendj-sdk/opends/tests/staf-tests/shared/functions/stafcmd.xml                                                       |   29 ++
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v3_customconf.xml                             |    4 
 opendj-sdk/opends/tests/staf-tests/shared/functions/utils.xml                                                         |    3 
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/aci/aci.xml                                 |    1 
 opendj-sdk/opends/tests/staf-tests/shared/functions/topology.xml                                                      |   59 ++++
 opendj-sdk/opends/tests/staf-tests/shared/functions/environment.xml                                                   |   11 
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/schema/schema.xml                           |    1 
 29 files changed, 448 insertions(+), 225 deletions(-)

diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_target.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_target.xml
index 120afe8..f134723 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_target.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_target.xml
@@ -24,12 +24,13 @@
  ! CDDL HEADER END
  !
  !      Copyright 2008-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
   <defaultcall function="aci_target"/>
 
-  <function name="aci_target">
+  <function name="aci_target" scope="local">
 
     <sequence>
 
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/core/psearch/core_psearch_tests.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/core/psearch/core_psearch_tests.xml
index c3ba5d6..0bca409 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/core/psearch/core_psearch_tests.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/core/psearch/core_psearch_tests.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
@@ -118,7 +119,7 @@
                 'dsBaseDn'       : "dc=example,dc=com",
                 'operation'      : "delete",
                 'ldif'           : "True",
-                'outputFile'     : '%s/core/psearch/delete/delete.out' % remote.data
+                'outputFile'     : '%s/core/psearch/delete/psearch-delete.out' % remote.temp
               }
               </call>
             </sequence>
@@ -172,9 +173,9 @@
               </message>
               <call function="'LdifDiffWithScript'">
               {
-                'sourceLdif' : '%s/core/psearch/delete/delete.out' % remote.data,
+                'sourceLdif' : '%s/core/psearch/delete/psearch-delete.out' % remote.temp,
                 'targetLdif' : '%s/core/psearch/delete/delete.ref' % remote.data,
-                'outputLdif' : '%s/delete.out' % remote.temp
+                'outputLdif' : '%s/psearch-delete-diffs.out' % remote.temp
               }
               </call>
               <if expr="STAXResult != 0">
@@ -238,7 +239,7 @@
                   'dsBaseDn'       : "dc=example,dc=com",
                   'operation'      : "delete",
                   'ldif'           : "True",
-                  'outputFile'     : '%s/core/psearch/delete/delete_blank.out' % remote.data
+                  'outputFile'     : '%s/core/psearch/delete/delete_blank.out' % remote.temp
                 }
               </call>
             </sequence>
@@ -329,7 +330,7 @@
           <call function="'GetEntry'">
             {
               'location'  : STAF_REMOTE_HOSTNAME ,
-              'entry'     :  '%s/core/psearch/delete/delete_blank.out' % remote.data,
+              'entry'     :  '%s/core/psearch/delete/delete_blank.out' % remote.temp,
               'attribute' : 'TYPE'
             }
           </call>
@@ -393,7 +394,7 @@
                 'dsBaseDn'       : "dc=example,dc=com",
                 'operation'      : "modify",
                 'ldif'           : "True",
-                'outputFile'     : '%s/core/psearch/modify/modify.out' % remote.data
+                'outputFile'     : '%s/core/psearch/modify/psearch-modify.out' % remote.temp
               }
               </call>
             </sequence>
@@ -450,9 +451,9 @@
               </message>
               <call function="'LdifDiffWithScript'">
               {
-                'sourceLdif' : '%s/core/psearch/modify/modify.out' % remote.data,
+                'sourceLdif' : '%s/core/psearch/modify/psearch-modify.out' % remote.temp,
                 'targetLdif' : '%s/core/psearch/modify/modify.ref' % remote.data,
-                'outputLdif' : '%s/modify.out' % remote.temp
+                'outputLdif' : '%s/psearch-modify-diffs.out' % remote.temp
               }
               </call>
               <if expr="STAXResult != 0">
@@ -516,7 +517,7 @@
                 'dsBaseDn'       : "dc=example,dc=com",
                 'operation'      : "modify",
                 'ldif'           : "True",
-                'outputFile'     : '%s/core/psearch/modify/modify_blank.out' % remote.data
+                'outputFile'     : '%s/core/psearch/modify/psearch-modify_blank.out' % remote.temp
               }
               </call>
             </sequence>
@@ -607,7 +608,7 @@
           <call function="'GetEntry'">
             {
             'location'  : STAF_REMOTE_HOSTNAME ,
-            'entry'     :  '%s/core/psearch/modify/modify_blank.out' % remote.data,
+            'entry'     :  '%s/core/psearch/modify/psearch-modify_blank.out' % remote.temp,
             'attribute' : 'TYPE'
             }
           </call>
@@ -670,7 +671,7 @@
                   'dsBaseDn'       : "dc=example,dc=com",
                   'operation'      : "moddn",
                   'ldif'           : "True",
-                  'outputFile'     : '%s/core/psearch/moddn/moddn.out' % remote.data
+                  'outputFile'     : '%s/core/psearch/moddn/psearch-moddn.out' % remote.temp
                 }
               </call>
             </sequence>
@@ -727,9 +728,9 @@
               </message>
               <call function="'LdifDiffWithScript'">
                 {
-                  'sourceLdif' : '%s/core/psearch/moddn/moddn.out' % remote.data,
+                  'sourceLdif' : '%s/core/psearch/moddn/psearch-moddn.out' % remote.temp,
                   'targetLdif' : '%s/core/psearch/moddn/moddn.ref' % remote.data,
-                  'outputLdif' : '%s/moddn.out' % remote.temp
+                  'outputLdif' : '%s/psearch-moddn-diffs.out' % remote.temp
                 }
               </call>
               <if expr="STAXResult != 0">
@@ -793,7 +794,7 @@
                   'dsBaseDn'       : "dc=example,dc=com",
                   'operation'      : "moddn",
                   'ldif'           : "True",
-                  'outputFile'     : '%s/core/psearch/moddn/moddn_blank.out' % remote.data
+                  'outputFile'     : '%s/core/psearch/moddn/psearch-moddn_blank.out' % remote.temp
                 }
               </call>
             </sequence>
@@ -884,7 +885,7 @@
           <call function="'GetEntry'">
             {
               'location'  : STAF_REMOTE_HOSTNAME ,
-              'entry'     :  '%s/core/psearch/moddn/moddn_blank.out' % remote.data,
+              'entry'     :  '%s/core/psearch/moddn/psearch-moddn_blank.out' % remote.temp,
               'attribute' : 'TYPE'
             }
           </call>
@@ -948,7 +949,7 @@
                 'dsBaseDn'       : "dc=example,dc=com",
                 'operation'      : "add",
                 'ldif'           : "True",
-                'outputFile'     : '%s/core/psearch/add/add.out' % remote.data
+                'outputFile'     : '%s/core/psearch/add/psearch-add.out' % remote.temp
               }
               </call>
             </sequence>
@@ -1005,9 +1006,9 @@
               </message>
               <call function="'LdifDiffWithScript'">
               {
-                'sourceLdif' : '%s/core/psearch/add/add.out' % remote.data,
+                'sourceLdif' : '%s/core/psearch/add/psearch-add.out' % remote.temp,
                 'targetLdif' : '%s/core/psearch/add/add.ref' % remote.data,
-                'outputLdif' : '%s/add.out' % remote.temp
+                'outputLdif' : '%s/psearch-add-diffs.out' % remote.temp
               }
               </call>
               <if expr="STAXResult != 0">
@@ -1071,7 +1072,7 @@
                 'dsBaseDn'       : "dc=example,dc=com",
                 'operation'      : "add",
                 'ldif'           : "True",
-                'outputFile'     : '%s/core/psearch/add/add_blank.out' % remote.data
+                'outputFile'     : '%s/core/psearch/add/psearch-add_blank.out' % remote.temp
               }
               </call>
             </sequence>
@@ -1162,7 +1163,7 @@
           <call function="'GetEntry'">
             {
               'location'  : STAF_REMOTE_HOSTNAME ,
-              'entry'     :  '%s/core/psearch/add/add_blank.out' % remote.data,
+              'entry'     :  '%s/core/psearch/add/psearch-add_blank.out' % remote.temp,
               'attribute' : 'TYPE'
             }
           </call>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml
index a1eca04..da355f4 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2009-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
   <defaultcall function="fractional-replication_basic"/>
@@ -216,10 +217,10 @@
           <call function="'basic_initialization'"/>
 
           <call function="'basic_add'">
-            {  'masterEntry'  : '%s/%s/fractional-replication/basic-masterAdd.ldif' \
-                                % (Pservers[0].getDir(),remote.reldatadir),
-               'replicaEntry' : '%s/%s/fractional-replication/basic-replicaExcludeAdd.ldif' \
-                                % (Pservers[1].getDir(),remote.reldatadir)
+            {  'masterEntry'  : '%s/fractional-replication/basic-masterAdd.ldif' \
+                                % Pservers[0].getDataDir(),
+               'replicaEntry' : '%s/fractional-replication/basic-replicaExcludeAdd.ldif' \
+                                % Pservers[1].getDataDir()
             }
           </call>
 
@@ -299,10 +300,10 @@
           <call function="'basic_initialization'"/>
 
           <call function="'basic_add'">
-            {  'masterEntry'  : '%s/%s/fractional-replication/basic-masterAdd.ldif' \
-                                % (Pservers[0].getDir(),remote.reldatadir),
-               'replicaEntry' : '%s/%s/fractional-replication/basic-replicaIncludeAdd.ldif' \
-                                % (Pservers[1].getDir(),remote.reldatadir)
+            {  'masterEntry'  : '%s/fractional-replication/basic-masterAdd.ldif' \
+                                % Pservers[0].getDataDir(),
+               'replicaEntry' : '%s/fractional-replication/basic-replicaIncludeAdd.ldif' \
+                                % Pservers[1].getDataDir()
             }
           </call>
 
@@ -349,8 +350,8 @@
             { "location"          : Pservers[0].getHostname(),
               "dsPath"            : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
               "backEnd"           : "userRoot",
-              "templateFile"      : "%s/%s/fractional-replication/basic-master.template" % \
-                                    (Pservers[0].getDir(),remote.reldatadir),
+              "templateFile"      : "%s/fractional-replication/basic-master.template" \
+                                      % Pservers[0].getDataDir(),
               "replaceExisting"   : True,
             }
           </call>
@@ -359,6 +360,9 @@
             [ Pservers ]
           </call>
           <!-- Check some data was imported into Directory Server -->
+          <message>
+            'Checking import on %s folder %s.' % (Pservers[0].getHostname(),Pservers[0].getDir())
+          </message>
           <call function="'checkImport'">
             { 'location'            : Pservers[0].getHostname(),
               'dsPath'              : '%s/%s' \
@@ -448,6 +452,15 @@
             }
           </call>
 
+          <script>
+            thisDataDir1="%s/fractional-replication" \
+                                  % Pservers[0].getDataDir()
+            thisDataDir2="%s/fractional-replication" \
+                                  % Pservers[1].getDataDir()
+            thisTempdir1=Pservers[0].getTmpDir()
+            thisTempdir2=Pservers[1].getTmpDir()
+          </script>
+
           <call function="'ImportLdifWithScript'">
             { 'location'            : Pservers[0].getHostname(),
               'dsPath'              : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
@@ -457,10 +470,10 @@
               'dsInstancePswd'      : Pservers[0].getRootPwd(),
               'backEnd'             : 'userRoot',
               'append'              : True,
-              'rejectFile'          : '%s/basic-masterOnlineImport.rejected' % remote.temp,
+              'rejectFile'          : '%s/basic-masterOnlineImport.rejected' % thisTempdir1,
               'overwriteFile'       : True,
-              'templateFile'        : '%s/%s/fractional-replication/basic-masterOnlineImport.template' % \
-                                      (Pservers[0].getDir(),remote.reldatadir)
+              'templateFile'        : '%s/basic-masterOnlineImport.template' % \
+                                      thisDataDir1
             }
           </call>
           <call function="'ImportLdifWithScript'">
@@ -472,10 +485,10 @@
               'dsInstancePswd'      : Pservers[1].getRootPwd(),
               'backEnd'             : 'userRoot',
               'append'              : True,
-              'rejectFile'          : '%s/basic-masterOnlineImport.rejected' % remote.temp,
+              'rejectFile'          : '%s/basic-masterOnlineImport.rejected' % thisTempdir2,
               'overwriteFile'       : True,
-              'templateFile'        : '%s/%s/fractional-replication/basic-masterOnlineImport.template' % \
-                                      (Pservers[1].getDir(),remote.reldatadir)
+              'templateFile'        : '%s/basic-masterOnlineImport.template' % \
+                                      thisDataDir2
             }
           </call>
           <call function="'replicationStatus'">
@@ -716,6 +729,12 @@
       <try>
         <sequence>
           <call function="'testCase_Preamble'"/>
+          
+          <script>
+            thisDataDir1="%s/fractional-replication" \
+                                  % Pservers[0].getDataDir()
+          </script>
+
           <call function="'ldapModifyWithScript'">
             { 'location'       : Pservers[0].getHostname(),
               'dsPath'         : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
@@ -723,9 +742,9 @@
               'dsInstancePort' : Pservers[0].getPort(),
               'dsInstanceDn'   : Pservers[0].getRootDn(),
               'dsInstancePswd' : Pservers[0].getRootPwd(),
-              'dsFilename'     : '%s/%s/fractional-replication/basic-masterModify.ldif' \
-                                 % (Pservers[0].getDir(),remote.reldatadir)
-            }                
+              'dsFilename'     : '%s/basic-masterModify.ldif' \
+                                 % thisDataDir1
+            }
           </call>
           <call function="'SearchObject'">
             { 'location'       : Pservers[0].getHostname(),
@@ -781,6 +800,12 @@
       <try>
         <sequence>
           <call function="'testCase_Preamble'"/>
+          
+          <script>
+            thisDataDir1 = "%s/fractional-replication" \
+                             % Pservers[0].getDataDir()
+          </script>
+
           <call function="'addEntry'">
             { 'location'            : Pservers[0].getHostname(),
               'dsPath'              : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
@@ -788,8 +813,8 @@
               'dsInstancePort' : Pservers[0].getPort(),
               'dsInstanceDn'   : Pservers[0].getRootDn(),
               'dsInstancePswd' : Pservers[0].getRootPwd(),
-              'entryToBeAdded' : '%s/%s/fractional-replication/basic-masterModifyDN.ldif' \
-                                 % (Pservers[0].getDir(),remote.reldatadir)
+              'entryToBeAdded' : '%s/basic-masterModifyDN.ldif' \
+                                 % thisDataDir1
             }
           </call>
           <call function="'SearchObject'">
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/fractional-replication_setup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/fractional-replication_setup.xml
index e202add..3aaaba7 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/fractional-replication_setup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/fractional-replication_setup.xml
@@ -55,7 +55,7 @@
           initialisation.
           If no filename provided (default), the topology won't be initialised.
           If a filename provided, after initialisation the suffix will be
-          backuped under masterBackupDir.
+          backed up under masterBackupDir.
         </function-arg-description>
         <function-arg-property name="type" value="filename"/>
       </function-arg-def>
@@ -116,9 +116,10 @@
             masterHost = master.getHostname()
             masterReplicationServer = master.getChangelogServer()
             masterPath = '%s/%s' % (master.getDir(),OPENDSNAME)
-            masterDataDir = '%s/%s' % (master.getDir(),remote.reldatadir)
+            masterDataDir = master.getDataDir()
+            masterTempDir = master.getTmpDir()
             synchroSuffix = master.getSynchronizedSuffixList()[0].getSuffixDn()
-            masterBackupDir = '%s/fractional-replication/master_backup' % masterDataDir
+            masterBackupDir = '%s/fractional-replication/master_backup' % masterTempDir
 
             consumerList = _topologyServerList[1:]
 
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_backup_task.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_backup_task.xml
index 0a790f9..597454d 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_backup_task.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_backup_task.xml
@@ -106,7 +106,7 @@
                     'dsInstanceDn'     : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
                     'dsInstancePswd'   : 'ACIRules' ,
                     'taskID'           : '3' ,
-                    'backupDir'        : '%s/privileges/' % remote.data ,
+                    'backupDir'        : '%s/privileges/' % remote.temp ,
                     'expectedRC'       : 50
                   }
                   </call>
@@ -136,7 +136,7 @@
                     'dsInstanceDn'     : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
                     'dsInstancePswd'   : 'ACIRules' ,
                     'taskID'           : '3' ,
-                    'backupDir'        : '%s/privileges/' % remote.data ,
+                    'backupDir'        : '%s/privileges/' % remote.temp ,
                     'expectedRC'       : 50
                   }
                   </call>
@@ -170,7 +170,7 @@
                     'dsInstanceDn'     : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
                     'dsInstancePswd'   : 'ACIRules' ,
                     'taskID'           : '3' ,
-                    'backupDir'        : '%s/privileges/' % remote.data
+                    'backupDir'        : '%s/privileges/' % remote.temp
                   }
                   </call>
                   
@@ -214,7 +214,7 @@
                     'dsInstanceDn'     : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
                     'dsInstancePswd'   : 'ACIRules' ,
                     'taskID'           : '3.1' ,
-                    'backupDir'        : '%s/privileges/' % remote.data ,
+                    'backupDir'        : '%s/privileges/' % remote.temp ,
                     'expectedRC'       : 50
                   }
                   </call>
@@ -258,7 +258,7 @@
                     'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                     'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                     'taskID'           : '3.2' ,
-                    'backupDir'        : '%s/privileges/' % remote.data
+                    'backupDir'        : '%s/privileges/' % remote.temp
                   }
                   </call>
                   
@@ -287,7 +287,7 @@
                     'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                     'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD  ,
                     'taskID'           : '3.3' ,
-                    'backupDir'        : '%s/privileges/' % remote.data ,
+                    'backupDir'        : '%s/privileges/' % remote.temp ,
                     'expectedRC'       : 50
                   }
                   </call>
@@ -317,7 +317,7 @@
                     'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                     'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                     'taskID'           : '3.4' ,
-                    'backupDir'        : '%s/privileges/' % remote.data
+                    'backupDir'        : '%s/privileges/' % remote.temp
                   }
                   </call>
                        
@@ -372,7 +372,7 @@
                     'dsInstanceDn'     : 'cn=Zroot' ,
                     'dsInstancePswd'   : 'PrivsRule' ,
                     'taskID'           : '3.5' ,
-                    'backupDir'        : '%s/privileges/' % remote.data
+                    'backupDir'        : '%s/privileges/' % remote.temp
                   }
                   </call>
                   
@@ -401,7 +401,7 @@
                     'dsInstanceDn'     : 'cn=Zroot' ,
                     'dsInstancePswd'   : 'PrivsRule' ,
                     'taskID'           : '3.6' ,
-                    'backupDir'        : '%s/privileges/' % remote.data ,
+                    'backupDir'        : '%s/privileges/' % remote.temp ,
                     'expectedRC'       : 50
                   }
                   </call>
@@ -431,7 +431,7 @@
                     'dsInstanceDn'     : 'cn=Zroot' ,
                     'dsInstancePswd'   : 'PrivsRule'  ,
                     'taskID'           : '3.7' ,
-                    'backupDir'        : '%s/privileges/' % remote.data
+                    'backupDir'        : '%s/privileges/' % remote.temp
                   }
                   </call>
                        
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_export_task.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_export_task.xml
index 8626d6b..bf9eb6e 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_export_task.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_export_task.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2008-2009 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
@@ -107,7 +108,7 @@
                      'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                      'dsInstanceDn'     : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
                      'dsInstancePswd'   : 'ACIRules' ,
-                     'ldifFile'         : '%s/privileges/export_task_out.ldif' % remote.data ,
+                     'ldifFile'         : '%s/privileges/export_task_out.ldif' % remote.temp ,
                      'expectedRC'       : 1
                   }
                 </call>
@@ -146,7 +147,7 @@
                      'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                     'dsInstanceDn'     : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
                     'dsInstancePswd'   : 'ACIRules' ,
-                    'ldifFile'         : '%s/privileges/export_task_out.ldif' % remote.data ,
+                    'ldifFile'         : '%s/privileges/export_task_out.ldif' % remote.temp ,
                     'expectedRC'       : 1
                   }
                 </call>
@@ -189,7 +190,7 @@
                      'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                     'dsInstanceDn'     : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
                     'dsInstancePswd'   : 'ACIRules' ,
-                    'ldifFile'         : '%s/privileges/export_task_out.ldif' % remote.data
+                    'ldifFile'         : '%s/privileges/export_task_out.ldif' % remote.temp
                   }
                 </call>
                   
@@ -232,7 +233,7 @@
                      'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                     'dsInstanceDn'     : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
                     'dsInstancePswd'   : 'ACIRules' ,
-                    'ldifFile'         : '%s/privileges/export_task_out2.ldif' % remote.data ,
+                    'ldifFile'         : '%s/privileges/export_task_out2.ldif' % remote.temp ,
                    'expectedRC'       : 1
                   }
                 </call>
@@ -285,7 +286,7 @@
                     'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                     'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                     'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
-                    'ldifFile'         : '%s/privileges/export_task_out3.ldif' % remote.data
+                    'ldifFile'         : '%s/privileges/export_task_out3.ldif' % remote.temp
                   }
                 </call>
                   
@@ -313,7 +314,7 @@
                      'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                     'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                     'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
-                    'ldifFile'         : '%s/privileges/export_task_out4.ldif' % remote.data ,
+                    'ldifFile'         : '%s/privileges/export_task_out4.ldif' % remote.temp ,
                     'expectedRC'       : 1
                   }
                 </call>
@@ -352,7 +353,7 @@
                      'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                     'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                     'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
-                    'ldifFile'         : '%s/privileges/export_task_out5.ldif' % remote.data
+                    'ldifFile'         : '%s/privileges/export_task_out5.ldif' % remote.temp
                   }
                 </call>
                        
@@ -406,7 +407,7 @@
                     'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                     'dsInstanceDn'     : 'cn=Zroot' ,
                     'dsInstancePswd'   : 'PrivsRule' ,
-                    'ldifFile'         : '%s/privileges/export_task_out6.ldif' % remote.data
+                    'ldifFile'         : '%s/privileges/export_task_out6.ldif' % remote.temp
                   }
                 </call>
                   
@@ -434,7 +435,7 @@
                      'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                     'dsInstanceDn'     : 'cn=Zroot' ,
                     'dsInstancePswd'   : 'PrivsRule' ,
-                    'ldifFile'         : '%s/privileges/export_task_out7.ldif' % remote.data ,
+                    'ldifFile'         : '%s/privileges/export_task_out7.ldif' % remote.temp ,
                    'expectedRC'       : 1
                   }
                 </call>
@@ -473,7 +474,7 @@
                     'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                     'dsInstanceDn'     : 'cn=Zroot' ,
                     'dsInstancePswd'   : 'PrivsRule' ,
-                    'ldifFile'         : '%s/privileges/export_task_out8.ldif' % remote.data
+                    'ldifFile'         : '%s/privileges/export_task_out8.ldif' % remote.temp
                   }
                 </call>
                        
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_restore_task.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_restore_task.xml
index 5418f6a..3d46de2 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_restore_task.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_restore_task.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2008-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
@@ -122,7 +123,7 @@
                     'dsInstanceDn'        : DIRECTORY_INSTANCE_DN ,
                     'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD ,
                     'taskID'              : '6' ,
-                    'backupDir'           : '%s/privileges/privileges_restore_task/' % remote.data
+                    'backupDir'           : '%s/privileges/privileges_restore_task/' % remote.temp
                   }
                   </call>
                   
@@ -179,7 +180,7 @@
                       'dsInstanceDn'     : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
                       'dsInstancePswd'   : 'ACIRules',
                       'taskID'           : '6.1',
-                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.data,
+                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.temp,
                       'expectedRC'       : 50
                     }
                   </call>
@@ -213,7 +214,7 @@
                       'dsInstanceDn'     : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
                       'dsInstancePswd'   : 'ACIRules',
                       'taskID'           : '6.2',
-                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.data
+                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.temp
                     }
                   </call>
                   
@@ -311,7 +312,7 @@
                     'dsInstanceDn'        : 'cn=Aroot' ,
                     'dsInstancePswd'      : 'PrivsRule' ,
                     'taskID'              : '6.3' ,
-                    'backupDir'           : '%s/privileges/privileges_restore_task/' % remote.data
+                    'backupDir'           : '%s/privileges/privileges_restore_task/' % remote.temp
                   }
                   </call>
                   
@@ -368,7 +369,7 @@
                       'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                       'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD,
                       'taskID'           : '6.4',
-                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.data,
+                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.temp,
                       'expectedRC'       : 50
                     }
                   </call>
@@ -398,7 +399,7 @@
                       'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                       'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD,
                       'taskID'           : '6.5',
-                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.data
+                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.temp
                     }
                   </call>
                   
@@ -494,7 +495,7 @@
                     'dsInstanceDn'        : 'cn=Zroot' ,
                     'dsInstancePswd'      : 'PrivsRule' ,
                     'taskID'              : '6.6' ,
-                    'backupDir'           : '%s/privileges/privileges_restore_task/' % remote.data
+                    'backupDir'           : '%s/privileges/privileges_restore_task/' % remote.temp
                   }
                   </call>
                   
@@ -507,7 +508,8 @@
                       'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
                       'dsInstanceDn'          : 'cn=Aroot' ,
                       'dsInstancePswd'        : 'PrivsRule' ,
-                      'entryToBeModified'     : '%s/privileges/privileges_restore_task/del_entry.ldif' % remote.data }
+                      'entryToBeModified'     : '%s/privileges/privileges_restore_task/del_entry.ldif' % remote.data
+                    }
                   </call>
       
                   <message>
@@ -551,7 +553,7 @@
                       'dsInstanceDn'     : 'cn=Zroot' ,
                       'dsInstancePswd'   : 'PrivsRule' ,
                       'taskID'           : '6.7',
-                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.data,
+                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.temp,
                       'expectedRC'       : 50
                     }
                   </call>
@@ -581,7 +583,7 @@
                       'dsInstanceDn'     : 'cn=Zroot' ,
                       'dsInstancePswd'   : 'PrivsRule' ,
                       'taskID'           : '6.8',
-                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.data
+                      'backupDir'        : '%s/privileges/privileges_restore_task/' % remote.temp
                     }
                   </call>
                   
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/aci/aci.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/aci/aci.xml
index 5006314..6a43ed6 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/aci/aci.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/aci/aci.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/basic/basic.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/basic/basic.xml
index 06facb8..0aef7ed 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/basic/basic.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/basic/basic.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2007-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
@@ -492,7 +493,7 @@
 
               <script>
                 filename = 'replication_mod_delete.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 dn = 'uid=smason, ou=People,%s' % synchroSuffix
                 modif = 'delete'
                 attrType = 'roomNumber'
@@ -504,7 +505,7 @@
               <!-- Copy the replication_mod ldif to client host -->
               <message>
                 'Copy %s file from %s to %s' \
-                % (filename,local.data,clientDataDir)
+                % (filename,local.temp,clientDataDir)
               </message>
               <call function="'copyFile'">
                 { 'srcfile'    : filePath,
@@ -1367,7 +1368,7 @@
                
               <script>
                 filename = 'replication_mod_add_binary.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 binaryFilePath = '%s/replication/photo1.uu' % source.data
                 dn = 'uid=hmiller, ou=People,%s' % synchroSuffix
                 modif = 'add'
@@ -1379,7 +1380,7 @@
               <!-- Copy the replication_mod ldif to client host -->
               <message>
                 'Copy %s file from %s to %s' \
-                % (filename,local.data,clientDataDir)
+                % (filename,local.temp,clientDataDir)
               </message>
               <call function="'copyFile'">
                 { 'srcfile'    : filePath,
@@ -1465,7 +1466,7 @@
                
               <script>
                 filename = 'replication_mod_replace_binary.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 binaryFilePath = '%s/replication/photo2.uu' % source.data
                 dn = 'uid=hmiller, ou=People,%s' % synchroSuffix
                 modif = 'replace'
@@ -1477,7 +1478,7 @@
               <!-- Copy the replication_mod ldif to client host -->
               <message>
                 'Copy %s file from %s to %s' \
-                % (filename,local.data,clientDataDir)
+                % (filename,local.temp,clientDataDir)
               </message>
               <call function="'copyFile'">
                 { 'srcfile'    : filePath,
@@ -1564,7 +1565,7 @@
                     
               <script>
                 filename = 'replication_mod_delete_binary.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 dn = 'uid=hmiller, ou=People,%s' % synchroSuffix
                 modif = 'delete'
                 attrType = 'jpegPhoto'
@@ -1576,7 +1577,7 @@
               <!-- Copy the replication_mod ldif to client host -->
               <message>
                 'Copy %s file from %s to %s' \
-                % (filename,local.data,clientDataDir)
+                % (filename,local.temp,clientDataDir)
               </message>
               <call function="'copyFile'">
                 { 'srcfile'    : filePath,
@@ -1660,7 +1661,7 @@
                
               <script>
                 filename = 'replication_modrdn.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 dn = 'uid=kvaughan, ou=People,%s' % synchroSuffix
                 newrdn = 'uid=kvaughan2'
                 newsuperior = None
@@ -1672,7 +1673,7 @@
               <!-- Copy the replication_mod ldif to client host -->
               <message>
                 'Copy %s file from %s to %s' \
-                % (filename,local.data,clientDataDir)
+                % (filename,local.temp,clientDataDir)
               </message>
               <call function="'copyFile'">
                 { 'srcfile'    : filePath,
@@ -1767,7 +1768,7 @@
                
               <script>
                 filename = 'replication_modrdn_preserve.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 dn = 'uid=jwallace, ou=People,%s' % synchroSuffix
                 newrdn = 'uid=igueye'
                 newsuperior = None
@@ -1779,7 +1780,7 @@
               <!-- Copy the replication_mod ldif to client host -->
               <message>
                 'Copy %s file from %s to %s' \
-                % (filename,local.data,clientDataDir)
+                % (filename,local.temp,clientDataDir)
               </message>
               <call function="'copyFile'">
                 { 'srcfile'    : filePath,
@@ -1882,7 +1883,7 @@
         
               <script>
                 filename = 'replication_moddn.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 dn = 'ou=People,%s' % synchroSuffix
                 newrdn = 'ou=Special People'
                 newsuperior = 'ou=Special Users,%s' % synchroSuffix
@@ -1894,7 +1895,7 @@
               <!-- Copy the replication_mod ldif to client host -->
               <message>
                 'Copy %s file from %s to %s' \
-                % (filename,local.data,clientDataDir)
+                % (filename,local.temp,clientDataDir)
               </message>
               <call function="'copyFile'">
                 { 'srcfile'    : filePath,
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/basic/replication_basic_setup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/basic/replication_basic_setup.xml
index 488af6e..bca9f72 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/basic/replication_basic_setup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/basic/replication_basic_setup.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2007-2008 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
@@ -50,13 +51,13 @@
 
       <script>      
         filename = 'replication_add_root_suffix.ldif'
-        filePath = '%s/%s' % (local.data,filename)
+        filePath = '%s/%s' % (local.temp,filename)
         write_replication_add_root_suffix_ldif_file(filePath, synchroSuffix)
       </script>
 
       <!-- Copy the replication_add_root_suffix ldif to client host -->
       <message>
-        'Copy %s file from %s to %s' % (filename,local.data,clientDataDir)
+        'Copy %s file from %s to %s' % (filename,local.temp,clientDataDir)
       </message>
       <call function="'copyFile'">
         { 'srcfile'    : filePath,
@@ -66,13 +67,13 @@
 
       <script>
         filename = 'replication_add_single.ldif'
-        filePath = '%s/%s' % (local.data,filename)
+        filePath = '%s/%s' % (local.temp,filename)
         write_replication_add_single_ldif_file(filePath, synchroSuffix)               
       </script>
 
       <!-- Copy the replication_add_single ldif to client host -->
       <message>
-        'Copy %s file from %s to %s' % (filename,local.data,clientDataDir)
+        'Copy %s file from %s to %s' % (filename,local.temp,clientDataDir)
       </message>
       <call function="'copyFile'">
         { 'srcfile'    : filePath,
@@ -82,13 +83,13 @@
                   
       <script>
         filename = 'replication_add_multiple.ldif'
-        filePath = '%s/%s' % (local.data,filename)
+        filePath = '%s/%s' % (local.temp,filename)
         write_replication_add_multiple_ldif_file(filePath, synchroSuffix)               
       </script>
 
       <!-- Copy the replication_add_multiple ldif to client host -->
       <message>
-        'Copy %s file from %s to %s' % (filename,local.data,clientDataDir)
+        'Copy %s file from %s to %s' % (filename,local.temp,clientDataDir)
       </message>
       <call function="'copyFile'">
         { 'srcfile'    : filePath,
@@ -98,14 +99,14 @@
       
       <script>
         filename = 'replication_mod.ldif'
-        filePath = '%s/%s' % (local.data,filename)
+        filePath = '%s/%s' % (local.temp,filename)
         write_replication_mod_ldif_file(filePath, entryDn, mod_type, attr_type,
                                         attr_value)
       </script>
 
       <!-- Copy the replication_mod ldif to client host -->
       <message>
-        'Copy %s file from %s to %s' % (filename,local.data,clientDataDir)
+        'Copy %s file from %s to %s' % (filename,local.temp,clientDataDir)
       </message>
       <call function="'copyFile'">
         { 'srcfile'    : filePath,
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml
index 0f4c133..3fe1013 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2007-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
   <defaultcall function="replication_binarycopy"/>
@@ -126,24 +127,28 @@
               <call function="'backup'">
                 { 'location'  : masterHost,
                   'dsPath'    : masterPath,
-                  'backupDir' : '%s/replication/master_backup' % masterDataDir
+                  'backupDir' : '%s/replication/master_backup' % masterBackupDir
                 }
               </call>
-              
+
               <!-- Copy backup to "consumer" servers and restore it -->
               <paralleliterate var="consumer" in="consumerList">
                 <sequence>
+                  <script>
+                    #TODO: Fix me
+                    consumerBackupDir = '%s/%s' % (consumer.getDir(),remote.reldatadir)
+                  </script>
                   <call function="'CopyFolderByExtension'">
                     { 'location'   : masterHost,
                       'remotehost' : consumer.getHostname(),
                       'srcfolder'  : '%s/replication/master_backup' \
-                                     % masterDataDir,
-                      'destfolder' : '%s/%s/replication/master_backup' \
-                                     % (consumer.getDir(),remote.reldatadir),
+                                     % masterBackupDir,
+                      'destfolder' : '%s/replication/master_backup' \
+                                     % consumerBackupDir,
                       'extension'  : '*'
                     }
                   </call>
-                    
+
                   <message>
                     '+++++ binary copy off-line: restore back-up on %s:%s' \
                     % (consumer.getHostname(), consumer.getPort())
@@ -151,8 +156,8 @@
                   <call function="'restore'">
                     { 'location'  : consumer.getHostname(),
                       'dsPath'    : '%s/%s' % (consumer.getDir(), OPENDSNAME),
-                      'backupDir' : '%s/%s/replication/master_backup' \
-                                    % (consumer.getDir(),remote.reldatadir)
+                      'backupDir' : '%s/replication/master_backup' \
+                                    % consumerBackupDir
                     }
                   </call>
                 </sequence>
@@ -308,20 +313,25 @@
                   'dsInstancePswd' : master.getRootPwd(),
                   'taskID'         : 'backup task',
                   'backupDir'      : '%s/replication/master_backup_online' \
-                                     % masterDataDir 
+                                     % masterBackupDir 
                 }
               </call>
               
               <!-- Copy backup to "consumer" servers and restore it -->
               <paralleliterate var="consumer" in="consumerList">
                 <sequence>
+                  <script>
+                    #TODO: Fix me
+                    consumerBackupDir = '%s/%s' % (consumer.getDir(),remote.reldatadir)
+                  </script>
+
                   <call function="'CopyFolderByExtension'">
                     { 'location'   : masterHost,
                       'remotehost' : consumer.getHostname(),
                       'srcfolder'  : '%s/replication/master_backup_online' \
-                                     % masterDataDir,
-                      'destfolder' : '%s/%s/replication/master_backup_online' \
-                                     % (consumer.getDir(),remote.reldatadir),
+                                     % masterBackupDir,
+                      'destfolder' : '%s/replication/master_backup_online' \
+                                     % consumerBackupDir,
                       'extension'  : '*'
                     }
                   </call>
@@ -338,8 +348,8 @@
                       'dsInstanceDn'   : consumer.getRootDn(),
                       'dsInstancePswd' : consumer.getRootPwd(),
                       'taskID'         : 'restore task',
-                      'backupDir'   : '%s/%s/replication/master_backup_online' \
-                                      % (consumer.getDir(),remote.reldatadir)
+                      'backupDir'   : '%s/replication/master_backup_online' \
+                                      % consumerBackupDir
                     }
                   </call>
                 </sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog.xml
index 17f2e52..51a0681 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2008-2009 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
     
@@ -288,11 +289,9 @@
                       replServer = server
 
                     replServerPath = '%s/%s' % (replServer.getDir(), OPENDSNAME)
-                    replServerDataDir = '%s/%s' \
-                      % (replServer.getDir(),remote.reldatadir)
-                    exportedChangelog = \
-                      '%s/replication/changelog_export_online.ldif' \
-                      % replServerDataDir                     
+
+                    replServerBackupDir = '%s' % replServer.getTmpDir()
+
                   </script>
 
                   <!-- Export changelog data from server -->
@@ -303,7 +302,8 @@
                       'dsInstanceAdminPort' : replServer.getAdminPort(),
                       'dsInstanceDn'   : replServer.getRootDn(),
                       'dsInstancePswd' : replServer.getRootPwd(),
-                      'ldifFile'       : exportedChangelog,
+                      'ldifFile'       : '%s/replication/changelog_export_online.ldif' \
+                                         % replServerBackupDir,
                       'backEnd'        : 'replicationChanges'
                     }
                   </call>
@@ -312,7 +312,8 @@
                   <call function="'grep'">
                     {
                       'location'   : replServer.getHostname(),
-                      'filename'   : exportedChangelog,
+                      'filename'   : '%s/replication/changelog_export_online.ldif' \
+                                         % replServerBackupDir,
                       'testString' : 'uid=iabizen.2'
                     }
                   </call>
@@ -339,8 +340,7 @@
           #@TestID              Backup-restore (off-line)
           #@TestPurpose         Check replication changelog can be backuped and
                                 restored off-line
-          #@TestPreamble        Backup server suffix (done at the beginning of
-                                the test suite)
+          #@TestPreamble        Backup server suffix
           #@TestSteps           Add entry A to server
           #@TestSteps           Stop servers
           #@TestSteps           Backup every changelog
@@ -361,10 +361,22 @@
               <call function="'testCase_Preamble'"/>
               <message>
                 'Replication: Changelog: Backup-restore (off-line). \
-                Check replication changelog can be backuped and restored \
+                Check replication changelog can be backed up and restored \
                 off-line'
               </message>
 
+              <!-- Backup "master" server -->
+              <message>
+                '+++++ binary copy off-line: back-up server %s:%s' \
+                % (masterHost, master.getPort())
+              </message>
+              <call function="'backup'">
+                { 'location'  : masterHost,
+                  'dsPath'    : masterPath,
+                  'backupDir' : '%s/replication/master_backup' % masterBackupDir
+                }
+              </call>
+
               <!-- Add entry A to "master" server -->
               <script>
                 userDnA = 'uid=iabizen.A, ou=People, %s' % synchroSuffix
@@ -420,16 +432,15 @@
                       replServer = server
 
                     replServerPath = '%s/%s' % (replServer.getDir(), OPENDSNAME)
-                    replServerDataDir = '%s/%s' \
-                      % (replServer.getDir(),remote.reldatadir)
-                    changelogBackupDir = '%s/replication/changelog_backup' \
-                                         % replServerDataDir                     
+                    replServerDataDir = '%s' % replServer.getDataDir()
+                    replServerBackupDir = '%s' % replServer.getTmpDir()           
                   </script>
 
                   <call function="'backup'">
                     { 'location'  : replServer.getHostname(),
                       'dsPath'    : replServerPath,
-                      'backupDir' : changelogBackupDir,
+                      'backupDir' : '%s/replication/changelog_backup' \
+                                         % replServerBackupDir,
                       'backEnd'   : 'replicationChanges'
                     }
                   </call>                    
@@ -499,12 +510,12 @@
                       replServer = server
 
                     serverPath = '%s/%s' % (server.getDir(), OPENDSNAME)
-                    serverDataDir = '%s/%s' % (server.getDir(),remote.reldatadir)
+                    
                     replServerPath = '%s/%s' % (replServer.getDir(), OPENDSNAME)
-                    replServerDataDir = '%s/%s' \
-                      % (replServer.getDir(),remote.reldatadir)
-                    changelogBackupDir = '%s/replication/changelog_backup' \
-                                         % replServerDataDir                     
+
+                    serverBackupDir = '%s' % server.getTmpDir()
+                    replServerDataDir = '%s' % replServer.getDataDir()
+                    replServerBackupDir = '%s' % replServer.getTmpDir()     
                   </script>
 
                   <!-- Restore master_backup -->  
@@ -512,6 +523,7 @@
                     <!-- _topologyServerList[0] corresponds to "master", so
                       no need to copy the files for that case -->
                     <sequence>
+                      <!-- TODO: check what schematokens.dat files are? -->
                       <if expr="os.path.exists
                                 ('%s/config/schematokens.dat' % dsPath)" >
                         <call function="'copyFile'">
@@ -529,7 +541,7 @@
                           'remotehost' : server.getHostname(),
                           'srcfolder'  : masterBackupDir,
                           'destfolder' : '%s/replication/master_backup' \
-                                         % serverDataDir,
+                                         % serverBackupDir,
                           'extension'  : '*'
                         }
                       </call>                      
@@ -539,7 +551,7 @@
                     { 'location'  : server.getHostname(),
                       'dsPath'    : serverPath,
                       'backupDir' : '%s/replication/master_backup' \
-                                    % serverDataDir
+                                    % serverBackupDir
                     }
                   </call>                    
                                                             
@@ -547,7 +559,8 @@
                   <call function="'restore'">
                     { 'location'  : replServer.getHostname(),
                       'dsPath'    : replServerPath,
-                      'backupDir' : changelogBackupDir
+                      'backupDir' : '%s/replication/changelog_backup' \
+                                         % replServerBackupDir
                     }
                   </call>                    
                 </sequence>                  
@@ -751,11 +764,8 @@
                       replServer = server
 
                     replServerPath = '%s/%s' % (replServer.getDir(), OPENDSNAME)
-                    replServerDataDir = '%s/%s' \
-                      % (replServer.getDir(),remote.reldatadir)
-                    changelogBackupDir = \
-                      '%s/replication/changelog_backup_online' \
-                      % replServerDataDir                     
+
+                    replServerBackupDir = '%s' % replServer.getTmpDir()                 
                   </script>
 
                   <call function="'backupTask'">
@@ -766,7 +776,8 @@
                       'dsInstanceDn'   : replServer.getRootDn(),
                       'dsInstancePswd' : replServer.getRootPwd(),
                       'taskID'         : 'changelog backup task',
-                      'backupDir'      : changelogBackupDir,
+                      'backupDir'      : '%s/replication/changelog_backup_online' \
+                                          % replServerBackupDir,
                       'backEnd'        : 'replicationChanges'
                     }
                   </call>
@@ -820,13 +831,12 @@
                       replServer = server
 
                     serverPath = '%s/%s' % (server.getDir(), OPENDSNAME)
-                    serverDataDir = '%s/%s' % (server.getDir(),remote.reldatadir)
+                    
                     replServerPath = '%s/%s' % (replServer.getDir(), OPENDSNAME)
-                    replServerDataDir = '%s/%s' \
-                      % (replServer.getDir(),remote.reldatadir)
-                    changelogBackupDir = \
-                      '%s/replication/changelog_backup_online' \
-                      % replServerDataDir                     
+
+                    serverBackupDir = '%s' % server.getTmpDir()
+                    replServerBackupDir = '%s' % replServer.getTmpDir()
+                   
                   </script>
 
                   <!-- Restore changelog_backup -->
@@ -838,7 +848,8 @@
                       'dsInstanceDn'   : replServer.getRootDn(),
                       'dsInstancePswd' : replServer.getRootPwd(),
                       'taskID'         : 'changelog restore task',
-                      'backupDir'      : changelogBackupDir
+                      'backupDir'      : '%s/replication/changelog_backup_online' \
+                                          % replServerBackupDir
                     }
                   </call>                    
                                         
@@ -864,7 +875,7 @@
                           'remotehost' : server.getHostname(),
                           'srcfolder'  : masterBackupDir,
                           'destfolder' : '%s/replication/master_backup' \
-                                         % serverDataDir,
+                                         % serverBackupDir,
                           'extension'  : '*'
                         }
                       </call>                      
@@ -879,7 +890,7 @@
                       'dsInstancePswd' : server.getRootPwd(),
                       'taskID'         : 'restore task',
                       'backupDir'      : '%s/replication/master_backup' \
-                                         % serverDataDir
+                                         % serverBackupDir
                     }
                   </call>                             
                                                             
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/conflict/conflict.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/conflict/conflict.xml
index 5fecb4e..64457b5 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/conflict/conflict.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/conflict/conflict.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Portions Copyright 2006-2009 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
@@ -77,7 +78,6 @@
             server2Host = server2.getHostname()
             server1Path = '%s/%s' % (server1.getDir(), OPENDSNAME)
             server2Path = '%s/%s' % (server2.getDir(), OPENDSNAME)
-            server2DataDir = '%s/%s' % (server2.getDir(),remote.reldatadir)
             server1name = '%s:%s' % (server1Host, server1.getPort())
             server2name = '%s:%s' % (server2Host, server2.getPort())
             
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/encryption/encryption.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/encryption/encryption.xml
index d1f0a95..49621c2 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/encryption/encryption.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/encryption/encryption.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2007-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
@@ -385,7 +386,7 @@
                
               <script>
                 filename = 'replication_mod_add_binary.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 binaryFilePath = '%s/replication/photo1.uu' % source.data
                 dn = 'uid=hmiller, ou=People,%s' % synchroSuffix
                 modif = 'add'
@@ -396,7 +397,7 @@
 
               <!-- Copy the replication_mod ldif to client host -->
               <message>
-                'Copy %s file from %s to %s' % (filename,local.data,
+                'Copy %s file from %s to %s' % (filename,local.temp,
                                                 clientDataDir)
               </message>
               <call function="'copyFile'">
@@ -488,7 +489,7 @@
                                                
               <script>
                 filename = 'replication_mod_replace_binary.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 binaryFilePath = '%s/replication/photo2.uu' % source.data
                 dn = 'uid=hmiller, ou=People,%s' % synchroSuffix
                 modif = 'replace'
@@ -500,7 +501,7 @@
 
               <!-- Copy the replication_mod ldif to client host -->
               <message>
-                'Copy %s file from %s to %s' % (filename,local.data,
+                'Copy %s file from %s to %s' % (filename,local.temp,
                                                 clientDataDir)
               </message>
               <call function="'copyFile'">
@@ -594,7 +595,7 @@
                     
               <script>
                 filename = 'replication_mod_delete_binary.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 dn = 'uid=hmiller, ou=People,%s' % synchroSuffix
                 modif = 'delete'
                 attrType = 'jpegPhoto'
@@ -605,7 +606,7 @@
 
               <!-- Copy the replication_mod ldif to client host -->
               <message>
-                'Copy %s file from %s to %s' % (filename,local.data,
+                'Copy %s file from %s to %s' % (filename,local.temp,
                                                 clientDataDir)
               </message>
               <call function="'copyFile'">
@@ -692,7 +693,7 @@
                
               <script>
                 filename = 'replication_modrdn.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 dn = 'uid=kvaughan, ou=People,%s' % synchroSuffix
                 newrdn = 'uid=kvaughan2'
                 newsuperior = None
@@ -703,7 +704,7 @@
 
               <!-- Copy the replication_mod ldif to client host -->
               <message>
-                'Copy %s file from %s to %s' % (filename,local.data,
+                'Copy %s file from %s to %s' % (filename,local.temp,
                                                 clientDataDir)
               </message>
               <call function="'copyFile'">
@@ -802,7 +803,7 @@
                
               <script>
                 filename = 'replication_modrdn_preserve.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 dn = 'uid=jwallace, ou=People,%s' % synchroSuffix
                 newrdn = 'uid=igueye'
                 newsuperior = None
@@ -813,7 +814,7 @@
 
               <!-- Copy the replication_mod ldif to client host -->
               <message>
-                'Copy %s file from %s to %s' % (filename,local.data,
+                'Copy %s file from %s to %s' % (filename,local.temp,
                                                 clientDataDir)
               </message>
               <call function="'copyFile'">
@@ -920,7 +921,7 @@
         
               <script>
                 filename = 'replication_moddn.ldif'
-                filePath = '%s/%s' % (local.data,filename)
+                filePath = '%s/%s' % (local.temp,filename)
                 dn = 'ou=People,%s' % synchroSuffix
                 newrdn = 'ou=Special People'
                 newsuperior = 'ou=Special Users,%s' % synchroSuffix
@@ -931,7 +932,7 @@
 
               <!-- Copy the replication_mod ldif to client host -->
               <message>
-                'Copy %s file from %s to %s' % (filename,local.data,
+                'Copy %s file from %s to %s' % (filename,local.temp,
                                                 clientDataDir)
               </message>
               <call function="'copyFile'">
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/failover/failover.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/failover/failover.xml
index a705c73..03afb99 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/failover/failover.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/failover/failover.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2007-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/ldifimport/ldifimport.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/ldifimport/ldifimport.xml
index f8e4966..465b38f 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/ldifimport/ldifimport.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/ldifimport/ldifimport.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2007-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
@@ -131,25 +132,29 @@
               <message>
                 '+++++ ldif import off-line: export suffix on server %s:%s' \
                 % (masterHost, master.getPort())
-              </message>                
+              </message>
               <call function="'exportLdifWithScript'">
                 { 'location'  : masterHost,
                   'dsPath'    : masterPath,
-                  'ldifFile'  : '%s/replication/master_export.ldif' \
-                                % masterDataDir
+                  'ldifFile'  : '%s/replication/master_export_offline.ldif' \
+                                % masterBackupDir
                 }
               </call>
                 
               <!-- Copy export file  to "consumer" servers and import it -->
               <paralleliterate var="consumer" in="consumerList">
                 <sequence>
+                  <script>
+                      consumerDataDir = '%s' % consumer.getDataDir()
+                      consumerBackupDir = '%s' % consumer.getTmpDir()
+                  </script>
                   <call function="'copyFile'">
                     { 'location'   : masterHost,
                       'remotehost' : consumer.getHostname(),
-                      'srcfile'    : '%s/replication/master_export.ldif' \
-                                     % masterDataDir,
-                      'destfile'   : '%s/%s/replication/master_export.ldif' \
-                                     % (consumer.getDir(),remote.reldatadir)
+                      'srcfile'    : '%s/replication/master_export_offline.ldif' \
+                                     % masterBackupDir,
+                      'destfile'   : '%s/replication/master_export_offline.ldif' \
+                                     % consumerBackupDir
                     }
                   </call>
 
@@ -161,14 +166,12 @@
                     { 'location'   : consumer.getHostname(),
                       'dsPath'     : '%s/%s' % (consumer.getDir(), OPENDSNAME),
                       'backEnd'    : DIRECTORY_INSTANCE_BE,
-                      'ldifFile'   : '%s/%s/replication/master_export.ldif' \
-                                     % (consumer.getDir(),remote.reldatadir)
+                      'ldifFile'   : '%s/replication/master_export_offline.ldif' \
+                                     % consumerBackupDir
                     }
                   </call>                                 
                 </sequence>
               </paralleliterate>
-                
-                
 
               <!-- Start the servers in the topology -->
               <call function="'startServers'">
@@ -225,11 +228,8 @@
                 
               <!-- Verify the synchronization of the trees among the servers in
                 the topology -->
-              <!-- If the trees differ, it could be due to Issue 3122
-                (Off-line import-export sequence produces no generationID) -->
               <call function="'verifyTrees'">
-                [ clientHost, clientPath, master, consumerList, synchroSuffix,
-                  '3122' ]
+                [ clientHost, clientPath, master, consumerList, synchroSuffix ]
               </call> 
 
 
@@ -315,7 +315,7 @@
 
               <script>
                 sourceFile = '%s/replication/master_export_online.ldif' \
-                             % masterDataDir
+                             % masterBackupDir
               </script>
                 
               <!-- Export data from  "master" server -->
@@ -338,10 +338,13 @@
               <paralleliterate var="consumer" in="consumerList">
                 <sequence>
                   <script>
-                    filename = 'master_export_online_ldif'
-                    destinationFile = '%s/%s/replication/%s'\
-                                      % (consumer.getDir(),remote.reldatadir,
-                                          filename)
+                    consumerDataDir = '%s' % consumer.getDataDir()
+                    consumerBackupDir = '%s' % consumer.getTmpDir()
+                  </script>
+                  <script>
+                    filename = 'master_export_online.ldif'
+                    destinationFile = '%s/replication/%s'\
+                                      % (consumerBackupDir,filename)
                   </script>
 
                   <call function="'copyFile'">
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/replication_setup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/replication_setup.xml
index 53469ab..6889565 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/replication_setup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/replication_setup.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2007-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
@@ -106,7 +107,6 @@
             client = _topologyServerList[0]
             clientHost = client.getHostname()
             clientPath = '%s/%s' % (client.getDir(),OPENDSNAME)
-            clientDataDir = '%s/%s' % (client.getDir(),remote.reldatadir)
              
             server1 = _topologyServerList[0]
             server2 = _topologyServerList[1]          
@@ -115,9 +115,12 @@
             masterHost = master.getHostname()
             masterReplicationServer = master.getChangelogServer()
             masterPath = '%s/%s' % (master.getDir(),OPENDSNAME)
-            masterDataDir = '%s/%s' % (master.getDir(),remote.reldatadir)
+
+            masterDataDir = '%s' % master.getDataDir()
+            clientDataDir = '%s' % client.getDataDir()
+            masterBackupDir = '%s' % master.getTmpDir()
+
             synchroSuffix = master.getSynchronizedSuffixList()[0].getSuffixDn()
-            masterBackupDir = '%s/replication/master_backup' % masterDataDir
             
             consumerList = _topologyServerList[1:]
               
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/resynchronization/resynchronization.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/resynchronization/resynchronization.xml
index 64e887c..c1647ce 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/resynchronization/resynchronization.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/resynchronization/resynchronization.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2007-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
   <defaultcall function="replication_resynchronization"/>
@@ -102,6 +103,18 @@
                 'Replication: Re-Synchronization: Off-line initialisation. \
                 Initialise replicated servers using off-line backup/restore'
               </message>
+
+              <!-- Backup "master" server -->
+              <message>
+                '+++++ binary copy off-line: back-up server %s:%s' \
+                % (masterHost, master.getPort())
+              </message>
+              <call function="'backup'">
+                { 'location'  : masterHost,
+                  'dsPath'    : masterPath,
+                  'backupDir' : '%s/replication/master_backup' % masterBackupDir
+                }
+              </call>
                              
               <!-- Add entry to "master" server -->
               <message>
@@ -128,12 +141,17 @@
               <!-- Copy master backup to "consumer" servers and restore it -->
               <paralleliterate var="consumer" in="consumerList">
                 <sequence>
+                  <script>
+                    #TODO: Fix me
+                    consumerBackupDir = '%s/%s' % (consumer.getDir(),remote.reldatadir)
+                  </script>
                   <call function="'CopyFolderByExtension'">
                     { 'location'   : masterHost,
                       'remotehost' : consumer.getHostname(),
-                      'srcfolder'  : masterBackupDir,
-                      'destfolder' : '%s/%s/replication/master_backup' \
-                                     % (consumer.getDir(),remote.reldatadir),
+                      'srcfolder'  : '%s/replication/master_backup' \
+                                     % masterBackupDir,
+                      'destfolder' : '%s/replication/master_backup' \
+                                     % consumerBackupDir,
                       'extension'  : '*'
                     }
                   </call>
@@ -145,8 +163,8 @@
                   <call function="'restore'">
                     { 'location'  :  consumer.getHostname(),
                       'dsPath'    :  '%s/%s' % (consumer.getDir(), OPENDSNAME),
-                      'backupDir' :  '%s/%s/replication/master_backup' \
-                                     % (consumer.getDir(),remote.reldatadir)
+                      'backupDir' :  '%s/replication/master_backup' \
+                                     % consumerBackupDir
                     }
                   </call>
                 </sequence>
@@ -255,7 +273,7 @@
                   'dsInstancePswd' : master.getRootPwd(),
                   'taskID'         : 'backup task - tc2',
                   'backupDir'      : '%s/replication/master_backup_online' \
-                                     % masterDataDir
+                                     % masterBackupDir
                 }
               </call>
               
@@ -295,13 +313,17 @@
               <!-- Copy backup to "consumer" servers and restore it -->
               <paralleliterate var="consumer" in="consumerList">
                 <sequence>
+                  <script>
+                    #TODO: Fix me
+                    consumerBackupDir = '%s/%s' % (consumer.getDir(),remote.reldatadir)
+                  </script>
                   <call function="'CopyFolderByExtension'">
                     { 'location'   : masterHost,
                       'remotehost' : consumer.getHostname(),
                       'srcfolder'  : '%s/replication/master_backup_online' \
-                                     % masterDataDir,
-                      'destfolder' : '%s/%s/replication/master_backup_online' \
-                                     % (consumer.getDir(),remote.reldatadir),
+                                     % masterBackupDir,
+                      'destfolder' : '%s/replication/master_backup_online' \
+                                     % consumerBackupDir,
                       'extension'  : '*'
                     }
                   </call>
@@ -318,8 +340,8 @@
                       'dsInstanceDn'   : consumer.getRootDn(),
                       'dsInstancePswd' : consumer.getRootPwd(),
                       'taskID'         : 'restore task - tc2',
-                      'backupDir'   : '%s/%s/replication/master_backup_online' \
-                                      % (consumer.getDir(),remote.reldatadir)
+                      'backupDir'   : '%s/replication/master_backup_online' \
+                                      % consumerBackupDir
                     }
                   </call>
                 </sequence>
@@ -493,7 +515,7 @@
                   'dsInstancePswd' : master.getRootPwd(),
                   'taskID'         : 'backup task - tc3',
                   'backupDir'      : '%s/replication/master_backup_online' \
-                                     % masterDataDir
+                                     % masterBackupDir
                 }
               </call>
 
@@ -717,13 +739,17 @@
               </paralleliterate>
               
               <!-- Copy backup to new server and restore it -->
+              <script>
+                #TODO: Fix me
+                server3BackupDir = '%s/%s' % (server3.getDir(),remote.reldatadir)
+              </script>
               <call function="'CopyFolderByExtension'">
                 { 'location'   : masterHost,
                   'remotehost' : server3.getHostname(),
                   'srcfolder'  : '%s/replication/master_backup_online' \
-                                 % masterDataDir,
-                  'destfolder' : '%s/%s/replication/master_backup_online' \
-                                 % (server3.getDir(),remote.reldatadir),
+                                 % masterBackupDir,
+                  'destfolder' : '%s/replication/master_backup_online' \
+                                 % server3BackupDir,
                   'extension'  : '*'
                 }
               </call>
@@ -740,8 +766,8 @@
                   'dsInstanceDn'   : server3.getRootDn(),
                   'dsInstancePswd' : server3.getRootPwd(),
                   'taskID'         : 'restore task - tc3',
-                  'backupDir'      : '%s/%s/replication/master_backup_online' \
-                                     % (server3.getDir(),remote.reldatadir)
+                  'backupDir'      : '%s/replication/master_backup_online' \
+                                     % server3BackupDir
                 }
               </call>
               
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/schema/schema.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/schema/schema.xml
index c6cb294..c648ed4 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/schema/schema.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/schema/schema.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2007-2008 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
 
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/structure/schema_structure.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/structure/schema_structure.xml
index 26b98b2..c65925c 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/structure/schema_structure.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/structure/schema_structure.xml
@@ -23,7 +23,7 @@
  !
  ! CDDL HEADER END
  !
- !      Copyright 2011 ForgeRock AS
+ !      Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
   <defaultcall function="main_schema_structure"/>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v3_customconf.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v3_customconf.xml
index 06dda94..99ad627 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v3_customconf.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v3_customconf.xml
@@ -58,7 +58,7 @@
             defSecurityFileProp = SNMP_PROPERTIES['security-agent-file']
             defSecurityLevelProp = SNMP_PROPERTIES['security-level']
             newContextProp = 'myContext'
-            newSecurityFileProp = '%s/snmp/agent.security' % remote.data
+            newSecurityFileProp = '%s/snmp/agent.security' % remote.temp
             lowUser = 'myUser1'
             defUser = 'myUser2'
             highUser = 'myUser3'
@@ -66,7 +66,7 @@
             lowSecurityLevelProp = 'noauthnopriv'
             highSecurityLevelProp = 'authpriv'
             wrongSecurityLevelProp = 'mySecurityLevel'
-            mySecurityFile = '%s/snmp/manager.security' % remote.data
+            mySecurityFile = '%s/snmp/manager.security' % remote.temp
             oid = 'dsServerType.1'
           </script>
 
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml
index a9b7675..a0d7944 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2007-2009 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
 ! -->
 <stax>
   <defaultcall function="restore_db"/>
@@ -75,7 +76,7 @@
                 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                 'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
                 'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD,
-                'backupDir'           : '%s/tasks/backup_synchronous' % remote.data,
+                'backupDir'           : '%s/tasks/backup_synchronous' % remote.temp,
                 'backupID'            : 'recurring-restore-1',
                 'backEnd'             : DIRECTORY_INSTANCE_BE}
               </call>
@@ -106,7 +107,7 @@
                 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                 'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
                 'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD,
-                'backupDir'           : '%s/tasks/backup_synchronous' % remote.data,
+                'backupDir'           : '%s/tasks/backup_synchronous' % remote.temp,
                 'startTask'           : '0'}
               </call>
               
@@ -140,7 +141,7 @@
                 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                 'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
                 'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD,
-                'backupDir'           : '%s/tasks/backup_synchronous' % remote.data}
+                'backupDir'           : '%s/tasks/backup_synchronous' % remote.temp}
               </call>
   
               <script>checkRC=9999</script>
@@ -225,7 +226,7 @@
                 'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
                 'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD,
                 'startTask'           : '%s' % mydate,
-                'backupDir'           : '%s/tasks/backup_synchronous' % remote.data
+                'backupDir'           : '%s/tasks/backup_synchronous' % remote.temp
                 }
               </call>
       
@@ -278,7 +279,7 @@
                 'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
                 'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD,
                 'schedulePattern'     : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
-                'backupDir'           : '%s/tasks/backup_synchronous' % remote.data,
+                'backupDir'           : '%s/tasks/backup_synchronous' % remote.temp,
                 'backupID'            : 'recurring-restore-1'}
               </call>
   
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/functions/dsadm.xml b/opendj-sdk/opends/tests/staf-tests/shared/functions/dsadm.xml
index 15d5d04..cff058d 100755
--- a/opendj-sdk/opends/tests/staf-tests/shared/functions/dsadm.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/functions/dsadm.xml
@@ -1224,7 +1224,9 @@
           <message>'Expected number of entries is %s' % expectedNoEntries</message>
 
           <call function="'ldapSearchWithScript'">
-            { 'dsInstanceHost' : myhost ,
+            { 'location'       : myLocation ,
+              'dsPath'         : myPath,
+              'dsInstanceHost' : myhost ,
               'dsInstancePort' : myport ,
               'dsInstanceDn'   : mydn ,
               'dsInstancePswd' : mypswd ,
@@ -1253,7 +1255,9 @@
       <iterate var="expectedEntry" in="expectedEntries">
         <sequence>
           <call function="'ldapSearchWithScript'">
-            { 'dsInstanceHost' : myhost ,
+            { 'location'       : myLocation ,
+              'dsPath'         : myPath,
+              'dsInstanceHost' : myhost ,
               'dsInstancePort' : myport ,
               'dsInstanceDn'   : mydn ,
               'dsInstancePswd' : mypswd ,
@@ -1705,6 +1709,9 @@
           STAFCmd='%s/backup%s' % (dsBinPath,fileExt)
          
         if backupDir:
+          if not os.path.exists(os.path.dirname(backupDir)):
+            os.makedirs(os.path.dirname(backupDir))
+
           STAFCmdParamsList.append('-d %s' % backupDir)    
 
        if backEnd:
@@ -1877,6 +1884,9 @@
       
       <!-- Build the backup task configuration object -->
       <script>
+        if not os.path.exists(os.path.dirname(backupDir)):
+          os.makedirs(os.path.dirname(backupDir))
+
         ldifLines=[]
         ldifLines.append('dn: %s' % taskDN)
         ldifLines.append('objectclass: top')
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/functions/environment.xml b/opendj-sdk/opends/tests/staf-tests/shared/functions/environment.xml
index 98fa45a..500e0fc 100755
--- a/opendj-sdk/opends/tests/staf-tests/shared/functions/environment.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/functions/environment.xml
@@ -377,14 +377,21 @@
         logs   = test_env.logs(localDir)
         source = test_env.source(sourceDir,TESTS_TYPE)
         local  = test_env.data(localDir)
-        remote = test_env.data(remoteDir)                
+        remote = test_env.data(remoteDir)
+
+        if host_is_localhost(STAF_REMOTE_HOSTNAME):
+          local.set_data(source.data)
+          remote.set_data(source.data)
       </script>
 
       <message>'source.directory = %s' % source.directory</message>
       <message>'local.directory  = %s' % local.directory</message>
       <message>'remote.directory = %s' % remote.directory</message>
       <message>'logs.directory   = %s' % logs.directory</message>
-                  
+      <message>'source.data      = %s' % source.data</message>
+      <message>'local.data       = %s' % local.data</message>
+      <message>'remote.data      = %s' % remote.data</message>
+                        
       <return>
         local.directory
       </return>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/functions/stafcmd.xml b/opendj-sdk/opends/tests/staf-tests/shared/functions/stafcmd.xml
index 0e4a90c..1ff6df1 100755
--- a/opendj-sdk/opends/tests/staf-tests/shared/functions/stafcmd.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/functions/stafcmd.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Copyright 2007-2009 Sun Microsystems, Inc.
+ !      Portions Copyright 2011 ForgeRock AS.
  ! -->
 <stax>
   <function name="copyFile">
@@ -57,6 +58,21 @@
       </function-arg-def>
     </function-map-args>
     <sequence>
+      <message>
+        'Copy file %s:%s to %s:%s.' \
+        % (location,srcfile,remotehost,destfile)
+      </message>
+
+      <script>
+        destfolder = os.path.dirname(destfile)
+      </script>
+      
+      <call function="'createFolder'">
+        { 'location'   : location,
+          'foldername' : '%s' % destfolder
+        }
+      </call>      
+
       <stafcmd name="'STAF Command: Copy File'">
         <location>'%s' % location</location>
         <service>'fs'</service>
@@ -111,10 +127,17 @@
       </function-arg-def>
     </function-map-args>
     <sequence>
+      <message>
+        'Copy all %s Files from %s:%s to %s:%s.' \
+        % (extension,location,srcfolder,remotehost,destfolder)
+      </message>
       <stafcmd name="'STAF Command: Copy all %s Files.' % (extension)">
         <location>'%s' % location</location>
         <service>'fs'</service>
-        <request>'COPY DIRECTORY %s TODIRECTORY %s TOMACHINE %s EXT %s RECURSE' % (srcfolder,destfolder,remotehost,extension) </request>
+        <request>
+          'COPY DIRECTORY %s TODIRECTORY %s TOMACHINE %s EXT %s RECURSE' \
+          % (srcfolder,destfolder,remotehost,extension)
+        </request>
       </stafcmd>
       <script>
         cmdRC=RC
@@ -159,6 +182,10 @@
       </function-arg-def>
     </function-map-args>
     <sequence>
+      <message>
+        'Copy folder %s:%s to %s:%s.' \
+        % (location,srcfolder,remotehost,destfolder)
+      </message>
       <stafcmd name="'STAF Command: Copy %s folder to %s.' % (srcfolder,destfolder)">
         <location>'%s' % location</location>
         <service>'fs'</service>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/functions/topology.xml b/opendj-sdk/opends/tests/staf-tests/shared/functions/topology.xml
index 6295db0..f99ef81 100755
--- a/opendj-sdk/opends/tests/staf-tests/shared/functions/topology.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/functions/topology.xml
@@ -128,7 +128,7 @@
             <if expr="splitReplicationServers">
               <sequence>
                 <message>
-                  'Replication servers will be splitted from ldap servers.'
+                  'Replication servers will be split from ldap servers.'
                 </message>
                 <iterate var="server" in="_topologyServerList" indexvar="i">
                   <sequence>
@@ -225,7 +225,8 @@
         
       <!-- Stage static data-->
       <call function="'stageStaticDataFiles'">
-        { 'customFileExtensions' : fileExtensions }
+        { 'customFileExtensions' : fileExtensions,
+          'testGroupDirName'     : groupDataDir }
       </call>
 
       <!-- Stage (*/.java) files -->
@@ -1412,7 +1413,7 @@
             changelogList.append( line[line.find('ChangelogServer') + 16:].strip() )
           elif (line.isspace()) or (len(line) == 0):
             server = Server(hostname, dir, port, adminport, sslport, jmxport,
-                            rootDn, rootPwd, baseDn)
+                            rootDn, rootPwd, baseDn, remote.data)
             
             if changelogport != None:
               changelogServer = ChangelogServer(changelogport, serverId)
@@ -1448,7 +1449,7 @@
         
         if hostname != None:
           server = Server(hostname, dir, port, adminport, sslport, jmxport,
-                          rootDn, rootPwd, baseDn)
+                          rootDn, rootPwd, baseDn, remote.data)
           
           if changelogport != None:
             changelogServer = ChangelogServer(changelogport, serverId)
@@ -2691,10 +2692,40 @@
         </function-arg-description>
         <function-arg-property name="type" value="string"/>     
       </function-arg-def>
+      <function-arg-def name="testGroupDirName" 
+                        type="optional" 
+                        default="''">
+        <function-arg-description>
+          Name of the test group directory that holds the 
+          static data files
+        </function-arg-description>
+        <function-arg-property name="type" value="string"/>     
+      </function-arg-def>
 
     </function-map-args>   
     <sequence>
 
+      <!-- If remote host is local loopback then no need to stage static data files -->
+      <script>
+        from socket import gethostbyname
+      </script>
+
+      <if expr="host_is_localhost(STAF_REMOTE_HOSTNAME)">
+        <sequence>
+          <message>
+            'Not staging static data files as remote host %s (%s) is local.' % (STAF_REMOTE_HOSTNAME,gethostbyname(STAF_REMOTE_HOSTNAME))
+          </message>
+          <message>'Will creating stub folder in testdata.'</message>
+          <call function="'createStubFolders'"/>
+          <return>0</return>
+        </sequence>
+        <else>
+          <message>
+            'Remote host %s (%s) is not local.' % (STAF_REMOTE_HOSTNAME,gethostbyname(STAF_REMOTE_HOSTNAME))
+          </message>
+        </else>
+      </if>
+
       <!-- Check to see if local tests static data directory is already created-->        
       <call function="'GetEntry'">
         { 'location'  : STAXServiceMachine,
@@ -3076,6 +3107,24 @@
           </sequence>
         </if>
      </sequence>
-    </function>  
+    </function>
+  
+  <function name="createStubFolders">
+    <function-prolog>
+      This function creates some stub folders in testdata
+    </function-prolog>    
+    <function-no-args/>     
+      <sequence>
+
+      <message>
+        'Create folder %s/data on host %s' % (local.directory,STAF_LOCAL_HOSTNAME)
+      </message>
+      <call function="'createFolder'">
+        { 'location'   : STAF_LOCAL_HOSTNAME,
+          'foldername' : '%s/data' % local.directory
+        }
+      </call>
+      </sequence>
+    </function>
               
 </stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/functions/utils.xml b/opendj-sdk/opends/tests/staf-tests/shared/functions/utils.xml
index f0e831b..6efbd6c 100755
--- a/opendj-sdk/opends/tests/staf-tests/shared/functions/utils.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/functions/utils.xml
@@ -4098,6 +4098,9 @@
           STAFCmdParamsList.append('-l')
 
         if outputFile:
+          if not os.path.exists(os.path.dirname(outputFile)):
+            os.makedirs(os.path.dirname(outputFile))
+
           STAFCmdParamsList.append('-f %s' % outputFile)
 
         if nbrOfThread:
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/python/common.py b/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
index b3b3f41..4ac4b0e 100644
--- a/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
+++ b/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
@@ -53,7 +53,8 @@
             "group_to_run" ,
             "get_last_attr_from_entry" ,
             "list_matches" ,
-            "count_attr" ]
+            "count_attr" ,
+            "host_is_localhost"]
 
 class format_testcase:
   'Format the Test name objects'
@@ -531,7 +532,7 @@
     'Container to hold local and remote test data instance objects'
     def __init__(self,dir):
       self.directory=dir
-      self.testdata='%s/testdata' % dir
+      self.testdata='%s/testdata' % dir      
       self.java='%s/java' % self.testdata
       self.data='%s/data' % self.testdata
       self.temp='%s/temp'  % dir
@@ -559,6 +560,9 @@
     def get_reljavadir(self):
       return self.directory
 
+    def set_data(self,dir):
+      self.data=dir
+
 def get_test_name(name):
   i=2
   __name=''
@@ -796,3 +800,18 @@
 
   return attrnum
 
+def host_is_localhost(hostname):
+  from socket import gethostbyname
+  if gethostbyname(hostname).startswith('127.0'):
+    return 1
+  else:
+    return 0
+  
+def hosts_are_same(hostname1,hostname2):
+  from socket import gethostbyname
+  if hostname1 == hostname2:
+    return 1
+  else:
+    return 0
+  
+
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/python/replication.py b/opendj-sdk/opends/tests/staf-tests/shared/python/replication.py
index 2117455..d292014 100644
--- a/opendj-sdk/opends/tests/staf-tests/shared/python/replication.py
+++ b/opendj-sdk/opends/tests/staf-tests/shared/python/replication.py
@@ -24,6 +24,7 @@
 #
 #
 #      Copyright 2008 Sun Microsystems, Inc.
+#      Portions Copyright 2011 ForgeRock AS.
 
 
 
@@ -76,9 +77,14 @@
 	    
 # Define Server class
 class Server:
-  def __init__(self, hostname, dir, port, adminPort, sslPort, jmxPort, rootDn, rootPwd, baseDn):
+  def __init__(self, hostname, dir, port, adminPort, sslPort, jmxPort, rootDn, rootPwd, baseDn, datadir):
     self.hostname = hostname
     self.dir = dir
+    self.temp = '%s/temp' % dir
+    if self.hostIsLocal(self.hostname):
+      self.data = datadir
+    else:
+      self.data = '%s/testdata/data' % self.dir
     self.port = port
     self.adminPort = adminPort
     self.sslPort = sslPort
@@ -100,9 +106,15 @@
 
   def getHostname(self):
     return self.hostname
-
+  
   def getDir(self):
     return self.dir
+  
+  def getTmpDir(self):
+    return self.temp
+
+  def getDataDir(self):
+    return self.data
 
   def getPort(self):
     return self.port
@@ -159,7 +171,12 @@
 
     return replServer
 
-
+  def hostIsLocal(self,hostname):
+    from socket import gethostbyname
+    if gethostbyname(hostname).startswith('127.0'):
+      return 1
+    else:
+      return 0
 
 
 

--
Gitblit v1.10.0