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

Christophe Sovant
26.17.2013 157c23ce263d9098d724fa5193d217e226b61873
CR-2055 Use "useCompareResultCode" option for ldif-diff and ldapcompare tools
15 files modified
274 ■■■■ changed files
opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapcompare_checkbehavior.xml 6 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkbehavior.xml 14 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldif-diff_checkbehavior.xml 31 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifmodify_checkbehavior.xml 8 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifsearch_checkbehavior.xml 38 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/clu/clu_make-ldif_checkbehavior.xml 14 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/clu_secure/clus_saslexternal/clus_saslexternal_subjectdn.xml 10 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/clu_secure/clus_ssl/clus_ssl_ldapcompare.xml 11 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/clu_secure/clus_starttls/clus_starttls_ldapcompare.xml 9 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/core/psearch/core_psearch_tests.xml 14 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/fractional-replication/utils.xml 4 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_dataComparison.xml 3 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/replication/aci/aci_tests.xml 14 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/functions/ldap.xml 25 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/functions/tools.xml 73 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapcompare_checkbehavior.xml
@@ -103,7 +103,6 @@
                  'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                  'dsDn'             : ['postalCode:63792' ,
                                        '%s' % dsdn] ,
                  'useCmpRC'         : 'True' ,
                  'expectedRC'       : 6
                  }
                </call>
@@ -160,7 +159,6 @@
                  'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                  'dsDn'             : ['postalCode:00000' ,
                                        '%s' % dsdn] ,
                  'useCmpRC'         : 'True' ,
                  'expectedRC'       : 5
                  }
                </call>
@@ -215,6 +213,7 @@
                  'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                  'dsDn'             : ['postalCode:63792' ,
                                        '%s' % dsdn] ,
                  'useCmpRC'         : 'False' ,
                  'expectedRC'       : 0
                  }
                </call>
@@ -269,6 +268,7 @@
                  'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                  'dsDn'             : ['postalCode:00000' ,
                                        '%s' % dsdn] ,
                  'useCmpRC'         : 'False' ,
                  'expectedRC'       : 0
                  }
                </call>
@@ -332,7 +332,6 @@
                  'dsDn'             : ['st:NY' ,
                                        '%s' % dn1 ,
                                        '%s' % dn2] ,
                  'useCmpRC'         : 'True' ,
                  'expectedRC'       : 6
                  }
                </call>
@@ -398,7 +397,6 @@
                  'dsDn'             : ['postalCode:89759' ,
                                        '%s' % dn1 ,
                                        '%s' % dn2] ,
                  'useCmpRC'         : 'True' ,
                  'expectedRC'       : 5
                  }
                </call>
opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkbehavior.xml
@@ -515,13 +515,6 @@
                  }
                </call>
                
                <call function="'checktestRC'">
                  {
                  'returncode' : STAXResult ,
                  'result'     : STAXResult
                  }
                </call>
                <message>
                  'ldapsearch: check output with simplePageSize of 1'
                </message>
@@ -553,13 +546,6 @@
                  }
                </call>
                
                <call function="'checktestRC'">
                  {
                  'returncode' : STAXResult ,
                  'result'     : STAXResult
                  }
                </call>
                <call function="'testCase_Postamble'"/>
                
              </sequence>
opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldif-diff_checkbehavior.xml
@@ -96,13 +96,11 @@
                  'ldif-diff: compare ldif files with no diffs'
                </message>
                
                <call function="'LdifDiffWithScript-new'">
                <call function="'LdifDiffWithScript'">
                  {
                  'sourceLdif' : sourceldif ,
                  'targetLdif' : sourceldif ,
                  'outputLdif' : '%s/clu/ldif-diff_nodiffs_rc.out' % remote.temp ,
                  'useCmpRC'   : 'True' ,
                  'expectedRC' : 6
                  'outputLdif' : '%s/clu/ldif-diff_nodiffs_rc.out' % remote.temp
                  }
                </call>
@@ -147,12 +145,11 @@
                  'ldif-diff: compare ldif files with diffs'
                </message>
                
                <call function="'LdifDiffWithScript-new'">
                <call function="'LdifDiffWithScript'">
                  {
                  'sourceLdif' : sourceldif ,
                  'targetLdif' : targetldif ,
                  'outputLdif' : '%s/clu/ldif-diff_nodiffs_rc.out' % remote.temp ,
                  'useCmpRC'   : 'True' ,
                  'expectedRC' : 5
                  }
                </call>
@@ -197,11 +194,13 @@
                  'ldif-diff: compare ldif files with no diffs'
                </message>
                
                <call function="'LdifDiffWithScript-new'">
                <call function="'LdifDiffWithScript'">
                  {
                  'sourceLdif' : sourceldif ,
                  'targetLdif' : sourceldif ,
                  'outputLdif' : '%s/clu/ldif-diff_nodiffs.out' % remote.temp
                  'outputLdif' : '%s/clu/ldif-diff_nodiffs.out' % remote.temp ,
                  'useCmpRC'   : 'False' ,
                  'expectedRC' : 0
                  }
                </call>
@@ -246,11 +245,13 @@
                  'ldif-diff: compare ldif files with diffs'
                </message>
                
                <call function="'LdifDiffWithScript-new'">
                <call function="'LdifDiffWithScript'">
                  {
                  'sourceLdif' : sourceldif ,
                  'targetLdif' : targetldif ,
                  'outputLdif' : '%s/clu/ldif-diff_withdiffs.out' % remote.temp
                  'outputLdif' : '%s/clu/ldif-diff_withdiffs.out' % remote.temp ,
                  'useCmpRC'   : 'False' ,
                  'expectedRC' : 0
                  }
                </call>
                
@@ -293,11 +294,12 @@
                  'ldif-diff: check diff file'
                </message>
                
                <call function="'LdifDiffWithScript-new'">
                <call function="'LdifDiffWithScript'">
                  {
                  'sourceLdif' : sourceldif ,
                  'targetLdif' : targetldif ,
                  'outputLdif' : '%s/clu/ldif-diff.out' % remote.temp
                  'outputLdif' : '%s/clu/ldif-diff.out' % remote.temp ,
                  'expectedRC' : 5
                  }
                </call>
                
@@ -339,13 +341,14 @@
                  'ldif-diff: check diff file with single value changes'
                </message>
                
                <call function="'LdifDiffWithScript-new'">
                <call function="'LdifDiffWithScript'">
                  {
                  'sourceLdif'         : sourceldif ,
                  'targetLdif'         : targetldif ,
                  'outputLdif'         : '%s/clu/ldif-diff_singlevalue.out' \
                                         % remote.temp ,
                  'singleValueChanges' : 'True'
                  'singleValueChanges' : 'True' ,
                  'expectedRC'         : 5
                  }
                </call>
                
opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifmodify_checkbehavior.xml
@@ -24,6 +24,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2008-2009 Sun Microsystems, Inc.
 !      Portions Copyright 2013 ForgeRock AS
 ! -->
<stax>
  
@@ -111,13 +112,6 @@
                  'outputLdif' : '%s/clu/ldifmodify.diff' % remote.temp
                  }
                </call>
                <call function="'checktestRC'">
                  {
                  'returncode' : STAXResult ,
                  'result'     : STAXResult
                  }
                </call>
                
                <call function="'testCase_Postamble'"/>
                
opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifsearch_checkbehavior.xml
@@ -24,6 +24,7 @@
 ! CDDL HEADER END
 !
 !      Portions Copyright 2008-2009 Sun Microsystems, Inc.
 !      Portions Copyright 2013 ForgeRock AS
 ! -->
<stax>
  
@@ -125,14 +126,7 @@
                  'targetLdif' : '%s/ldapsearch.out' % remote.temp ,
                  'outputLdif' : '%s/ldifsearch.diff' % remote.temp
                  }
                </call>
                <call function="'checktestRC'">
                  {
                  'returncode' : STAXResult ,
                  'result'     : STAXResult
                  }
                </call>
                </call>
                
                <call function="'testCase_Postamble'"/>
                
@@ -196,13 +190,6 @@
                  }
                </call>
                
                <call function="'checktestRC'">
                  {
                  'returncode' : STAXResult ,
                  'result'     : STAXResult
                  }
                </call>
                <call function="'testCase_Postamble'"/>
                
              </sequence>
@@ -311,13 +298,6 @@
                  }
                </call>
  
                <call function="'checktestRC'">
                  {
                  'returncode' : STAXResult ,
                  'result'     : STAXResult
                  }
                </call>
                <call function="'testCase_Postamble'"/>
                
              </sequence>
@@ -436,13 +416,6 @@
                  }
                </call>
                
                <call function="'checktestRC'">
                  {
                  'returncode' : STAXResult ,
                  'result'     : STAXResult
                  }
                </call>
                <message>
                  'ldifsearch: @inetorgperson as attribute'
                </message>
@@ -479,13 +452,6 @@
                  }
                </call>
                
                <call function="'checktestRC'">
                  {
                  'returncode' : STAXResult ,
                  'result'     : STAXResult
                  }
                </call>
                <call function="'testCase_Postamble'"/>
                
              </sequence>
opends/tests/staf-tests/functional-tests/testcases/clu/clu_make-ldif_checkbehavior.xml
@@ -24,6 +24,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2008-2009 Sun Microsystems, Inc.
 !      Portions Copyright 2013 ForgeRock AS
 ! -->
<stax>
  
@@ -97,7 +98,7 @@
                  {
                  'templateFile'   : template ,
                  'ldifFile'       : '%s/clu/make-ldif_seed0_1.ldif' % remote.temp ,
                  'randomSeed'     : 0
                  'randomSeed'     : "0"
                  }
                </call>
                
@@ -150,7 +151,7 @@
                  {
                  'templateFile'   : template ,
                  'ldifFile'       : '%s/clu/make-ldif_seed0_2.ldif' % remote.temp ,
                  'randomSeed'     : 0
                  'randomSeed'     : "0"
                  }
                </call>
  
@@ -287,7 +288,8 @@
                  { 
                  'sourceLdif' : '%s/clu/make-ldif_seed0_1.ldif' % remote.temp ,
                  'targetLdif' : '%s/clu/make-ldif_noseed_1.ldif' % remote.temp ,
                  'outputLdif' : '%s/clu/make-ldif_noseed_1.diff' % remote.temp
                  'outputLdif' : '%s/clu/make-ldif_noseed_1.diff' % remote.temp ,
                  'expectedRC' : 5
                  }
                </call>           
                
@@ -299,7 +301,8 @@
                  { 
                  'sourceLdif' : '%s/clu/make-ldif_noseed_1.ldif' % remote.temp ,
                  'targetLdif' : '%s/clu/make-ldif_noseed_2.ldif' % remote.temp ,
                  'outputLdif' : '%s/clu/make-ldif_noseed_2.diff' % remote.temp
                  'outputLdif' : '%s/clu/make-ldif_noseed_2.diff' % remote.temp ,
                  'expectedRC' : 5
                  }
                </call>
                
@@ -312,7 +315,8 @@
                  { 
                  'sourceLdif' : '%s/clu/make-ldif_seed0_1.ldif' % remote.temp ,
                  'targetLdif' : '%s/clu/make-ldif_seed5.ldif' % remote.temp ,
                  'outputLdif' : '%s/clu/make-ldif_seed5.diff' % remote.temp
                  'outputLdif' : '%s/clu/make-ldif_seed5.diff' % remote.temp ,
                  'expectedRC' : 5
                  }
                </call>
  
opends/tests/staf-tests/functional-tests/testcases/clu_secure/clus_saslexternal/clus_saslexternal_subjectdn.xml
@@ -219,7 +219,7 @@
                'dsCertNickname'   : 'client-250-cert',
                'dsDn'             : ['street: 0901 Chestnut Street' ,'%s' \
                                      %dncompare],
                'expectedRC'       : 0
                'expectedRC'       : 5
                }
              </call>
@@ -248,8 +248,7 @@
                'dsKeyStorePassword' : 'clientkeystorepass',
                'dsCertNickname'   : 'client-250-cert',
                'dsDn'             : ['street: 30901 Chestnut Street' ,'%s' \
                                      %dncompare] ,
                'expectedRC'       : 0
                                      %dncompare]
                }
              </call>
@@ -396,7 +395,7 @@
                'dsCertNickname'   : 'client-250-cert',
                'dsDn'             : ['street: 3001 Chestnut Street' ,'%s' \
                                     %dncompare],
                'expectedRC'       : 0
                'expectedRC'       : 5
                }
              </call>
@@ -427,8 +426,7 @@
                'dsKeyStorePassword' : 'clientkeystorepass',
                'dsCertNickname'   : 'client-250-cert',
                'dsDn'             : ['street: 30901 Chestnut Street' ,'%s' \
                                     %dncompare] ,
                'expectedRC'       : 0
                                     %dncompare]
                }
              </call>
opends/tests/staf-tests/functional-tests/testcases/clu_secure/clus_ssl/clus_ssl_ldapcompare.xml
@@ -24,6 +24,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2010 Sun Microsystems, Inc.
 !      Portions Copyright 2013 ForgeRock AS
 ! -->
<stax>
@@ -84,7 +85,7 @@
                'dsUseSSL'         : ' ' ,
                'dsTrustAll'       : ' ' ,
                'dsDn'             : ['postalCode:21700' ,'%s' %dncompare],
                'expectedRC'       : 'noCheck'
                'expectedRC'       : 5
                }
              </call>
@@ -104,8 +105,7 @@
                'dsInstancePort'   : DIRECTORY_INSTANCE_SSL_PORT ,
                'dsUseSSL'         : ' ' ,
                'dsTrustAll'       : ' ' ,
                'dsDn'             : ['postalCode:01700' ,'%s' %dncompare],
                'expectedRC'       : 'noCheck'
                'dsDn'             : ['postalCode:01700' ,'%s' %dncompare]
                }
              </call>
@@ -161,7 +161,7 @@
                                      %InstanceInstallDir,
                'dsTrustStorePassword': 'clientruststorepass',
                'dsDn'             : ['street: 50303 Sunset' ,'%s' %dncompare2],
                'expectedRC'       : 'noCheck'
                'expectedRC'       : 5
                }
              </call>
@@ -184,8 +184,7 @@
                                      %InstanceInstallDir,
                'dsTrustStorePassword': 'clientruststorepass',
                'dsDn'             : ['street: 50303 Sunset Street' ,'%s' \
                                       %dncompare2] ,
                'expectedRC'       : 'noCheck'
                                       %dncompare2]
                }
              </call>
              
opends/tests/staf-tests/functional-tests/testcases/clu_secure/clus_starttls/clus_starttls_ldapcompare.xml
@@ -24,6 +24,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2010 Sun Microsystems, Inc.
 !      Portions Copyright 2013 ForgeRock AS
 ! -->
<stax>
@@ -83,7 +84,7 @@
                'dsUseStartTLS'    : ' ' ,
                'dsTrustAll'       : ' ' ,
                'dsDn'             : ['postalCode:6728' ,'%s' %dncompare],
                'expectedRC'       : 'noCheck'
                'expectedRC'       : 5
                }
              </call>
@@ -104,7 +105,6 @@
                'dsUseStartTLS'    : ' ' ,
                'dsTrustAll'       : ' ' ,
                'dsDn'             : ['postalCode:67258' ,'%s' %dncompare],
                'expectedRC'       : 'noCheck'
                }
              </call>
@@ -160,7 +160,7 @@
                'dsTrustStorePassword': 'clientruststorepass',
                'dsDn'           : ['description: This is for Amber Arbuckle.',\
                                   '%s' %dncompare2] ,
                'expectedRC'     : 'noCheck'
                'expectedRC'     : 5
                }
              </call>
@@ -183,8 +183,7 @@
                                      % InstanceInstallDir,
                'dsTrustStorePassword': 'clientruststorepass',
                'dsDn'            : ['description: This is the description for \
                                   Amber Arbuckle.' ,'%s' %dncompare2] ,
                'expectedRC'      : 'noCheck'
                                   Amber Arbuckle.' ,'%s' %dncompare2]
                }
              </call>
opends/tests/staf-tests/functional-tests/testcases/core/psearch/core_psearch_tests.xml
@@ -24,7 +24,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2010 Sun Microsystems, Inc.
 !      Portions Copyright 2011 ForgeRock AS.
 !      Portions Copyright 2011-2013 ForgeRock AS.
 ! -->
<stax>
@@ -178,9 +178,6 @@
                'outputLdif' : '%s/psearch-delete-diffs.out' % remote.temp
              }
              </call>
              <if expr="STAXResult != 0">
                <tcstatus result="'fail'"/>
              </if>
            </sequence>
          </parallel>
@@ -456,9 +453,6 @@
                'outputLdif' : '%s/psearch-modify-diffs.out' % remote.temp
              }
              </call>
              <if expr="STAXResult != 0">
                <tcstatus result="'fail'"/>
              </if>
            </sequence>
          </parallel>
@@ -733,9 +727,6 @@
                  'outputLdif' : '%s/psearch-moddn-diffs.out' % remote.temp
                }
              </call>
              <if expr="STAXResult != 0">
                <tcstatus result="'fail'"/>
              </if>
            </sequence>
          </parallel>
@@ -1011,9 +1002,6 @@
                'outputLdif' : '%s/psearch-add-diffs.out' % remote.temp
              }
              </call>
              <if expr="STAXResult != 0">
                <tcstatus result="'fail'"/>
              </if>
            </sequence>
          </parallel>
opends/tests/staf-tests/functional-tests/testcases/fractional-replication/utils.xml
@@ -544,7 +544,7 @@
      </if>
      <if expr="RC == 0">
        <sequence>
          <call function="'LdifDiffWithScript-new'">
          <call function="'LdifDiffWithScript'">
            { 'location'            : dsMaster.getHostname(),
              'dsPath'              : dsMasterPath,
              'sourceLdif' : '%s/%s' % (remote.temp, filteredRefTree),
@@ -552,7 +552,7 @@
              'outputLdif' : '%s/%s' % (remote.temp,treeDiffs)
            }
          </call>
          <if expr="STAXResult == 0">
          <if expr="STAXResult == 6">
            <sequence>
              <return>0, None</return>
            </sequence>
opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_dataComparison.xml
@@ -24,6 +24,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2007-2009 Sun Microsystems, Inc.
 !      Portions Copyright 2013 ForgeRock AS
 ! -->
<stax>
@@ -107,7 +108,7 @@
                    RefFile = '%s/i18n/8-bit/base64/Data_Comparison.Ref.base64.ldif' % remote.data
                  </script>
                  
                  <call function="'LdifDiffWithScript-new'">
                  <call function="'LdifDiffWithScript'">
                  { 
                  'sourceLdif' : RefFile ,
                  'targetLdif' : '%s/ldapsearch.out' % remote.temp ,
opends/tests/staf-tests/functional-tests/testcases/replication/aci/aci_tests.xml
@@ -24,7 +24,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2010 Sun Microsystems, Inc.
 !      Portions Copyright 2011-2012 ForgeRock AS.
 !      Portions Copyright 2011-2013 ForgeRock AS.
 ! -->
<stax>
                        
@@ -580,8 +580,7 @@
                    'dsInstanceDn'   : myEntry.getDn(),
                    'dsInstancePswd' : myUserpassword,
                    'dsDn'           : ['telephonenumber:%s' % \
                                        myTelephonenumber, myTargetEntryDn],
                    'expectedRC'     : 0
                                        myTelephonenumber, myTargetEntryDn]
                  }                
                </call>
              </sequence>
@@ -758,8 +757,7 @@
                    'dsInstanceDn'   : myEntry.getDn(),
                    'dsInstancePswd' : myUserpassword,
                    'dsDn'           : ['telephonenumber:%s' % \
                                        myTelephonenumber, myTargetEntryDn],
                    'expectedRC'     : 0
                                        myTelephonenumber, myTargetEntryDn]
                  }                
                </call>
              </sequence>
@@ -974,8 +972,7 @@
                    'dsInstanceDn'   : myEntry.getDn(),
                    'dsInstancePswd' : myUserpassword,
                    'dsDn'           : ['telephonenumber:%s' % \
                                        myTelephonenumber, myTargetEntryDn],
                    'expectedRC'     : 0
                                        myTelephonenumber, myTargetEntryDn]
                  }                
                </call>
              </sequence>
@@ -1129,8 +1126,7 @@
                    'dsInstanceDn'   : myEntry.getDn(),
                    'dsInstancePswd' : myUserpassword,
                    'dsDn'           : ['telephonenumber:%s' % \
                                        myTelephonenumber, myTargetEntryDn],
                    'expectedRC'     : 0
                                        myTelephonenumber, myTargetEntryDn]
                  }                
                </call>
              </sequence>
opends/tests/staf-tests/shared/functions/ldap.xml
@@ -2106,7 +2106,7 @@
        </function-arg-description>
        <function-arg-property name="type" value="dn"/>
      </function-arg-def>
      <function-arg-def name="useCmpRC" type="optional">
      <function-arg-def name="useCmpRC" type="optional" default="'True'">
        <function-arg-description>
          Use an exit code that indicates whether comparison is successful.
          Results are an exit code of 6 (COMPARE_TRUE) or
@@ -2114,9 +2114,9 @@
        </function-arg-description>
        <function-arg-property name="type" value="option"/>
      </function-arg-def>
      <function-arg-def name="expectedRC" type="optional" default="0">
      <function-arg-def name="expectedRC" type="optional" default="6">
        <function-arg-description>
          Expected return code value. Default value is 0
          Expected return code value. Default value is 6 (COMPARE_TRUE).
          Wildcard 'noCheck' to not check the RC
        </function-arg-description>
        <function-arg-property name="type" value="integer"/>      
@@ -2223,7 +2223,7 @@
        if dsUseSSL:
          STAFCmdParamsList.append('-Z')
        if useCmpRC:
        if useCmpRC == 'True':
          STAFCmdParamsList.append('--useCompareResultCode')
          
        if dsDn:
@@ -2308,9 +2308,17 @@
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
      </function-arg-def>
      <function-arg-def name="expectedRC" type="optional" default="0">
      <function-arg-def name="useCmpRC" type="optional" default="'True'">
        <function-arg-description>
          Expected return code value. Default value is 0
          Use an exit code that indicates whether comparison is successful.
          Results are an exit code of 6 (COMPARE_TRUE) or
          an exit code of 5 (COMPARE_FALSE).
        </function-arg-description>
        <function-arg-property name="type" value="option"/>
      </function-arg-def>
      <function-arg-def name="expectedRC" type="optional" default="6">
        <function-arg-description>
          Expected return code value. Default value is 6 (COMPARE_TRUE).
          Wildcard 'noCheck' to not check the RC
        </function-arg-description>
        <function-arg-property name="type" value="integer"/>      
@@ -2341,7 +2349,10 @@
      <!-- Set common ldap arguments -->      
      <call function="'_ldapCommonArgs'"/>     
      <script>
      <script>
        if useCmpRC == 'True':
          STAFCmdParamsList.append('--useCompareResultCode')
        if extraParams:
          STAFCmdParamsList.append('%s' % extraParams)
        
opends/tests/staf-tests/shared/functions/tools.xml
@@ -308,7 +308,7 @@
  </function>
    
  <!-- This function compares two LDIF files using the ldif-diff script -->
  <function name="LdifDiffWithScript">
  <function name="LdifDiffWithScript-old">
    <function-prolog>
      This function  compares two LDIF files and reports the differences in LDIF format
    </function-prolog>
@@ -819,7 +819,7 @@
                  'ignoreAttrsFile' : ignoreAttrsFile
                }
              </call>
              <if expr="STAXResult != 0">
              <if expr="STAXResult != 6">
                <sequence>
                  <script>
                    failedServers.append('%s:%s' % \
@@ -1167,7 +1167,7 @@
            }
          </call>
          <script>
            if STAXResult != 0 :
            if STAXResult != 6:
              failedServers.append('%s:%s' % (server.getHostname(), server.getPort()))
          </script>
        </sequence>
@@ -1886,7 +1886,7 @@
  </function>
  
  <!-- This function compares two LDIF files using the ldif-diff script -->
  <function name="LdifDiffWithScript-new" scope="local">
  <function name="LdifDiffWithScript" scope="local">
    <function-prolog>
      This function  compares two LDIF files and reports the differences
      in LDIF format
@@ -1945,7 +1945,7 @@
        </function-arg-description>
        <function-arg-property name="type" value="option"/>
      </function-arg-def>
      <function-arg-def name="useCmpRC" type="optional">
      <function-arg-def name="useCmpRC" type="optional" default="'True'">
        <function-arg-description>
          Use an exit code that indicates whether difference were not found.
          Results are an exit code of 6 (COMPARE_TRUE) or
@@ -1959,9 +1959,9 @@
        </function-arg-description>
        <function-arg-property name="help" value="option"/>
      </function-arg-def>
      <function-arg-def name="expectedRC" type="optional" default="0">
      <function-arg-def name="expectedRC" type="optional" default="6">
        <function-arg-description>
          Expected return code value. Default value is 0.
          Expected return code value. Default value is 6 (COMPARE_TRUE).
          Wildcard 'noCheck' to not check the RC
        </function-arg-description>
        <function-arg-property name="type" value="integer"/>
@@ -1996,7 +1996,7 @@
          foldersToCreate.append(os.path.dirname(outputLdif))
          STAFCmdParamsList.append('-o %s' % outputLdif)
        
        if useCmpRC:
        if useCmpRC == 'True':
          STAFCmdParamsList.append('-r')
        if overwriteExisting:
@@ -2032,6 +2032,63 @@
        }
      </call>
      
      <if expr="RC == 5 and expectedRC != 5">
        <sequence>
          <!-- Check the size of the diff file, and avoid reading its
               content with getFile if the file is too big to prevent
               the staf process from running out of memory -->
          <call function="'GetEntry'">
            {
            'location'  : location,
            'entry'     : outputLdif,
            'attribute' : 'SIZE'
            }
          </call>
          <script>
            # GetEntry returns: STAXResult = [cmdRC, cmdResult]
            if RC == 0:
              diffsFileSize = int(STAXResult[1]['lowerSize'])
              msg = 'File: %s   Size (bytes): %s' % (outputLdif, diffsFileSize)
            else:
              diffsFileSize = MAX_READABLE_SIZE
              msg = 'Could not retrieve the size of file %s' % outputLdif
          </script>
          <message log="1"> 'LdifDiffWithScript: %s' % msg </message>
          <if expr="diffsFileSize &lt; MAX_READABLE_SIZE">
            <sequence>
              <call function="'getFile'">
                { 'location' : location,
                  'filename' : outputLdif
                }
              </call>
              <script>
                # getFile returns: STAXResult = [cmdRC, cmdResult]
                diffsFileContent = STAXResult[1]
               </script>
            </sequence>
            <else>
              <script>
                # diffs file to big to be read
                diffsFileContent = 'File too big to be read.'
              </script>
            </else>
          </if>
          <message log="1" level="'Error'">
            'Source and target LDIF files are DIFFERENT: \n\n%s' % \
            diffsFileContent
          </message>
        </sequence>
        <else>
          <sequence>
            <message>
              'NO DIFFERENCES were detected between the source and the target \
              LDIF files.'
            </message>
          </sequence>
        </else>
      </if>
      <return>STAXResult</return>
    </sequence>
  </function>