From beedaf6b21c6ea98cf38246e65d1483dd9ed0244 Mon Sep 17 00:00:00 2001
From: andrug <andrug@localhost>
Date: Wed, 02 Jul 2008 14:33:45 +0000
Subject: [PATCH] QA: System Test: fix verifyTree() : check the RC, pass if equals to 0 or 4 (Size Limit Exceeded)
---
opendj-sdk/opends/tests/system-tests/phases/shared/functions/utils.xml | 13 ++++++++++++-
opendj-sdk/opends/tests/system-tests/phases/shared/functions/ldap.xml | 26 +++++++++++++++++++++-----
2 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/opendj-sdk/opends/tests/system-tests/phases/shared/functions/ldap.xml b/opendj-sdk/opends/tests/system-tests/phases/shared/functions/ldap.xml
index 9fd322a..639f4b1 100755
--- a/opendj-sdk/opends/tests/system-tests/phases/shared/functions/ldap.xml
+++ b/opendj-sdk/opends/tests/system-tests/phases/shared/functions/ldap.xml
@@ -292,7 +292,8 @@
<call function="'writeMessage'">
{ 'fileFd' : fileFd,
- 'content' : 'Verify tree %s taking %s as reference.' % (suffixDn, referenceServerPath)
+ 'content' : 'Verify tree %s taking %s as reference.' % \
+ (suffixDn, referenceServerPath)
}
</call>
@@ -315,7 +316,8 @@
'dsFilter' : 'objectclass=*',
'dsAttributes' : dsAttributes,
'outputFile' : referenceTree,
- 'expectedRC' : 'noCheck',
+ 'expectedRC' : [0,4],
+ 'logStderr' : 'false',
'fileFd' : fileFd,
'dsSortOrder' : '+cn',
'dsSizeLimit' : dsSizeLimit
@@ -325,7 +327,7 @@
ldapSearchRC = STAXResult[0]
</script>
- <if expr="ldapSearchRC != 0">
+ <if expr="ldapSearchRC != 0 and ldapSearchRC != 4">
<!-- == If the reference tree could not be retrieved, == -->
<!-- == return an error == -->
<sequence>
@@ -346,7 +348,8 @@
'dsFilter' : 'objectclass=*',
'dsAttributes' : dsAttributes,
'outputFile' : sampleTree,
- 'expectedRC' : 'noCheck',
+ 'expectedRC' : [0,4],
+ 'logStderr' : 'false',
'fileFd' : fileFd,
'dsSortOrder' : '+cn',
'dsSizeLimit' : dsSizeLimit
@@ -356,7 +359,7 @@
ldapSearchRC = STAXResult[0]
</script>
- <if expr="ldapSearchRC == 0">
+ <if expr="ldapSearchRC == 0 or ldapSearchRC == 4">
<sequence>
<!-- == Check if file is empty == -->
<call function="'isEmptyFile'">
@@ -727,6 +730,18 @@
</function-arg-description>
<function-arg-property name="type" value="filepath"/>
</function-arg-def>
+ <function-arg-def name="logStderr" type="optional" default="'true'">
+ <function-arg-description>
+ If true, stderr for the command is redirect to stdout.
+ </function-arg-description>
+ <function-arg-property name="type" value="enum">
+ <function-arg-property-description>
+ This argument can only have boolean values
+ </function-arg-property-description>
+ <function-arg-property-data type="choice" value="'true'"/>
+ <function-arg-property-data type="choice" value="'false'"/>
+ </function-arg-property>
+ </function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
@@ -905,6 +920,7 @@
'path' : dsBinPath,
'outputFile': outputFile,
'expectedRC': expectedRC,
+ 'logStderr' : logStderr,
'fileFd' : fileFd
}
</call>
diff --git a/opendj-sdk/opends/tests/system-tests/phases/shared/functions/utils.xml b/opendj-sdk/opends/tests/system-tests/phases/shared/functions/utils.xml
index 2d85546..4dcc54c 100755
--- a/opendj-sdk/opends/tests/system-tests/phases/shared/functions/utils.xml
+++ b/opendj-sdk/opends/tests/system-tests/phases/shared/functions/utils.xml
@@ -860,12 +860,23 @@
</else>
</if>
+ <script>
+ isList = FALSE
+ try:
+ if len(expectedRC) >= 0:
+ isList = TRUE
+ except:
+ isList = FALSE
+
+ if isList == FALSE:
+ expectedRC = [expectedRC]
+ </script>
<if expr="expectedRC != 'noCheck'">
<call function="'checkRC'">
{ 'returncode' : cmdRC,
'result' : cmdOutput,
- 'expected' : [expectedRC],
+ 'expected' : expectedRC,
'fileFd' : fileFd
}
</call>
--
Gitblit v1.10.0