dsml_setup.xml revision 3680e9009b5c40289ccd748712823730eb0740aa
2cacab200fb387e290386593d9b2fca2e7beef33csovant<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2cacab200fb387e290386593d9b2fca2e7beef33csovant<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
2cacab200fb387e290386593d9b2fca2e7beef33csovant<!--
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! CDDL HEADER START
2cacab200fb387e290386593d9b2fca2e7beef33csovant !
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! The contents of this file are subject to the terms of the
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! Common Development and Distribution License, Version 1.0 only
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! (the "License"). You may not use this file except in compliance
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! with the License.
2cacab200fb387e290386593d9b2fca2e7beef33csovant !
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! You can obtain a copy of the license at
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! See the License for the specific language governing permissions
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! and limitations under the License.
2cacab200fb387e290386593d9b2fca2e7beef33csovant !
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! When distributing Covered Code, include this CDDL HEADER in each
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! file and include the License file at
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! add the following below this CDDL HEADER, with the fields enclosed
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! by brackets "[]" replaced with your own identifying information:
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! Portions Copyright [yyyy] [name of copyright owner]
2cacab200fb387e290386593d9b2fca2e7beef33csovant !
04545c19d1a0771e637bb903fa83321b4a9ca15dcsovant ! CDDL HEADER END
2cacab200fb387e290386593d9b2fca2e7beef33csovant !
2cacab200fb387e290386593d9b2fca2e7beef33csovant ! Portions Copyright 2008-2009 Sun Microsystems, Inc.
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant! -->
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant<stax>
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant <defaultcall function="dsml_setup" />
2cacab200fb387e290386593d9b2fca2e7beef33csovant <function name="dsml_setup">
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant <block name="'dsml_setup'">
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant <sequence>
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant <!--- Test Case information
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant #@TestMarker setup
28eeffb99d4c7f8ff501c22d1d21501cbfe3ad32csovant #@TestName setup: prepare DSML directory server
f5aaa49dba43db0e99f06476534a8749820515dbcsovant #@TestIssue none
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant #@TestPurpose Prepare the directory server necessary to the
f5aaa49dba43db0e99f06476534a8749820515dbcsovant test suite.
04545c19d1a0771e637bb903fa83321b4a9ca15dcsovant #@TestPreamble none
f5aaa49dba43db0e99f06476534a8749820515dbcsovant #@TestStep prepare dsml directory server instance
f5aaa49dba43db0e99f06476534a8749820515dbcsovant #@TestPostamble none
04545c19d1a0771e637bb903fa83321b4a9ca15dcsovant #@TestResult Success if returns 0.
46d65eecfbcfec665501d308ac990af49f7b37aecsovant -->
2cacab200fb387e290386593d9b2fca2e7beef33csovant <testcase name="getTestCaseName('prepare DSML STAF service')">
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant <sequence>
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant <call function="'testCase_Preamble'"/>
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant <call function="'createFolder'">
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant {
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'location' : STAXServiceMachine,
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'foldername' : '%s/dsml/STAF-INF/jars' % TMPDIR
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift }
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift </call>
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift <call function="'unZipFile'">
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift {
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift 'location' : STAXServiceMachine,
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'zipfile' : '%s/%s' % (ZIPPATH, ZIPNAME),
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'file' : '%s/lib/OpenDS.jar' % OPENDSNAME,
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'unzipdir' : '%s/dsml' % TMPDIR
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant }
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant </call>
f5aaa49dba43db0e99f06476534a8749820515dbcsovant
f5aaa49dba43db0e99f06476534a8749820515dbcsovant <call function="'copyFile'">
f5aaa49dba43db0e99f06476534a8749820515dbcsovant {
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'location' : STAXServiceMachine,
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'srcfile' : '%s/dsml/%s/lib/OpenDS.jar' % (TMPDIR,OPENDSNAME),
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'destfile' : '%s/dsml/STAF-INF/jars/OpenDS.jar' % TMPDIR,
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift 'remotehost' : STAXServiceMachine
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant }
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant </call>
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant <call function="'unZipFile'">
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant {
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'location' : STAXServiceMachine,
4307522debc92aa718245251f11a2ecff81c0e75csovant 'zipfile' : DSML_WARPATH,
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'directory': 'WEB-INF/classes',
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'unzipdir' : '%s/dsml' % TMPDIR,
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant }
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant </call>
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant <call function="'copyFolder'">
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant {
2cacab200fb387e290386593d9b2fca2e7beef33csovant 'location' : STAXServiceMachine,
f5aaa49dba43db0e99f06476534a8749820515dbcsovant 'srcfolder' : '%s/dsml/WEB-INF/classes' % TMPDIR,
f5aaa49dba43db0e99f06476534a8749820515dbcsovant 'destfolder' : '%s/dsml/STAF-INF/classes' % TMPDIR,
f5aaa49dba43db0e99f06476534a8749820515dbcsovant 'remotehost' : STAXServiceMachine
f5aaa49dba43db0e99f06476534a8749820515dbcsovant }
2cacab200fb387e290386593d9b2fca2e7beef33csovant </call>
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
3680e9009b5c40289ccd748712823730eb0740aacsovant <script>
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant if is_windows_platform(STAXServiceMachine):
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant separator=';'
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant else:
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant separator=':'
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant opendsjar='%s/dsml/STAF-INF/jars/OpenDS.jar' % TMPDIR
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant dsmlclasses='%s/dsml/STAF-INF/classes' % TMPDIR
2cacab200fb387e290386593d9b2fca2e7beef33csovant </script>
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant <call function="'GetVar'">
2cacab200fb387e290386593d9b2fca2e7beef33csovant {
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift 'location' : STAXServiceMachine,
f5aaa49dba43db0e99f06476534a8749820515dbcsovant 'type' : 'system',
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant 'variable' : 'STAF/Env/CLASSPATH'
da97433d5cd26e422a370d186f98659383c06721csovant }
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift </call>
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant <script>
3c437100238466d9ec716e5491bebfc4c94b13b8csovant cp=STAFResult
3c437100238466d9ec716e5491bebfc4c94b13b8csovant </script>
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift
7105a7fae63b264b6fab32f41a1990c75bfdf524csovant <call function="'compileJava'" >
7105a7fae63b264b6fab32f41a1990c75bfdf524csovant {
2cc2b01027ecfde3503e44c85855bc91805dcc0fugaston 'location' : STAXServiceMachine,
'foldername' : '%s/src' % TESTS_DSML_DIR,
'destfolder' : '%s/dsml/STAF-INF/classes' % TMPDIR,
'classpath' : '%s%s%s%s%s' \
% (opendsjar,separator,dsmlclasses,separator,cp)
}
</call>
<call function="'createFolder'">
{
'location' : location,
'foldername' : '%s/dsml' % local.java
}
</call>
<call function="'createJar'" >
{
'location' : STAXServiceMachine,
'jarname' : '%s/dsml/dsmlService.jar' % local.java,
'entrypoint' : 'STAF-INF',
'pathfolder' : '%s/dsml' % TMPDIR,
'manifestpath' : '%s/MANIFEST.MF' % TESTS_DSML_DIR
}
</call>
<call function="'addSTAFJavaService'" >
{
'location' : STAXServiceMachine,
'serviceName' : 'dsml',
'serviceJar' : '%s/dsml/dsmlService.jar' % local.java,
'J2' : '-Xms128m -Xmx512m'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: prepare DSML directory server
#@TestIssue none
#@TestPurpose Prepare the directory server necessary to the
test suite.
#@TestPreamble none
#@TestStep prepare dsml directory server instance
#@TestPostamble none
#@TestResult Success if returns 0.
-->
<testcase name="getTestCaseName('prepare DSML Directory backend')">
<sequence>
<call function="'testCase_Preamble'"/>
<!-- Create the DS instance necessary to the test group/suite -->
<message>
'prepare instance DS as described in config.py '
</message>
<call function="'prepareInstanceCreation'">
{ 'groupDataDir' : 'dsml',
'fileExtensions' : ['dat','res','issue'] }
</call>
<call function="'checktestRC'">
{
'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: create DSML directory server
#@TestIssue none
#@TestPurpose Create the directory server necessary to the
test suite.
#@TestPreamble none
#@TestStep Create Directory server as defined in config.py.
#@TestPostamble none
#@TestResult Success if returns 0.
-->
<testcase name="getTestCaseName('Create, Initialize and Start DSML Directory backend')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Create DS as described in config.py '
</message>
<call function="'createInstance'"/>
<call function="'checktestRC'">
{
'returncode' : RC ,
'result' : STAXResult
}
</call>
<message>
'Start DS instance'
</message>
<call function="'StartDsWithScript'">
{ 'location' : DIRECTORY_INSTANCE_HOST }
</call>
<call function="'checktestRC'">
{
'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'isAlive'">
{ 'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000 }
</call>
<call function="'checkRC'">
{ 'returncode' : RC ,
'result' : STAXResult }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: import DSML directory server test data
#@TestIssue none
#@TestPurpose Import the directory server test data.
#@TestPreamble none
#@TestStep Import Directory server as defined in config.py.
#@TestPostamble none
#@TestResult Success if returns 0.
-->
<testcase name="getTestCaseName('Import DSML test data in Directory backend')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Import DSML test data'
</message>
<script>
dsmlBaseDNs = {
'o=dsmlfe.com' : ('dsmlfe.ldif', 'dsmlfe_BE', 160),
'dc=example,dc=com' : ('oasis.ldif', 'oasis_BE', 160),
'o=IMC, c=US' : ('search.ldif', 'example_BE', 1084),
}
</script>
<iterate var="baseDN" in="dsmlBaseDNs.keys()">
<sequence>
<message>
'Import DSML test data [%s | %s | %s/%s/db/%s | %s/%s/import-tmp]' %\
(baseDN,\
dsmlBaseDNs.get(baseDN)[1],\
DIRECTORY_INSTANCE_DIR, OPENDSNAME, dsmlBaseDNs.get(baseDN)[1],\
DIRECTORY_INSTANCE_DIR, OPENDSNAME)
</message>
<message>
'Create database backend %s.' % dsmlBaseDNs.get(baseDN)[1]
</message>
<script>
options=[]
options.append('--backend-name %s' % dsmlBaseDNs.get(baseDN)[1])
options.append('--set db-directory:%s' % dsmlBaseDNs.get(baseDN)[1])
options.append('--set base-dn:"%s"' % baseDN)
options.append('--set enabled:true')
options.append('--set writability-mode:enabled')
options.append('-t local-db')
createBackendOptions=' '.join(options)
</script>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'create-backend',
'optionsString' : createBackendOptions
}
</call>
<call function="'importLdifTask'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'taskID' : 'import_%s' % dsmlBaseDNs.get(baseDN)[1],
'ldifFile' : '%s/dsml/ldif-files/%s' % (remote.data,dsmlBaseDNs.get(baseDN)[0]),
'backEnd' : '%s' % dsmlBaseDNs.get(baseDN)[1]
}
</call>
<script>
nbEntriesExpected = dsmlBaseDNs.get(baseDN)[2]
</script>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsCountEntries' : 'True' ,
'dsBaseDN' : baseDN,
'dsFilter' : 'objectclass=*' ,
'expectedRC' : 'noCheck'
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : 'Total number of matching entries: %s' % nbEntriesExpected,
'issue' : '4178'
}
</call>
<call function="'checkRC'">
{ 'returncode' : RC ,
'result' : STAXResult }
</call>
</sequence>
</iterate>
<call function="'checktestRC'">
{
'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: create webcontainer
#@TestIssue none
#@TestPurpose Create the webcontainer necessary to the
test suite.
#@TestPreamble none
#@TestStep Create webcontainer as described in config.py.
#@TestPostamble none
#@TestResult Success if createWebcontainer returns 0.
-->
<testcase name="getTestCaseName('setup: create webcontainer')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'setup: create webcontainer as described in config.py'
</message>
<call function="'createWebcontainer'" />
<call function="'checktestRC'">
{
'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: deploy web application WAR file
#@TestIssue none
#@TestPurpose Deploy web application necessary to the
test suite.
#@TestPreamble none
#@TestStep Deploy web application as described in config.py.
#@TestPostamble none
#@TestResult Success if deployWebApplicationWAR returns 0.
-->
<testcase name="getTestCaseName('setup: deploy Webapplication')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'setup: deploy DSML gateway webapp as described in config.py'
</message>
<call function="'deployWebApplicationWAR'">
{ 'warFilePath' : '%s' % DSML_WARPATH }
</call>
<call function="'checktestRC'">
{
'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: start web webcontainer
#@TestIssue none
#@TestPurpose Start the webcontainer necessary to the
test suite.
#@TestPreamble none
#@TestStep start webcontainer as described in config.py.
#@TestPostamble none
#@TestResult Success if statWebcontainerWithScript returns 0.
-->
<testcase name="getTestCaseName('setup: start webcontainer')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'setup: start webcontainer as described in config.py'
</message>
<call function="'startWebcontainerWithScript'"/>
<stafcmd name="'waiting for webcontainer startup'">
<location>'%s' % location</location>
<service>'delay'</service>
<request>' DELAY 10000'</request>
</stafcmd>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: configure DSML gateway DS port param
#@TestIssue none
#@TestPurpose Set the gateway web.xml param pointing to DS
#@TestPreamble none
#@TestSteps extract web.xml out of DSML war file locally
#@TestSteps substitute default port 389 with DIRECTORY_INSTANCE_PORT
#@TestSteps substitute default directory host localhost with DIRECTORY_INSTANCE_HOST
#@TestSteps overwrite the destination DSML gateway web.xml
#@TestPostamble none
#@TestResult Success if statWebcontainerWithScript returns 0.
-->
<testcase name="getTestCaseName('configure: dsml web.xml port')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'setup: configure DSML gateway DS port param.'
</message>
<script>
myTmpDir='%s/%s' % (local.temp, STAF_REMOTE_HOSTNAME)
</script>
<message>
'Create folder %s on host %s' % (myTmpDir,STAXServiceMachine)
</message>
<call function="'createFolder'">
{ 'location' : STAXServiceMachine,
'foldername' : '%s' % myTmpDir
}
</call>
<call function="'runSTAFCommand'">
{ 'name' : 'Extract DSML gateway web.xml',
'location' : STAXServiceMachine,
'service' : 'ZIP',
'request' : 'UNZIP',
'arguments' : 'ZIPFILE %s TODIRECTORY %s FILE WEB-INF/web.xml' \
% (DSML_WARPATH, myTmpDir)
}
</call>
<script>
webXmlInput=open('%s/WEB-INF/web.xml' % myTmpDir,'r')
import re
portRegEx = re.compile('389')
hostRegEx = re.compile('localhost')
c0=webXmlInput.read()
c1=portRegEx.sub(DIRECTORY_INSTANCE_PORT, c0)
content=hostRegEx.sub(DIRECTORY_INSTANCE_HOST, c1)
webXmlInput.close()
webXmlOutput=open('%s/WEB-INF/web.xml.out' % myTmpDir,'w')
webXmlOutput.write(content)
webXmlOutput.close()
</script>
<message>
'Update DSML gateway web.xml file on host %s' % STAF_REMOTE_HOSTNAME
</message>
<call function="'copyFile'">
{ 'location' : STAXServiceMachine,
'remotehost' : '%s' % STAF_REMOTE_HOSTNAME,
'srcfile' : '%s/WEB-INF/web.xml.out' % myTmpDir,
'destfile' : '%s/%s-%s/webapps/dsml/WEB-INF/web.xml' % (WC_DIRECTORY,WC_TYPE,WC_VERSION)
}
</call>
<call function="'checktestRC'">
{
'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
</block>
</function>
</stax>