tasksPostamble.xml revision d81978a0815d5b8a75633c35e3e1f8708d36f017
2N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
2N/A<!--
2N/A ! CDDL HEADER START
2N/A !
2N/A ! The contents of this file are subject to the terms of the
2N/A ! Common Development and Distribution License, Version 1.0 only
2N/A ! (the "License"). You may not use this file except in compliance
2N/A ! with the License.
2N/A !
2N/A ! You can obtain a copy of the license at
2N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
2N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
2N/A ! See the License for the specific language governing permissions
2N/A ! and limitations under the License.
2N/A !
2N/A ! When distributing Covered Code, include this CDDL HEADER in each
2N/A ! file and include the License file at
2N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
2N/A ! add the following below this CDDL HEADER, with the fields enclosed
2N/A ! by brackets "[]" replaced with your own identifying information:
2N/A ! Portions Copyright [yyyy] [name of copyright owner]
2N/A !
2N/A ! CDDL HEADER END
2N/A !
2N/A ! Copyright 2008 Sun Microsystems, Inc.
2N/A ! -->
2N/A<stax>
2N/A
2N/A <defaultcall function="tasksPostamble"/>
2N/A
2N/A <!-- ************************************************************ -->
2N/A <!-- Client postamble is automatically called by the scheduler -->
2N/A <!-- and must always define all the parameters below -->
2N/A <function name="tasksPostamble" scope="local">
2N/A <function-map-args>
2N/A <function-arg-def name="client" type="required"/>
2N/A <function-arg-def name="instances" type="required"/>
2N/A <function-arg-def name="duration" type="required"/>
2N/A <function-arg-def name="suffix" type="required"/>
2N/A <function-arg-def name="outFile" type="required"/>
2N/A <function-arg-def name="fileFd" type="required"/>
2N/A </function-map-args>
2N/A
2N/A <sequence>
2N/A <!-- =================== Comments =================== -->
2N/A <!-- client is run under paralleliterate tag -->
2N/A <!-- each variables defined are internal -->
2N/A <!-- client should have its own err_num variable in order -->
2N/A <!-- to inform scheduler if it has pass/fail status -->
2N/A <script>
2N/A errNum = 0
2N/A msg = ''
2N/A </script>
2N/A <!-- ================== Parser =================== -->
2N/A <!-- parse the client parameters : -->
2N/A <!-- params is [[param1,val1],[param2,val2],...] -->
2N/A <!-- get the ldap instance parameters -->
2N/A <import machine="'%s' % (client.getHost())"
2N/A file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
2N/A <call function="'%sParser' % client.getName()">
2N/A {
2N/A 'client' : client,
2N/A 'instances' : instances,
2N/A 'duration' : duration,
2N/A 'suffix' : suffix
2N/A }
2N/A </call>
2N/A <if expr="msg.find('ERROR') != -1">
2N/A <sequence>
2N/A <message>'%s' % msg</message>
2N/A <call function="'writeOperationResult'">
2N/A {
2N/A 'returncode' : '1',
2N/A 'expected' : '0',
2N/A 'result' : msg,
2N/A 'status' : 'ERROR',
2N/A 'fileFd' : fileFd
2N/A }
2N/A </call>
2N/A <script>
2N/A errNum += 1
2N/A </script>
2N/A </sequence>
2N/A <else>
2N/A <sequence>
2N/A <process name="'%s:%s: Grep' % (client.getHost(),client.getName())">
2N/A <location>client.getHost()</location>
2N/A <command mode="'shell'">
2N/A "grep -v 'ERROR' %s" % outFile
2N/A </command>
2N/A <envs>['PATH=/bin:/usr/bin']</envs>
2N/A <stderr mode="'stdout'"/>
2N/A <stdout/>
2N/A <returnstdout/>
2N/A </process>
2N/A <script>
2N/A summary = STAXResult[0][1]
2N/A </script>
2N/A <call function="'writeMessage'">
2N/A {'content' : 'Summary %s' % (summary),
2N/A 'fileFd' : fileFd}
2N/A </call>
2N/A </sequence>
2N/A </else>
2N/A </if>
2N/A
2N/A <return> errNum </return>
2N/A
2N/A </sequence>
2N/A </function>
2N/A
2N/A</stax>
2N/A