From 84adb34c0da050c5774cb48cee4bb2dda61ef2f1 Mon Sep 17 00:00:00 2001
From: ugaston <ugaston@localhost>
Date: Wed, 05 Sep 2007 10:11:52 +0000
Subject: [PATCH] Extend schema replication testsuite

---
 opends/tests/functional-tests/shared/data/replication/schemamods-2.ldif  |    5 
 opends/tests/functional-tests/shared/data/replication/newtestuser-2.ldif |    9 
 opends/tests/functional-tests/shared/data/replication/schemamods-3.ldif  |    8 
 opends/tests/functional-tests/shared/data/replication/testuser-2.ldif    |    9 
 opends/tests/functional-tests/shared/data/replication/newtestuser-1.ldif |   10 +
 opends/tests/functional-tests/testcases/replication/schema/schema.xml    |  413 ++++++++++++++++++++++++++++++++++++++++
 opends/tests/functional-tests/shared/data/replication/schemamods-0.ldif  |    5 
 opends/tests/functional-tests/shared/data/replication/newtestuser-0.ldif |    8 
 opends/tests/functional-tests/shared/data/replication/schemamods-1.ldif  |    8 
 opends/tests/functional-tests/shared/functions/tools.xml                 |  123 +++++++++++-
 10 files changed, 582 insertions(+), 16 deletions(-)

diff --git a/opends/tests/functional-tests/shared/data/replication/newtestuser-0.ldif b/opends/tests/functional-tests/shared/data/replication/newtestuser-0.ldif
new file mode 100644
index 0000000..f0f06ab
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/replication/newtestuser-0.ldif
@@ -0,0 +1,8 @@
+dn: cn=newtestuser-0,ou=people,o=example
+objectclass: top
+objectclass: person
+objectclass: newtestobjectclass-0
+cn: newtestuser-0
+sn: New Test
+c: New Testland
+street: New Test Lane
diff --git a/opends/tests/functional-tests/shared/data/replication/newtestuser-1.ldif b/opends/tests/functional-tests/shared/data/replication/newtestuser-1.ldif
new file mode 100644
index 0000000..745e43d
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/replication/newtestuser-1.ldif
@@ -0,0 +1,10 @@
+dn: cn=newtestuser-1,ou=people,o=example
+objectclass: top
+objectclass: person
+objectclass: newtestobjectclass-1
+cn: newtestuser-1
+sn: New Test
+c: New Testland
+street: New Test Lane
+newtestattribute-1: new test attribute
+
diff --git a/opends/tests/functional-tests/shared/data/replication/newtestuser-2.ldif b/opends/tests/functional-tests/shared/data/replication/newtestuser-2.ldif
new file mode 100644
index 0000000..7ff5d89
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/replication/newtestuser-2.ldif
@@ -0,0 +1,9 @@
+dn: cn=newtestuser-2,ou=people,o=example
+objectclass: top
+objectclass: person
+objectclass: newtestobjectclass-1
+cn: newtestuser-2
+sn: New Test
+c: New Testland
+street: New Test Lane
+
diff --git a/opends/tests/functional-tests/shared/data/replication/schemamods-0.ldif b/opends/tests/functional-tests/shared/data/replication/schemamods-0.ldif
new file mode 100644
index 0000000..a06053e
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/replication/schemamods-0.ldif
@@ -0,0 +1,5 @@
+dn: cn=schema
+changetype: modify
+add: objectClasses
+objectClasses: ( newtestobjectclass-oid NAME 'newtestobjectclass-0' SUP person MUST ( street $ c ) X-ORIGIN 'user defined' )
+
diff --git a/opends/tests/functional-tests/shared/data/replication/schemamods-1.ldif b/opends/tests/functional-tests/shared/data/replication/schemamods-1.ldif
new file mode 100644
index 0000000..d888d8d
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/replication/schemamods-1.ldif
@@ -0,0 +1,8 @@
+dn: cn=schema
+changetype: modify
+add: attributeTypes
+attributeTypes: ( newtestattribute1-oid NAME 'newtestattribute-1' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'user defined' )
+-
+add: objectClasses
+objectClasses: ( newtestobjectclass1-oid NAME 'newtestobjectclass-1' SUP person MAY ( street $ newtestattribute-1 $ c ) X-ORIGIN 'user defined' )
+
diff --git a/opends/tests/functional-tests/shared/data/replication/schemamods-2.ldif b/opends/tests/functional-tests/shared/data/replication/schemamods-2.ldif
new file mode 100644
index 0000000..4a4fb1e
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/replication/schemamods-2.ldif
@@ -0,0 +1,5 @@
+dn: cn=schema
+changetype: modify
+delete: objectClasses
+objectClasses: ( newtestobjectclass-oid NAME 'newtestobjectclass-0' SUP person MUST ( street $ c ) X-ORIGIN 'user defined' )
+
diff --git a/opends/tests/functional-tests/shared/data/replication/schemamods-3.ldif b/opends/tests/functional-tests/shared/data/replication/schemamods-3.ldif
new file mode 100644
index 0000000..e998e94
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/replication/schemamods-3.ldif
@@ -0,0 +1,8 @@
+dn: cn=schema
+changetype: modify
+delete: objectClasses
+objectClasses: ( newtestobjectclass1-oid NAME 'newtestobjectclass-1' SUP person MAY ( street $ newtestattribute-1 $ c ) X-ORIGIN 'user defined' )
+-
+add: objectClasses
+objectClasses: ( newtestobjectclass1-oid NAME 'newtestobjectclass-1' SUP person MUST ( street $ newtestattribute-1 $ c ) X-ORIGIN 'user defined' )
+
diff --git a/opends/tests/functional-tests/shared/data/replication/testuser-2.ldif b/opends/tests/functional-tests/shared/data/replication/testuser-2.ldif
new file mode 100644
index 0000000..772912e
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/replication/testuser-2.ldif
@@ -0,0 +1,9 @@
+dn: cn=testuser-2,ou=people,o=example
+objectclass: top
+objectclass: person
+objectclass: testobjectclass-1
+cn: testuser-2
+sn: Test
+c: Testland
+street: Test Lane
+
diff --git a/opends/tests/functional-tests/shared/functions/tools.xml b/opends/tests/functional-tests/shared/functions/tools.xml
index ec04e52..e9fa871 100644
--- a/opends/tests/functional-tests/shared/functions/tools.xml
+++ b/opends/tests/functional-tests/shared/functions/tools.xml
@@ -35,7 +35,7 @@
     <function-map-args>
       <function-arg-def name="location"
                         type="optional"
-                        default="STAXServiceMachine">
+                        default="STAF_REMOTE_HOSTNAME">
         <function-arg-description>
           Location of target host
         </function-arg-description>
@@ -135,7 +135,7 @@
   </function> 
   
   
-  <!-- This function starts DS using the start-ds script -->
+  <!-- This function compares two LDIF files using the ldif-diff script -->
   <function name="LdifDiffWithScript">
     <function-prolog>
       This function  compares two LDIF files and reports the differences in LDIF format
@@ -143,7 +143,7 @@
     <function-map-args>
       <function-arg-def name="location"
                         type="optional"
-                        default="STAXServiceMachine">
+                        default="STAF_REMOTE_HOSTNAME">
         <function-arg-description>
           Location of target host
         </function-arg-description>
@@ -272,7 +272,106 @@
     </sequence>
   </function>
   
-  
+
+
+  <!-- This function modifies an LDIF file using ldifmodify script -->
+  <function name="LdifModifyWithScript">
+    <function-prolog>
+      This function modifies an LDIF file with the changes contained in another LDIF file
+    </function-prolog>
+    <function-map-args>
+      <function-arg-def name="location"
+                        type="optional"
+                        default="STAF_REMOTE_HOSTNAME">
+        <function-arg-description>
+          Location of target host
+        </function-arg-description>
+        <function-arg-property name="type" value="hostname"/>
+      </function-arg-def>
+      
+      <function-arg-def name="dsPath"
+                       type="optional"
+                       default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
+        <function-arg-description>
+          Pathname to installation root
+        </function-arg-description>
+        <function-arg-property name="type" value="filepath"/>
+      </function-arg-def>
+      
+      <function-arg-def name="version" type="optional">
+        <function-arg-description>
+          Display Directory Server version information
+        </function-arg-description>
+        <function-arg-property name="type" value="string"/>
+      </function-arg-def>
+      
+      <function-arg-def name="sourceLdif" type="required">
+        <function-arg-description>
+          LDIF file containing the data to be updated
+        </function-arg-description>
+        <function-arg-property name="type" value="filepath"/>
+      </function-arg-def>
+      
+      <function-arg-def name="targetLdif" type="required">
+        <function-arg-description>
+          LDIF file that will contain the updated data
+        </function-arg-description>
+        <function-arg-property name="type" value="filepath"/>
+      </function-arg-def>
+      
+      <function-arg-def name="changesLdif" type="required">
+        <function-arg-description>
+          LDIF file containing the changes to apply
+        </function-arg-description>
+        <function-arg-property name="type" value="filepath"/>
+      </function-arg-def>      
+      
+      <function-arg-def name="Help" type="optional">
+        <function-arg-description>
+          Help option
+        </function-arg-description>
+        <function-arg-property name="help" value="option"/>
+      </function-arg-def>
+    </function-map-args>
+    <sequence>
+      <!-- Build the Command -->
+      <script>
+        STAFCmdParamsList=[]
+        STAFCmdParams=''
+        
+        if dsPath:
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/ldifmodify%s' % (dsBinPath,fileExt)
+        
+        if version:
+          STAFCmdParamsList.append('-V')
+        
+        if sourceLdif:
+          STAFCmdParamsList.append('-s %s' % sourceLdif)
+        
+        if targetLdif:
+          STAFCmdParamsList.append('-t %s' % targetLdif)
+        
+        if changesLdif:
+          STAFCmdParamsList.append('-m %s' % changesLdif)
+
+        if Help:
+          STAFCmdParamsList.append('-H')
+        
+        STAFCmdParams=' '.join(STAFCmdParamsList)
+      </script>
+      <call function="'runCommand'">
+        { 'name'      : 'LDIF Modify Script',
+          'location'  : location,
+          'command'   : STAFCmd,
+          'arguments' : STAFCmdParams,
+        }
+      </call>
+      <return>STAXResult</return>
+    </sequence>
+  </function>
+
+                      
   <function name="verifyTrees">
     <function-prolog>
       This function verifies that the trees in a group of ldap servers are synchronized.
@@ -280,7 +379,7 @@
     <function-list-args>
       <function-arg-def name="location"
                         type="optional"
-                        default="STAXServiceMachine">
+                        default="STAF_REMOTE_HOSTNAME">
         <function-arg-description>
           Location of target host
         </function-arg-description>
@@ -394,9 +493,9 @@
           failingServerList = 'List of non-synchronized servers (tree verify FAILED): %s ' % comma.join(failedServers)
         </script>
         <else>
-          <script>
-            failingServerList = 'All servers synchronized (tree verify SUCCEEDED).'
-          </script>
+          <message>
+            'All servers synchronized (tree verify SUCCEEDED).'
+          </message>
         </else>
       </if>
       <call function="'checktestRC'">
@@ -417,7 +516,7 @@
     <function-list-args>
       <function-arg-def name="location"
                         type="optional"
-                        default="STAXServiceMachine">
+                        default="STAF_REMOTE_HOSTNAME">
         <function-arg-description>
           Location of target host
         </function-arg-description>
@@ -506,9 +605,9 @@
           failingServerList = 'List of non-synchronized servers (schema verify FAILED): %s ' % comma.join(failedServers)
         </script>
         <else>
-          <script>
-            failingServerList = 'All servers synchronized (schema verify SUCCEEDED).'
-          </script>
+          <message>
+            'All servers synchronized (schema verify SUCCEEDED).'
+          </message>
         </else>
       </if>
       <call function="'checktestRC'">
diff --git a/opends/tests/functional-tests/testcases/replication/schema/schema.xml b/opends/tests/functional-tests/testcases/replication/schema/schema.xml
index b54d7cc..ee46d9c 100644
--- a/opends/tests/functional-tests/testcases/replication/schema/schema.xml
+++ b/opends/tests/functional-tests/testcases/replication/schema/schema.xml
@@ -41,7 +41,7 @@
             if not CurrentTestPath.has_key('group'):
               CurrentTestPath['group']='replication'                 
             CurrentTestPath['suite']=STAXCurrentBlock
-          </script>
+          </script>            
 
           <call function="'testSuite_Preamble'"/>
 
@@ -63,6 +63,9 @@
           <script>
             synchroSuffix = master.getSynchronizedSuffixList()[0].getSuffixDn()    
             replServerList = master.getSynchronizedSuffixList()[0].getChangelogServerList()
+            
+            currentSchemaFile = '%s/config/schema/99-user.ldif' % masterPath
+            provSchemaFile = '%s/../last-99-user.ldif' % masterPath                            
           </script>            
             
           <iterate var="server" in="_topologyServerList" indexvar="i">
@@ -116,7 +119,7 @@
               </call>                     
                                 
               <script>
-                newObjectclass = '( testobjectclass-oid NAME \'testobjectclass-0\'  SUP person MAY ( street $  c ) X-ORIGIN \'user defined\' )'
+                newObjectclass = '( testobjectclass-oid NAME \'testobjectclass-0\' SUP person MAY ( street $ c ) X-ORIGIN \'user defined\' )'
               </script>
                 
               <!-- Modify schema  in "master" server -->
@@ -178,7 +181,7 @@
               </message>
                                 
               <script>
-                newObjectclass = '( testobjectclass1-oid NAME \'testobjectclass-1\'  SUP person MAY ( street $ testattribute-1 $  c ) X-ORIGIN \'user defined\' )'
+                newObjectclass = '( testobjectclass1-oid NAME \'testobjectclass-1\' SUP person MAY ( street $ testattribute-1 $ c ) X-ORIGIN \'user defined\' )'
                 newAttributetype = '( testattribute1-oid NAME \'testattribute-1\' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN \'user defined\' )'
               </script>
                 
@@ -251,7 +254,7 @@
               </message>
                                 
               <script>
-                newObjectclass = '( testobjectclass-oid NAME \'testobjectclass-0\'  SUP person MAY ( street $  c ) X-ORIGIN \'user defined\' )'
+                newObjectclass = '( testobjectclass-oid NAME \'testobjectclass-0\' SUP person MAY ( street $ c ) X-ORIGIN \'user defined\' )'
               </script>
                 
               <!-- Modify schema  in "master" server -->
@@ -267,6 +270,18 @@
                   'changetype' : 'delete' }
               </call>
 
+              <!-- Delete previously added entry -->
+              <call function="'ldapDeleteWithScript'">
+                { 'location'       :  clientHost,
+                  'dsPath'         :  clientPath,
+                  'dsInstanceHost' :  master.getHostname(),
+                  'dsInstancePort' :  master.getPort(),
+                  'dsInstanceDn'   : master.getRootDn(),
+                  'dsInstancePswd' :  master.getRootPwd(),
+                  'dsDn'           :  ['cn=testuser-0,ou=People,%s' % synchroSuffix]
+                }
+              </call>
+                                
               <!-- Try to add entry to servers; should be rejected with error 65 (objectclass violation) -->
               <iterate var="server" in="_topologyServerList">
                 <call function="'addEntry'">
@@ -295,6 +310,396 @@
             </sequence>
           </testcase>                                                                     
  
+
+
+          <!-- Test Case information
+          #@TestMarker          Replication Schema Replication Tests
+          #@TestName            Replication: Schema Replication: Modify objectclass
+          #@TestID                  Modify objectclass
+          #@TestPurpose        Check schema replication when an objectclass is modified
+          #@TestPreamble
+          #@TestSteps
+          #@TestPostamble
+          #@TestResult
+          -->                    
+          <testcase name="getTestCaseName('Modify objectclass')">
+            <sequence>            
+              <call function="'testCase_Preamble'"/>
+              <message>
+                 'Replication: Schema Replication: Modify objectclass Check schema replication when an objectclass is modified'
+              </message>
+                                
+              <script>       
+                oldObjectclass = '( testobjectclass1-oid NAME \'testobjectclass-1\' SUP person MAY ( street $ testattribute-1 $ c ) X-ORIGIN \'user defined\' )'                             
+                newObjectclass = '( testobjectclass1-oid NAME \'testobjectclass-1\' SUP person MUST ( street $ testattribute-1 $ c ) X-ORIGIN \'user defined\' )'
+              </script>
+                
+              <!-- Modify schema  in "master" server -->
+              <call function="'modifyAnAttribute'">
+                { 'dsPath' : masterPath,
+                  'dsInstanceHost'   : masterHost ,
+                  'dsInstancePort'    : master.getPort(),
+                  'dsInstanceDn'  : master.getRootDn(),
+                  'dsInstancePswd'    : master.getRootPwd(),
+                  'DNToModify'    : 'cn=schema',
+                  'attributeName' : 'objectClasses',
+                  'newAttributeValue' : oldObjectclass, 
+                  'changetype' : 'delete' }
+              </call>                
+              <call function="'modifyAnAttribute'">
+                { 'dsPath' : masterPath,
+                  'dsInstanceHost'   : masterHost ,
+                  'dsInstancePort'    : master.getPort(),
+                  'dsInstanceDn'  : master.getRootDn(),
+                  'dsInstancePswd'    : master.getRootPwd(),
+                  'DNToModify'    : 'cn=schema',
+                  'attributeName' : 'objectClasses',
+                  'newAttributeValue' : newObjectclass, 
+                  'changetype' : 'add' }
+              </call>
+                                
+              <!-- Try to add entry to servers; should be rejected with error 65 (objectclass violation) -->
+              <iterate var="server" in="_topologyServerList">
+                <call function="'addEntry'">
+                  { 'location'       : clientHost,
+                    'dsPath'         : clientPath,
+                    'dsInstanceHost' : server.getHostname(),
+                    'dsInstancePort' : server.getPort(), 
+                    'dsInstanceDn'   : server.getRootDn(),
+                    'dsInstancePswd' : server.getRootPwd(),
+                    'entryToBeAdded' : '%s/replication/testuser-2.ldif' % clientDataDir,
+                    'expectedRC' : 65 }
+                </call>                             
+              </iterate> 
+                       
+              <!-- Verify the synchronization of the schema among the servers in the topology -->
+              <call function="'verifySchemas'">
+                [ clientHost, clientPath, master, consumerList, '99-user.ldif' ]
+              </call> 
+                
+              <!-- Verify the synchronization of the trees among the servers in the topology -->
+              <call function="'verifyTrees'">
+                [ clientHost, clientPath, master, consumerList, synchroSuffix ]
+              </call> 
+                                
+              <call function="'testCase_Postamble'"/>
+            </sequence>
+          </testcase>                                                                     
+
+
+                                    
+          <!--- Test Case information
+          #@TestMarker          Replication Schema Replication Tests
+          #@TestName            Replication: Schema Replication: Add objectclass (edit schema file)
+          #@TestID                  Add objectclass (edit schema file)
+          #@TestPurpose        Check schema replication when a new objectclass is added manually
+          #@TestPreamble
+          #@TestSteps
+          #@TestPostamble
+          #@TestResult
+          -->               
+          <testcase name="getTestCaseName('Add objectclass (edit schema file)')">
+            <sequence>            
+              <call function="'testCase_Preamble'"/>
+              <message>
+                 'Replication: Schema Replication: Add objectclass (edit schema file). Check schema replication when a new objectclass is added manually'
+              </message>
+
+              <!-- Stop the servers in the topology -->
+              <call function="'stopServers'">
+                [_topologyServerList]
+              </call>
+                                  
+              <!-- Modify schema  in "master" server -->
+              <call function="'copyFile'">
+                { 'location'  :  masterHost,
+                  'srcfile'  :  currentSchemaFile,
+                  'destfile'  :  provSchemaFile }
+              </call>
+              <call function="'LdifModifyWithScript'">
+                { 'location'   :  masterHost,
+                  'dsPath'     :  masterPath, 
+                  'sourceLdif' : provSchemaFile,
+                  'changesLdif'  :  '%s/replication/schemamods-0.ldif' % masterDataDir,
+                  'targetLdif' :  currentSchemaFile }
+              </call>
+                                                              
+              <!-- Start the servers in the topology -->
+              <call function="'startServers'">
+                [_topologyServerList]
+              </call>                                                                  
+
+              <call function="'Sleep'">
+                { 'location'  :  masterHost,
+                  'sleepForMilliSeconds'  :  1000 }
+              </call>
+                
+              <!-- Add entry to "master" server -->                       
+              <call function="'addEntry'">
+                { 'location'       : clientHost,
+                  'dsPath'         : clientPath,
+                  'dsInstanceHost' : masterHost,
+                  'dsInstancePort' : master.getPort(), 
+                  'dsInstanceDn'   : master.getRootDn(),
+                  'dsInstancePswd' : master.getRootPwd(),
+                  'entryToBeAdded' : '%s/replication/newtestuser-0.ldif' % clientDataDir }
+              </call>           
+                       
+              <!-- Verify the synchronization of the schema among the servers in the topology -->          
+              <call function="'verifySchemas'">
+                [ clientHost, clientPath, master, consumerList, '99-user.ldif' ]
+              </call> 
+                
+              <!-- Verify the synchronization of the trees among the servers in the topology -->          
+              <call function="'verifyTrees'">
+                [ clientHost, clientPath, master, consumerList, synchroSuffix ]
+              </call> 
+                                
+              <call function="'testCase_Postamble'"/>
+            </sequence>
+          </testcase>                     
+          
+
+
+
+          <!--- Test Case information
+          #@TestMarker          Replication Schema Replication Tests
+          #@TestName            Replication: Schema Replication: Add attributetype (edit schema file)
+          #@TestID                  Add attributetype (edit schema file)
+          #@TestPurpose        Check schema replication when a new attributetype is added manually
+          #@TestPreamble
+          #@TestSteps
+          #@TestPostamble
+          #@TestResult
+          -->               
+          <testcase name="getTestCaseName('Add attributetype (edit schema file)')">
+            <sequence>            
+              <call function="'testCase_Preamble'"/>
+              <message>
+                 'Replication: Schema Replication: Add attributetype (edit schema file). Check schema replication when a new attributetype is added manually'
+              </message>
+
+              <!-- Stop the servers in the topology -->
+              <call function="'stopServers'">
+                [_topologyServerList]
+              </call>
+                                  
+              <!-- Modify schema  in "master" server -->
+              <call function="'copyFile'">
+                { 'location'  :  masterHost,
+                  'srcfile'  :  currentSchemaFile,
+                  'destfile'  :  provSchemaFile }
+              </call>
+              <call function="'LdifModifyWithScript'">
+                { 'location'   :  masterHost,
+                  'dsPath'     :  masterPath, 
+                  'sourceLdif' : provSchemaFile,
+                  'changesLdif'  :  '%s/replication/schemamods-1.ldif' % masterDataDir,
+                  'targetLdif' :  currentSchemaFile }
+              </call>
+                                                              
+              <!-- Start the servers in the topology -->
+              <call function="'startServers'">
+                [_topologyServerList]
+              </call>                                                                                                     
+
+              <call function="'Sleep'">
+                { 'location'  :  masterHost,
+                  'sleepForMilliSeconds'  :  1000 }
+              </call>
+                                
+              <!-- Add entry to "master" server -->                       
+              <call function="'addEntry'">
+                { 'location'       : clientHost,
+                  'dsPath'         : clientPath,
+                  'dsInstanceHost' : masterHost,
+                  'dsInstancePort' : master.getPort(), 
+                  'dsInstanceDn'   : master.getRootDn(),
+                  'dsInstancePswd' : master.getRootPwd(),
+                  'entryToBeAdded' : '%s/replication/newtestuser-1.ldif' % clientDataDir }
+              </call>           
+                       
+              <!-- Verify the synchronization of the schema among the servers in the topology -->          
+              <call function="'verifySchemas'">
+                [ clientHost, clientPath, master, consumerList, '99-user.ldif' ]
+              </call> 
+                
+              <!-- Verify the synchronization of the trees among the servers in the topology -->          
+              <call function="'verifyTrees'">
+                [ clientHost, clientPath, master, consumerList, synchroSuffix ]
+              </call> 
+                                
+              <call function="'testCase_Postamble'"/>
+            </sequence>
+          </testcase>                                           
+            
+
+
+            
+          <!-- Test Case information
+          #@TestMarker          Replication Schema Replication Tests
+          #@TestName            Replication: Schema Replication: Delete objectclass (edit schema file)
+          #@TestID                  Delete objectclass (edit schema file)
+          #@TestPurpose        Check schema replication when an objectclass is deleted manually
+          #@TestPreamble
+          #@TestSteps
+          #@TestPostamble
+          #@TestResult
+          -->                    
+          <testcase name="getTestCaseName('Delete objectclass (edit schema file)')">
+            <sequence>            
+              <call function="'testCase_Preamble'"/>
+              <message>
+                 'Replication: Schema Replication: Delete objectclass (edit schema file). Check schema replication when an objectclass is deleted manually'
+              </message>
+
+              <!-- Stop the servers in the topology -->
+              <call function="'stopServers'">
+                [_topologyServerList]
+              </call>
+                                  
+              <!-- Modify schema  in "master" server -->
+              <call function="'copyFile'">
+                { 'location'  :  masterHost,
+                  'srcfile'  :  currentSchemaFile,
+                  'destfile'  :  provSchemaFile }
+              </call>
+              <call function="'LdifModifyWithScript'">
+                { 'location'   :  masterHost,
+                  'dsPath'     :  masterPath, 
+                  'sourceLdif' : provSchemaFile,
+                  'changesLdif'  :  '%s/replication/schemamods-2.ldif' % masterDataDir,
+                  'targetLdif' :  currentSchemaFile }
+              </call>
+                                                              
+              <!-- Start the servers in the topology -->
+              <call function="'startServers'">
+                [_topologyServerList]
+              </call>                                                     
+
+                
+              <!-- Delete previously added entry -->
+              <call function="'ldapDeleteWithScript'">
+                { 'location'       :  clientHost,
+                  'dsPath'         :  clientPath,
+                  'dsInstanceHost' :  master.getHostname(),
+                  'dsInstancePort' :  master.getPort(),
+                  'dsInstanceDn'   : master.getRootDn(),
+                  'dsInstancePswd' :  master.getRootPwd(),
+                  'dsDn'           :  ['cn=newtestuser-0,ou=People,%s' % synchroSuffix]
+                }
+              </call>
+                                
+              <call function="'Sleep'">
+                { 'location'  :  masterHost,
+                  'sleepForMilliSeconds'  :  1000 }
+              </call>
+                                
+              <!-- Try to add entry to servers; should be rejected with error 65 (objectclass violation) -->
+              <iterate var="server" in="_topologyServerList">
+                <call function="'addEntry'">
+                  { 'location'       : clientHost,
+                    'dsPath'         : clientPath,
+                    'dsInstanceHost' : server.getHostname(),
+                    'dsInstancePort' : server.getPort(), 
+                    'dsInstanceDn'   : server.getRootDn(),
+                    'dsInstancePswd' : server.getRootPwd(),
+                    'entryToBeAdded' : '%s/replication/newtestuser-0.ldif' % clientDataDir,
+                    'expectedRC' : 65 }
+                </call>                             
+              </iterate> 
+                       
+              <!-- Verify the synchronization of the schema among the servers in the topology -->
+              <call function="'verifySchemas'">
+                [ clientHost, clientPath, master, consumerList, '99-user.ldif' ]
+              </call> 
+                
+              <!-- Verify the synchronization of the trees among the servers in the topology -->
+              <call function="'verifyTrees'">
+                [ clientHost, clientPath, master, consumerList, synchroSuffix ]
+              </call> 
+                                
+              <call function="'testCase_Postamble'"/>
+            </sequence>
+          </testcase>
+
+
+
+          <!-- Test Case information
+          #@TestMarker          Replication Schema Replication Tests
+          #@TestName            Replication: Schema Replication: Modify objectclass (edit schema file)
+          #@TestID                  Modify objectclass (edit schema file)
+          #@TestPurpose        Check schema replication when an objectclass is modified manually
+          #@TestPreamble
+          #@TestSteps
+          #@TestPostamble
+          #@TestResult
+          -->                    
+          <testcase name="getTestCaseName('Modify objectclass (edit schema file)')">
+            <sequence>            
+              <call function="'testCase_Preamble'"/>
+              <message>
+                 'Replication: Schema Replication: Modify objectclass (edit schema file). Check schema replication when an objectclass is modified manually'
+              </message>
+
+              <!-- Stop the servers in the topology -->
+              <call function="'stopServers'">
+                [_topologyServerList]
+              </call>
+                                  
+              <!-- Modify schema  in "master" server -->
+              <call function="'copyFile'">
+                { 'location'  :  masterHost,
+                  'srcfile'  :  currentSchemaFile,
+                  'destfile'  :  provSchemaFile }
+              </call>
+              <call function="'LdifModifyWithScript'">
+                { 'location'   :  masterHost,
+                  'dsPath'     :  masterPath, 
+                  'sourceLdif' : provSchemaFile,
+                  'changesLdif'  :  '%s/replication/schemamods-3.ldif' % masterDataDir,
+                  'targetLdif' :  currentSchemaFile }
+              </call>
+                                                              
+              <!-- Start the servers in the topology -->
+              <call function="'startServers'">
+                [_topologyServerList]
+              </call>                     
+
+              <call function="'Sleep'">
+                { 'location'  :  masterHost,
+                  'sleepForMilliSeconds'  :  1000 }
+              </call>
+                                                                                                                                
+              <!-- Try to add entry to servers; should be rejected with error 65 (objectclass violation) -->
+              <iterate var="server" in="_topologyServerList">
+                <call function="'addEntry'">
+                  { 'location'       : clientHost,
+                    'dsPath'         : clientPath,
+                    'dsInstanceHost' : server.getHostname(),
+                    'dsInstancePort' : server.getPort(), 
+                    'dsInstanceDn'   : server.getRootDn(),
+                    'dsInstancePswd' : server.getRootPwd(),
+                    'entryToBeAdded' : '%s/replication/newtestuser-2.ldif' % clientDataDir,
+                    'expectedRC' : 65 }
+                </call>                             
+              </iterate> 
+                       
+              <!-- Verify the synchronization of the schema among the servers in the topology -->
+              <call function="'verifySchemas'">
+                [ clientHost, clientPath, master, consumerList, '99-user.ldif' ]
+              </call> 
+                
+              <!-- Verify the synchronization of the trees among the servers in the topology -->
+              <call function="'verifyTrees'">
+                [ clientHost, clientPath, master, consumerList, synchroSuffix ]
+              </call> 
+                                
+              <call function="'testCase_Postamble'"/>
+            </sequence>
+          </testcase>                                                                     
+                                                
+                                                
           <import machine="STAF_LOCAL_HOSTNAME"
             file="'%s/testcases/replication/replication_cleanup.xml' % (TESTS_DIR)"/>
           <call function="'replication_cleanup'" />

--
Gitblit v1.10.0