From 73030abd0d672fe56ca390cbe51da714c469058b Mon Sep 17 00:00:00 2001
From: ugaston <ugaston@localhost>
Date: Tue, 11 Aug 2009 13:32:00 +0000
Subject: [PATCH] Fix failing core and schema testcases

---
 opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_2.ldif             |    1 
 opends/tests/staf-tests/functional-tests/testcases/core/controls/core_ctrls_assertion.xml      |   13 +++++-
 opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_3.ldif             |    1 
 opends/tests/staf-tests/shared/functions/utils.xml                                             |   17 ++++++++
 opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_1.ldif             |    1 
 opends/tests/staf-tests/functional-tests/testcases/core/controls/core_ctrls_matched_values.xml |   54 ++++++++++++++++++++++++++-
 6 files changed, 82 insertions(+), 5 deletions(-)

diff --git a/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_1.ldif b/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_1.ldif
index c99a3be..e32f467 100644
--- a/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_1.ldif
+++ b/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_1.ldif
@@ -29,3 +29,4 @@
 changenumber: 100001
 targetdn: uid=tmorris, ou=People, o=schema tests,dc=example,dc=com
 changetype: add
+changetime: 20090811151059Z
diff --git a/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_2.ldif b/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_2.ldif
index 0a18ee1..961f904 100644
--- a/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_2.ldif
+++ b/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_2.ldif
@@ -29,3 +29,4 @@
 changenumber: 100002
 targetdn: uid=tmorris, ou=People, o=schema tests,dc=example,dc=com
 changetype: delete
+changetime: 20090811151059Z
diff --git a/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_3.ldif b/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_3.ldif
index 1763951..41dc2ac 100644
--- a/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_3.ldif
+++ b/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/changelog_3.ldif
@@ -30,4 +30,5 @@
 targetdn: uid=tmorris, ou=People, o=schema tests,dc=example,dc=com
 changetype: modify
 changes: delete: telephonenumber\ntelephonenumber: 9187\n-\nadd telephonenumber\ntelephonenumber: +1 408 555 9187\n-
+changetime: 20090811151059Z
 
diff --git a/opends/tests/staf-tests/functional-tests/testcases/core/controls/core_ctrls_assertion.xml b/opends/tests/staf-tests/functional-tests/testcases/core/controls/core_ctrls_assertion.xml
index 1443b28..e8abf3e 100644
--- a/opends/tests/staf-tests/functional-tests/testcases/core/controls/core_ctrls_assertion.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/core/controls/core_ctrls_assertion.xml
@@ -135,11 +135,12 @@
                   'dsBaseDN'         : 'uid=user.1,%s' % peopleDn ,
                   'dsFilter'         : 'objectclass=*' ,
                   'extraParams'      : '--assertionFilter "(objectclass=top)"' ,
-                  'dsAttributes'     : 'uid' ,
-                  'expectedRC'       : 50
+                  'dsAttributes'     : 'uid' 
                 }
                 </call>
                 <!-- ========== -->
+                <!-- Behaviour changed since rev. 5534: access controls relaxed
+                 !   for OID 1.3.6.1.1.12 => ACI is no longer necessary. 
                 <message>'++ Check assertion control id is displayed'</message>
                 <call function="'CheckMatches'">
                 { 
@@ -148,6 +149,14 @@
                   'nbExpected'  : 1
                 }
                 </call>
+                -->
+                <call function="'CheckMatches'">
+                { 
+                  'string2find'   : 'uid=user.1,%s' % peopleDn ,
+                  'mainString'    : STAXResult[0][1] ,
+                  'nbExpected'    : 1 ,
+                }
+                </call>
                 <call function="'testCase_Postamble'"/>
               </sequence>
             </testcase>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/core/controls/core_ctrls_matched_values.xml b/opends/tests/staf-tests/functional-tests/testcases/core/controls/core_ctrls_matched_values.xml
index 1e59590..0b6f163 100644
--- a/opends/tests/staf-tests/functional-tests/testcases/core/controls/core_ctrls_matched_values.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/core/controls/core_ctrls_matched_values.xml
@@ -188,11 +188,16 @@
                   'dsInstancePswd'   : 'password' ,
                   'dsBaseDN'         : peopleDn ,
                   'dsFilter'         : 'objectclass=*' ,
-                  'extraParams'      : extraParam ,
-                  'expectedRC'       : 50
+                  'extraParams'      : extraParam
                 }
                 </call>
+                <script>
+                  searchResult = STAXResult[0][1]
+                  string2find = 'description: pair'
+                </script>
                 <!-- ========== -->
+                <!-- Behaviour changed since rev. 5534: access controls relaxed
+                 !   for OID 1.3.6.1.1.12 => ACI is no longer necessary. 
                 <message>'++ Check assertion control id is displayed'</message>
                 <call function="'CheckMatches'">
                 { 
@@ -201,6 +206,51 @@
                   'nbExpected'  : 1
                 }
                 </call>
+                -->
+                <message>
+                  '++ Check \"%s\" is displayed 5 times in ldapsearch \
+                  result' % string2find
+                </message>
+                <call function="'CheckMatches'">
+                { 
+                  'string2find'   : string2find ,
+                  'mainString'    : searchResult ,
+                  'nbExpected'    : 5 ,
+                  'caseSensitive' : False
+                }
+                </call>
+                <!-- ========== -->
+                <script>
+                  string2find = 'description: odd'
+                </script>
+                <message>
+                  '++ Check \"%s\" is NOT displayed in ldapsearch \
+                  result' % string2find
+                </message>
+                <call function="'CheckMatches'">
+                { 
+                  'string2find'   : string2find ,
+                  'mainString'    : searchResult ,
+                  'nbExpected'    : 0 ,
+                  'caseSensitive' : False
+                }
+                </call>
+                <!-- ========== -->
+                <script>
+                  string2find = 'dn: uid'
+                </script>
+                <message>
+                  '++ Check \"%s\" is displayed 10 times in ldapsearch \
+                  result' % string2find
+                </message>
+                <call function="'CheckMatches'">
+                { 
+                  'string2find'   : string2find ,
+                  'mainString'    : searchResult ,
+                  'nbExpected'    : 10 ,
+                  'caseSensitive' : False
+                }
+                </call>
                 
                 <call function="'testCase_Postamble'"/>
               </sequence>
diff --git a/opends/tests/staf-tests/shared/functions/utils.xml b/opends/tests/staf-tests/shared/functions/utils.xml
index 7064349..ef184a9 100755
--- a/opends/tests/staf-tests/shared/functions/utils.xml
+++ b/opends/tests/staf-tests/shared/functions/utils.xml
@@ -1531,6 +1531,12 @@
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>
       </function-arg-def>
+      <function-arg-def name="issue" type="optional" default="None">
+        <function-arg-description>
+          Issue id. Corresponds to an issue number.
+        </function-arg-description>
+        <function-arg-property name="type" value="string"/>
+      </function-arg-def>
     </function-map-args>
       
     <sequence>
@@ -1559,7 +1565,16 @@
         </sequence>
         <else>
           <sequence>
-            <tcstatus result="'fail'"/>
+            <if expr="issue == None">
+              <tcstatus result="'fail'"/>
+            <else>
+              <sequence>
+                <call function="'setKnownIssue'">
+                  { 'issueId' : issue }
+                </call>
+              </sequence>
+            </else>
+            </if>
             <message log="1" level="'Error'">
               '%s' % myMessage
             </message>

--
Gitblit v1.10.0