<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
|
<!--
|
! CDDL HEADER START
|
!
|
! The contents of this file are subject to the terms of the
|
! Common Development and Distribution License, Version 1.0 only
|
! (the "License"). You may not use this file except in compliance
|
! with the License.
|
!
|
! You can obtain a copy of the license at
|
! trunk/opends/resource/legal-notices/OpenDS.LICENSE
|
! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
|
! See the License for the specific language governing permissions
|
! and limitations under the License.
|
!
|
! When distributing Covered Code, include this CDDL HEADER in each
|
! file and include the License file at
|
! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
|
! add the following below this CDDL HEADER, with the fields enclosed
|
! by brackets "[]" replaced with your own identifying information:
|
! Portions Copyright [yyyy] [name of copyright owner]
|
!
|
! CDDL HEADER END
|
!
|
! Copyright 2008 Sun Microsystems, Inc.
|
! -->
|
<stax>
|
|
<defaultcall function="verdict"/>
|
|
|
<!-- ************************************************************ -->
|
<function name="verdict">
|
<function-map-args>
|
<function-arg-def name="instances" type="required">
|
<function-arg-description>
|
list of instance objects
|
</function-arg-description>
|
</function-arg-def>
|
<function-arg-def name="suffix" type="required">
|
<function-arg-description>
|
suffix object
|
</function-arg-description>
|
</function-arg-def>
|
<function-arg-def name="runConfiguration" type="required">
|
<function-arg-description>
|
boolean : configuration phase has been run or not
|
</function-arg-description>
|
</function-arg-def>
|
<function-arg-def name="runScheduler" type="required">
|
<function-arg-description>
|
boolean : scheduler phase has been run or not
|
</function-arg-description>
|
</function-arg-def>
|
</function-map-args>
|
|
<sequence>
|
<!--========== Call preambule =========-->
|
<call function="'phasePreamble'">
|
{ 'phaseName' : 'verdict',
|
'fileFd' : LOG_MAIN_FD }
|
</call>
|
<import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
|
file="'%s/phases/verdict/verdict_opends.xml' % (TESTS_DIR)"/>
|
|
|
|
<!--== Check if previous phases raised some errors ==-->
|
<if expr="ERR_NUM_INSTALL != 0 and ERR_NUM_INSTALL != ''">
|
<script> ERR_NUM[0] += 1 </script>
|
</if>
|
<if expr="ERR_NUM_GEN_LDIF != 0 and ERR_NUM_GEN_LDIF != ''">
|
<script> ERR_NUM[0] += 1 </script>
|
</if>
|
<if expr="ERR_NUM_CONFIGURATION != 0 and ERR_NUM_CONFIGURATION != ''">
|
<script> ERR_NUM[0] += 1 </script>
|
</if>
|
<if expr="ERR_NUM_SCHEDULER != 0 and ERR_NUM_SCHEDULER != ''">
|
<script> ERR_NUM[0] += 1 </script>
|
</if>
|
|
|
<!--== If configuration/schedulers phases have been run ==-->
|
<!--== then do some basic checks : isalive ==-->
|
<if expr="runConfiguration == 'true' or runScheduler == 'true'">
|
<sequence>
|
<script>
|
fileList = STAXGlobal([])
|
</script>
|
<script>
|
topoInstances = suffix.getTopology()
|
</script>
|
<paralleliterate in="topoInstances" var="topoInstance">
|
<sequence>
|
<!-- parallel process, all variables defined -->
|
<!-- and values set below are local to the sequence -->
|
<script>
|
|
instance = topoInstance.getInstanceRef()
|
|
logName = '%s_%s' % (instance.getHost(),instance.getName())
|
logFile = '%s/verdict_%s.xml' % (LOG_XML_TMP_DIR,logName)
|
fileList.append(logFile)
|
|
cFileFd = open(logFile,'w')
|
# Write start tag
|
str = '<instance name=\"%s\"' % instance.getName()
|
str = '%s host=\"%s\"' % (str, instance.getHost())
|
str = '%s port=\"%s\"' % (str, instance.getLDAPPort())
|
str = '%s product=\"opends\">\n' % str
|
cFileFd.write(str)
|
</script>
|
|
<if expr="instance.getProduct() == 'opends'">
|
<call function="'verdictOpends'">
|
{
|
'instance' : instance,
|
'instances' : topoInstances,
|
'suffix' : suffix,
|
'fileFd' : cFileFd
|
}
|
</call>
|
</if>
|
|
<!--== Post operations ======-->
|
<message>
|
'%s : %s : verdict complete' % \
|
(instance.getHost(),instance.getName())
|
</message>
|
|
<script>
|
cFileFd.write('</instance>\n')
|
cFileFd.close()
|
cFileFd = ''
|
</script>
|
|
</sequence>
|
</paralleliterate>
|
</sequence>
|
</if>
|
|
|
<!--========== Merge files ==========-->
|
<call function="'mergeFiles'">
|
{
|
'fileList' : fileList,
|
'fileFd' : LOG_MAIN_FD
|
}
|
</call>
|
|
<!--========== Call postphase =========-->
|
<call function="'phasePostamble'">
|
{
|
'phaseName' : 'verdict',
|
'fileFd' : LOG_MAIN_FD
|
}
|
</call>
|
|
</sequence>
|
</function>
|
|
|
|
|
|
|
</stax>
|