security_setup_pkcs12.xml revision d25372dc8e65a9ed019a88fdf659ca61313f1b31
<?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 2006-2008 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="setup_pkcs12"/>
<function name="setup_pkcs12">
<!---
Place group-specific test information here.
#@TestGroupName Security
#@TestGroupPurpose To test the security functionality.
#@TestSubgroupName PKCS12 Keystore
Place suite-specific test information here.
#@TestSuiteName Setup Tests
#@TestSuitePurpose Configure OpenDS to use PKCS12 keystore and a secure port.
#@TestSuiteGroup Security PKCS12 Setup Tests
#@TestScript security_setup_pkcs12.xml
-->
<sequence>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Setup Tests
#@TestName PKCS12 Startup Test
#@TestIssue 414
#@TestPurpose Setup OpenDS for PKCS12 keystore.
#@TestPreamble none
#@TestStep Generate server certificate.
#@TestStep Self-sign the server certificate.
#@TestStep Configure PKCS12 keystore.
#@TestStep Test search with secure port.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0 for all operations
-->
<!--- Test Case : PKCS12 Setup -->
<!--- Generate Server Cert -->
<testcase name="getTestCaseName('Preamble Setup')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: PKCS12: Preamble Step 1. Generating Server PKCS12 Certicate'
</message>
<call function="'genCertificate'">
{ 'certAlias' : 'server-cert' ,
'dname' : "cn=client,O=Sun Microsystems,C=US",
'keystore' : 'keystore',
'storepass' : 'servercert',
'keypass' : 'servercert',
'storetype' : 'PKCS12' }
</call>
<!--- Self-Sign Server Cert -->
<message>
'Security: PKCS12: Preamble Step 2. Self-Signing Server PKCS12 Certicate'
</message>
<call function="'SelfSignCertificate'">
{ 'certAlias' : 'server-cert' ,
'storepass' : 'servercert',
'keypass' : 'servercert',
'keystore' : 'keystore',
'storetype' : 'PKCS12' }
</call>
<!--- Configure PKCS12 Keystore -->
<message>
'Security: PKCS12: Preamble Step 3. Configuring PKCS12 Keystore'
</message>
<call function="'configureSSL'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'keystoreType' : 'PKCS12' }
</call>
<!--- Initial Search With SSL -->
<message>
'Security: PKCS12: Preamble Step 4. Searching with SSL Connection'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_SSL_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-Z -X' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
</function>
</stax>