From f5f9f6de857a54886775c80d7bbca07d08143841 Mon Sep 17 00:00:00 2001
From: al_xipe <al_xipe@localhost>
Date: Thu, 30 Aug 2007 20:28:22 +0000
Subject: [PATCH] 1. fix for knownIssue bug (cast a list to a string) 2. fix testcase_Postamble issue- forgot to close file handlers
---
opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml | 45 ++++++++++++++++++++++++++++++++-------------
1 files changed, 32 insertions(+), 13 deletions(-)
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml b/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
index 856bc93..319c863 100755
--- a/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
+++ b/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
@@ -613,7 +613,7 @@
if len(issuesList)==0:
_status='FAIL'
else:
- _status='KNOWN ISSUES (%s)' % ','.join(issuesList)
+ _status='KNOWN ISSUES %s' % str(issuesList)
</script>
<message level="'status'">'## Test Verdict: %s ##' % _status</message>
<call function="'testCase_EndBanner'" />
@@ -633,9 +633,10 @@
self.log='%s/test.log' % TMPDIR
self.errors='%s/error.log' % TMPDIR
self.access='%s/access.log' % TMPDIR
- open(self.log,'w').write('')
- open(self.errors,'w').write('')
- open(self.access,'w').write('')
+ for f in [self.log,self.errors,self.access]:
+ fh=open(f,'w')
+ fh.write('')
+ fh.close()
self.group=group
self.suite=suite
self.fullname=fullname
@@ -674,15 +675,33 @@
for issue in self.issues:
xml += ' <issue>%s</issue>%s' % (issue,newLine)
xml += ' </issues>%s' % newLine
- xml += ' <log>\n<![CDATA[%s' % newLine
- xml += open(self.log).read()
- xml += ' ]]></log>%s' % newLine
- xml += ' <error>\n<![CDATA[%s' % newLine
- xml += open(self.errors).read()
- xml += ' ]]></error>%s' % newLine
- xml += ' <access>\n<![CDATA[%s' % newLine
- xml += open(self.access).read()
- xml += ' ]]></access>%s' % newLine
+ xml += ' <log>%s' % newLine
+ xml += ' <![CDATA[%s' % newLine
+ if self.result!='pass':
+ # TODO: wrap with try catch to get IOError without stopping the tests
+ fh=open(self.log)
+ xml += fh.read()
+ fh.close()
+ xml += ' ]]>%s' % newLine
+ xml += ' </log>%s' % newLine
+ xml += ' <error>%s' % newLine
+ xml += ' <![CDATA[%s' % newLine
+ if self.result!='pass':
+ # TODO: wrap with try catch to get IOError without stopping the tests
+ fh=open(self.errors)
+ xml += fh.read()
+ fh.close()
+ xml += ' ]]>%s' % newLine
+ xml += ' </error>%s' % newLine
+ xml += ' <access>%s' % newLine
+ xml += ' <![CDATA[%s' % newLine
+ if self.result!='pass':
+ # TODO: wrap with try catch to get IOError without stopping the tests
+ fh=open(self.access)
+ xml += fh.read()
+ fh.close()
+ xml += ' ]]>%s' % newLine
+ xml += ' </access>%s' % newLine
xml += ' </test>%s' % newLine
return xml
--
Gitblit v1.10.0