From 936802b266b33db53f92707e7b92f381e87ed290 Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Mon, 21 Dec 2009 16:44:30 +0000
Subject: [PATCH] Frontport of 2.2 tests to the trunk

---
 opends/tests/staf-tests/shared/python/common.py |   66 ++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 1 deletions(-)

diff --git a/opends/tests/staf-tests/shared/python/common.py b/opends/tests/staf-tests/shared/python/common.py
index 6026b4d..914f9ac 100644
--- a/opends/tests/staf-tests/shared/python/common.py
+++ b/opends/tests/staf-tests/shared/python/common.py
@@ -47,7 +47,9 @@
             "list2dn",
             "dn2rfcmailaddr",
             "java_properties",
-            "xmldoc_service" ]
+            "xmldoc_service" ,
+            "xml_create_report" ,
+            "group_to_run" ]
 
 class format_testcase:
   'Format the Test name objects'
@@ -681,4 +683,66 @@
       tag.setAttributeNode(newAttribute)
     except:
       print "exception: %s" % traceback.format_exception(*sys.exc_info())
+  
+def xml_add_text_node(doc,parent,name,ntext):
+
+  node = doc.createElement(name)
+  text = doc.createTextNode('%s' % ntext)
+  node.appendChild(text)
+  parent.appendChild(node)
+
+def xml_create_report(pname,type,path,info,misc,testdir,report):
+
+  xml=xmldoc_service()
+        
+  builder = xml.createBlankDocument()
+  
+  doc = builder.newDocument()
+  root = doc.createElement("qa")
+  doc.appendChild(root)
+  ft = doc.createElement("%s" % type)
+  root.appendChild(ft);
+  
+  # Identification
+  id = doc.createElement("identification")
+  ft.appendChild(id)
+
+  sut = doc.createElement("sut")
+  xml.createAttr(doc,sut,"product","opends")
+  id.appendChild(sut)
+
+  xml_add_text_node(doc,sut,'name',pname)
+  xml_add_text_node(doc,sut,'path',path)
+  xml_add_text_node(doc,sut,'version',info['server version'])
+  xml_add_text_node(doc,sut,'buildid',info['server buildid'])      
+  xml_add_text_node(doc,sut,'revision',info['svn revision'])
+  xml_add_text_node(doc,sut,'hostname',info['system name'])
+  xml_add_text_node(doc,sut,'platform',info['system os'])
+  xml_add_text_node(doc,sut,'jvm-version',info['jvm version'])  
+  xml_add_text_node(doc,sut,'jvm-label',misc['jvm label'])
+  xml_add_text_node(doc,sut,'jvm-vendor',info['jvm vendor'])
+  xml_add_text_node(doc,sut,'jvm-arch',info['jvm architecture'])
+  xml_add_text_node(doc,sut,'jvm-args','TBD')
+  xml_add_text_node(doc,sut,'jvm-home','TBD')
+  xml_add_text_node(doc,sut,'jvm-bin','TDB')
+  xml_add_text_node(doc,sut,'os-label',misc['os label'])
+  xml_add_text_node(doc,sut,'server-package',misc['server package'])
+  xml_add_text_node(doc,sut,'snmp-jarfile',misc['snmp jarfile'])
+  xml_add_text_node(doc,sut,'md5-sum','TBD')
+
+  xml_add_text_node(doc,id,'tests-dir',testdir)
+
+  # Test Results
+  results = doc.createElement("results")
+  ft.appendChild(results)
+  
+  xml.writeXMLfile(doc,report)
+
+class group_to_run:
+  def __init__(self, name):
+    self.name = name
+
+  def getName(self):
+    return self.name
+
                                                          

--
Gitblit v1.10.0