<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<!DOCTYPE stax SYSTEM "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
|
*
|
*
|
* Portions Copyright 2006 Sun Microsystems, Inc.
|
-->
|
<stax>
|
|
<function name="configureDS">
|
|
<function-prolog>
|
This function configures a Directory Server
|
</function-prolog>
|
|
<function-map-args>
|
<function-required-arg name="dsInstancePort">
|
Directory Server port number
|
</function-required-arg>
|
<function-required-arg name="dsInstanceSuffix">
|
Directory Server suffix
|
</function-required-arg>
|
|
</function-map-args>
|
|
<sequence>
|
|
<process name="'Configure DS'">
|
<location>'%s' % (STAF_REMOTE_HOSTNAME) </location>
|
<command>'%s/configure-ds.%s' % (OPENDS_BINPATH,fileExt)</command>
|
<parms>'-p %s -b "%s"' % (dsInstancePort,dsInstanceSuffix)</parms>
|
<workdir>'%s' % (OPENDS_BINPATH)</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % (OPENDS_BINPATH), 'JAVA_HOME=%s' % (JAVA_HOME)]
|
</envs>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
</sequence>
|
|
</function>
|
|
<function name="startDS">
|
|
<function-prolog>
|
This function starts a Directory Server
|
</function-prolog>
|
|
<function-map-args>
|
<function-required-arg name="dsbinpath">
|
location of the Directory Server binaries
|
</function-required-arg>
|
|
</function-map-args>
|
|
<sequence>
|
|
<process name="'Start DS'">
|
<location>'%s' % (STAF_REMOTE_HOSTNAME) </location>
|
<command>'%s/start-ds.%s' % (dsbinpath,fileExt)</command>
|
<workdir>'%s' % (dsbinpath)</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % (dsbinpath), 'JAVA_HOME=%s' % (JAVA_HOME)]
|
</envs>
|
<console use="'same'"/>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
</sequence>
|
|
</function>
|
|
<function name="stopDS">
|
|
<function-prolog>
|
This function stops a Directory Server
|
</function-prolog>
|
|
<function-map-args>
|
<function-required-arg name="dsInstancePort">
|
Directory Server port number
|
</function-required-arg>
|
|
</function-map-args>
|
|
<sequence>
|
|
<process name="'Stop DS'">
|
<location>'%s' % (STAF_REMOTE_HOSTNAME) </location>
|
<command>'%s/stop-ds.%s' % (OPENDS_BINPATH,fileExt)</command>
|
<parms>'-p %s' % (dsInstancePort)</parms>
|
<workdir>'%s' % (OPENDS_BINPATH)</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % (OPENDS_BINPATH), 'JAVA_HOME=%s' % (JAVA_HOME)]
|
</envs>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
</sequence>
|
|
</function>
|
|
<function name="genServerJKSCert">
|
|
<function-prolog>
|
This function generates a server jks certificate
|
</function-prolog>
|
|
<sequence>
|
|
<process name="'Generate Server JKS Certificate'">
|
<location>'%s' % (STAF_REMOTE_HOSTNAME) </location>
|
<command>'keytool'</command>
|
<parms>'-genkey -alias server-cert -keyalg rsa -dname "cn=client,O=Sun Microsystems,C=US" -keystore "keystore" -storepass "servercert" -keypass "servercert"'</parms>
|
<workdir>'%s/../config' % (OPENDS_BINPATH)</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % (OPENDS_BINPATH), 'JAVA_HOME=%s' % (JAVA_HOME)]
|
</envs>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
</sequence>
|
|
</function>
|
|
<function name="genServerPKCS12Cert">
|
|
<function-prolog>
|
This function generates a server PKCS12 certificate
|
</function-prolog>
|
|
<sequence>
|
|
<process name="'Generate Server PKCS12 Certificate'">
|
<location>'%s' % (STAF_REMOTE_HOSTNAME) </location>
|
<command>'keytool'</command>
|
<parms>'-genkey -alias server-cert -keyalg rsa -dname "cn=client,O=Sun Microsystems,C=US" -keystore "keystore" -storepass "servercert" -keypass "servercert" -storetype "PKCS12"'</parms>
|
<workdir>'%s/../config' % (OPENDS_BINPATH)</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % (OPENDS_BINPATH), 'JAVA_HOME=%s' % (JAVA_HOME)]
|
</envs>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
</sequence>
|
|
</function>
|
|
<function name="selfSignServerJKSCert">
|
|
<function-prolog>
|
This function self-signs a server JKS certificate
|
</function-prolog>
|
|
<sequence>
|
|
<process name="'Self-Signs Server JKS Certificate'">
|
<location>'%s' % (STAF_REMOTE_HOSTNAME) </location>
|
<command>'keytool'</command>
|
<parms>'-selfcert -alias server-cert -keystore "keystore" -storepass "servercert"'</parms>
|
<workdir>'%s/../config' % (OPENDS_BINPATH)</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % (OPENDS_BINPATH), 'JAVA_HOME=%s' % (JAVA_HOME)]
|
</envs>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
</sequence>
|
|
</function>
|
|
<function name="selfSignServerPKCS12Cert">
|
|
<function-prolog>
|
This function self-signs a server PKCS12 certificate
|
</function-prolog>
|
|
<sequence>
|
|
<process name="'Self-Signs Server PKCS12 Certificate'">
|
<location>'%s' % (STAF_REMOTE_HOSTNAME) </location>
|
<command>'keytool'</command>
|
<parms>'-selfcert -alias server-cert -keystore "keystore" -storepass "servercert" -storetype "PKCS12"'</parms>
|
<workdir>'%s/../config' % (OPENDS_BINPATH)</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % (OPENDS_BINPATH), 'JAVA_HOME=%s' % (JAVA_HOME)]
|
</envs>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
</sequence>
|
|
</function>
|
|
<!-- Import Function -->
|
<function name="importLdif">
|
|
<function-prolog>
|
This function performs an offline import of an ldif file
|
</function-prolog>
|
|
<function-map-args>
|
<function-required-arg name="ldifFile">
|
The name of the ldif file
|
</function-required-arg>
|
<function-optional-arg name="backEnd" default="'userRoot'">
|
The name of the database backend
|
</function-optional-arg>
|
<function-optional-arg name="extraParams" default="' '">
|
Optional extra parameters for specific test cases
|
</function-optional-arg>
|
</function-map-args>
|
|
<sequence>
|
|
<message>
|
'import-ldif.%s -l %s -n %s %s' % (fileExt,ldifFile,backEnd,extraParams)
|
</message>
|
<process name="'Offline Import'">
|
<location>'%s' % (STAF_REMOTE_HOSTNAME) </location>
|
<command>'%s/import-ldif.%s' % (OPENDS_BINPATH,fileExt)</command>
|
<parms>'-l %s -n %s %s' % (ldifFile,backEnd,extraParams)</parms>
|
<workdir>'%s' % (OPENDS_BINPATH)</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % (OPENDS_BINPATH), 'JAVA_HOME=%s' % (JAVA_HOME)]
|
</envs>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<script>
|
importRC=RC
|
importResult=STAXResult
|
</script>
|
|
<call function="'checkRC'">
|
{ 'returncode' : importRC ,
|
'result' : importResult }
|
</call>
|
|
<return>importRC</return>
|
|
</sequence>
|
|
</function>
|
|
<!-- Check Import Function -->
|
<function name="checkImport">
|
|
<function-prolog>
|
This function verifies an import of an ldif file
|
</function-prolog>
|
|
<function-map-args>
|
<function-required-arg name="expectedEntries">
|
Entries expected to be present after import
|
</function-required-arg>
|
<function-optional-arg name="missingEntries" default="'NULL'">
|
Optional entries expected to be present after import
|
</function-optional-arg>
|
<function-optional-arg name="expectedAttributes" default="'NULL'">
|
Optional attributes expected to be present after import
|
</function-optional-arg>
|
<function-optional-arg name="missingAttributes" default="'NULL'">
|
Optional attributes expected to be present after import
|
</function-optional-arg>
|
<function-optional-arg name="suffix" default="'dc=com'">
|
Optional main suffix for the import
|
</function-optional-arg>
|
<function-optional-arg name="startDS" default="'yes'">
|
Optional start the Directory Server after import
|
</function-optional-arg>
|
</function-map-args>
|
|
<sequence>
|
|
<!-- StartDS -->
|
<call function="'startDS'">
|
{ 'dsbinpath' : '%s' % (OPENDS_BINPATH) }
|
</call>
|
|
<!-- Wait for DS to start -->
|
<call function="'isAlive'">
|
{ 'noOfLoops' : 5 ,
|
'noOfMilliSeconds' : 2000 }
|
</call>
|
|
<!-- Search for expected entries -->
|
<iterate var="expectedEntry" in="expectedEntries">
|
|
<sequence>
|
|
<call function="'SearchObject'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : '%s' % expectedEntry ,
|
'dsFilter' : 'objectclass=*'
|
}
|
</call>
|
|
<call function="'checktestRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
</sequence>
|
|
</iterate>
|
|
<!-- Search for missing entries -->
|
<iterate var="missingEntry" in="missingEntries">
|
|
<sequence>
|
|
<if expr="missingEntry == 'NULL'">
|
<break/>
|
</if>
|
|
<call function="'SearchObject'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : '%s' % missingEntry ,
|
'dsFilter' : 'objectclass=*'
|
}
|
</call>
|
|
<call function="'checktestRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult,
|
'expected' : 32 }
|
</call>
|
|
</sequence>
|
|
</iterate>
|
|
<!-- StopDS -->
|
<call function="'stopDS'">
|
{ 'dsInstancePort' : '%s' % (DIRECTORY_INSTANCE_PORT) }
|
</call>
|
|
</sequence>
|
|
</function>
|
|
</stax>
|