| opends/tests/system-tests/phases/generateLdif/generateLdif.xml | ●●●●● patch | view | raw | blame | history | |
| opends/tests/system-tests/phases/log/topology.xml | ●●●●● patch | view | raw | blame | history | |
| opends/tests/system-tests/phases/parser/parser.py | ●●●●● patch | view | raw | blame | history | |
| opends/tests/system-tests/scenario/conf.dtd | ●●●●● patch | view | raw | blame | history |
opends/tests/system-tests/phases/generateLdif/generateLdif.xml
@@ -85,15 +85,6 @@ <else> <sequence> <!--=========== Generate template ==========--> <script> sys.path.append("%s/phases/parser" % TESTS_DIR ) from parser import * localTemplateFile = '%s/template.ldif' % (LOG_DIR) </script> <call function="'generateTemplate'"> { 'templateFile' : localTemplateFile } </call> <!--=========== For the first host, copy and run makeldif ======--> <script> @@ -108,22 +99,63 @@ ldifFile = '%s/data.ldif' % \ topoElements[0].getInstanceRef().getInstallDir() </script> <call function="'copyFile'"> { 'location' : topoElements[0].getInstanceRef().getHost(), 'srcFile' : localTemplateFile, 'destFile' : templateFile, 'remoteHost' : topoElements[0].getInstanceRef().getHost(), 'fileFd' : LOG_MAIN_FD } </call> <call function="'makeLdif'"> { 'location' : topoElements[0].getInstanceRef().getHost(), 'dsPath' : topoElements[0].getInstanceRef().getInstallDir(), 'templateFile' : templateFile, 'ldifFile' : ldifFile, 'fileFd' : LOG_MAIN_FD } </call> <!--=== If suffix has already a generated ldif file, copy it ====--> <if expr="suffix.getLdifFile() != NOT_DEFINED"> <sequence> <call function="'copyFile'"> { 'location' : STAXServiceMachine, 'srcFile' : suffix.getLdifFile(), 'destFile' : ldifFile, 'remoteHost' : topoElements[0].getInstanceRef().getHost(), 'fileFd' : LOG_MAIN_FD } </call> <message> '%s : copy ldif file done' % topoElements[0].getInstanceRef().getHost() </message> </sequence> <!--=== No ldif file provided, Generate it ===--> <else> <sequence> <!--== Generate and copy the template ==--> <script> sys.path.append("%s/phases/parser" % TESTS_DIR ) from parser import * localTemplateFile = '%s/template.ldif' % (LOG_DIR) </script> <call function="'generateTemplate'"> { 'templateFile' : localTemplateFile } </call> <call function="'copyFile'"> { 'location' : STAXServiceMachine, 'srcFile' : localTemplateFile, 'destFile' : templateFile, 'remoteHost' : topoElements[0].getInstanceRef().getHost(), 'fileFd' : LOG_MAIN_FD } </call> <!--== Run make ldif ==--> <call function="'makeLdif'"> { 'location' : topoElements[0].getInstanceRef().getHost(), 'dsPath' : topoElements[0].getInstanceRef().getInstallDir(), 'templateFile' : templateFile, 'ldifFile' : ldifFile, 'fileFd' : LOG_MAIN_FD } </call> <message> '%s : makeLDIF done' % topoElements[0].getInstanceRef().getHost() </message> </sequence> </else> </if> <!--================== Import ldif file =======================--> <call function="'ImportLdifWithScript'"> { 'location' : topoElements[0].getInstanceRef().getHost(), @@ -134,7 +166,7 @@ } </call> <message> '%s : makeLDIF done' % topoElements[0].getInstanceRef().getHost() '%s : importLDIF done' % topoElements[0].getInstanceRef().getHost() </message> <script>LOG_MAIN_FD.write('</instance>\n')</script> opends/tests/system-tests/phases/log/topology.xml
@@ -263,9 +263,14 @@ topoMsg = '%s\n</topology>\n' % topoMsg # SUFFIX DATA suffixDataForXml = NOT_DEFINED root = suffix.getTree() suffixDataForXml = getSuffixDataForXML(suffix.getSuffixDn(),root) # Get ldif file if specified in conf.xml suffixDataForXml = suffix.getLdifFile() nbOfEntries = 'unknown' # if ldif file is not specified in conf.xml, get the tree data if suffixDataForXml == NOT_DEFINED: root = suffix.getTree() suffixDataForXml = getSuffixDataForXML(suffix.getSuffixDn(),root) nbOfEntries = suffix.getNbOfEntries() </script> <call function="'writeStartTag'"> { @@ -281,7 +286,7 @@ 'content' : '\n %s \ <numberOfEntries>%s</numberOfEntries>\n \ %s \n \ ' % (topoMsg,suffix.getNbOfEntries(),suffixDataForXml) ' % (topoMsg,nbOfEntries,suffixDataForXml) } </call> <call function="'writeEndTag'"> opends/tests/system-tests/phases/parser/parser.py
@@ -148,12 +148,13 @@ """Describes suffix information, tree is a list of Branch objectclasses topology is a list of SuffixTopology objectclasses""" def __init__(self, sid, dn, topology, nbOfEntries, tree): def __init__(self, sid, dn, topology, nbOfEntries, tree, ldifFile): self.sid = sid self.dn = dn self.topology = topology self.nbOfEntries = nbOfEntries self.tree = tree self.ldifFile = ldifFile def getId(self): return self.sid @@ -181,7 +182,9 @@ def getTree(self): return self.tree def getLdifFile(self): return self.ldifFile # # Class for instance @@ -642,6 +645,8 @@ msg = '' cSuffixReplServers = NOT_DEFINED cNbOfEntries = NOT_DEFINED cBranches = NOT_DEFINED cLdifFile = NOT_DEFINED # # Parsing second level : instanceList,numberOfEntries,... @@ -695,8 +700,9 @@ (msg,thisSubChild.getNodeName()) elif (thisSubChild.getNodeType() == Node.ELEMENT_NODE and thisSubChild.getNodeName() == 'numberOfEntries'): cNbOfEntries = _getPropValue(thisSubChild) thisSubChild.getNodeName() == 'ldifFile'): cLdifFile = _getPropValue(thisSubChild) cLdifFile = cLdifFile.strip() # parsing suffix TREE elif (thisSubChild.getNodeType() == Node.ELEMENT_NODE and @@ -728,7 +734,8 @@ else: msg = '%s\n ERROR: parseSuffix() : no children for suffix node' % msg return [msg,Suffix(cId,cSuffixName,cSuffixReplServers,cNbOfEntries,cBranches)] return [msg,Suffix(cId,cSuffixName,cSuffixReplServers,\ cNbOfEntries,cBranches,cLdifFile)] opends/tests/system-tests/scenario/conf.dtd
@@ -56,7 +56,7 @@ <!-- ========== SUFFIX NODE ========================= --> <!ELEMENT suffix (topology,tree)> <!ELEMENT suffix (topology,ldifFile?,tree?)> <!ATTLIST suffix dn CDATA #REQUIRED> @@ -67,6 +67,7 @@ initRule ( importLdif | totalUpdate ) "importLdif" instanceSourceName NMTOKEN #IMPLIED> <!ELEMENT ldifFile (#PCDATA)> <!ELEMENT tree (branch+,subordinateTemplate*)> <!ATTLIST tree nbOfEntries CDATA #REQUIRED>