clus_ssl_ldapsearch.xml revision 75e4d72341a69fa125aeab6e326e49a5422a9eac
<?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 2010 Sun Microsystems, Inc.
! Portions Copyright 2013 ForgeRock AS
! -->
<stax>
<defaultcall function="clus_ssl_ldapsearch"/>
<function name="clus_ssl_ldapsearch" scope="local">
<sequence>
<block name="'clus_ssl_ldapsearch'">
<sequence>
<!--- Test Suite information
#@TestSuiteName SSL ldapsearch check behaviors
#@TestSuitePurpose Test the results of ssl ldapsearch command
#@TestSuiteGroup SSL behaviors
#@TestScript clus_ssl_ldapsearch.xml
-->
<script>
if not CurrentTestPath.has_key('group'):
CurrentTestPath['group'] = 'clu_secure'
CurrentTestPath['suite'] = STAXCurrentBlock
</script>
<call function="'testSuite_Preamble'"/>
<!--- Test Case information
#@TestMarker SSL ldapsearch check behaviors
#@TestName Client blind trust : ldapsearch
#@TestIssue none
#@TestPurpose Verify that the operation is successful and
the number of returned entries is correct,
when client trust all server cerificates.
#@TestPreamble none
#@TestStep Do a SSL ldapsearch with postal code filter.
#@TestPostamble none
#@TestResult Success if user is found and postal code
is 36500.
-->
<testcase name="getTestCaseName('Client blind trust : ldapsearch')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: SSL Check behaviors: ldapsearch client trustall \
server cert'
</message>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_SSL_PORT ,
'dsUseSSL' : ' ' ,
'dsTrustAll' : ' ' ,
'dsBaseDN' : 'dc=com' ,
'dsFilter' : 'uid=user.340' ,
'dsAttributes' : 'postalCode'
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : 'postalCode: 36500'
}
</call>
<if expr="not is_windows_platform(STAF_REMOTE_HOSTNAME)">
<sequence>
<message>
'Security: SSL Check behaviors: ldapsearch, client trustall \
server cert,missing Trustall option'
</message>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_SSL_PORT ,
'dsUseSSL' : ' ' ,
'dsBaseDN' : 'dc=com' ,
'dsFilter' : 'uid=user.340' ,
'dsAttributes' : 'postalCode',
'expectedRC' : 'noCheck',
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : 'server is using the following certificate'
}
</call>
</sequence>
</if>
<message>
'Security: SSL Check behaviors: ldapsearch, client trustall \
server cert,wrong port'
</message>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsUseSSL' : ' ' ,
'dsTrustAll' : ' ' ,
'dsBaseDN' : 'dc=com' ,
'dsFilter' : 'uid=user.340' ,
'dsAttributes' : 'postalCode',
'expectedRC' : 'noCheck'
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : 'Unrecognized SSL message'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker SSL ldapsearch check behaviors
#@TestName Client use a TrustStore file : ldapsearch
#@TestIssue none
#@TestPurpose Verify that the operation is successful and
the number of returned entries is correct,
when client uses a TrustStore file.
#@TestPreamble none
#@TestStep Do a ssl ldapsearch with postal code filter.
#@TestPostamble none
#@TestResult Success if user is found and postal code
is 86150.
-->
<testcase name="getTestCaseName ('Client use TrustStore file : ldapsearch')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: SSL Check behaviors: ldapsearch, client truststore'
</message>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_SSL_PORT ,
'dsUseSSL' : ' ' ,
'dsTrustStorePath' : '%s/client_cert/clientruststore' \
% InstanceInstallDir,
'dsTrustStorePassword': 'clientruststorepass',
'dsBaseDN' : 'dc=com' ,
'dsFilter' : 'uid=user.440' ,
'dsAttributes' : 'postalCode'
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : 'postalCode: 86150'
}
</call>
<message>
'Security: SSL Check behaviors: ldapsearch, client truststore, \
wrong TrustStore file path'
</message>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_SSL_PORT ,
'dsUseSSL' : ' ' ,
'dsTrustStorePath' : '%s/config/serverkeystore' \
%InstanceInstallDir,
'dsTrustStorePassword': 'clientruststorepass',
'dsBaseDN' : 'dc=com' ,
'dsFilter' : 'uid=user.440' ,
'dsAttributes' : 'postalCode',
'expectedRC' : 'noCheck'
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : 'Cannot load the key store'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<call function="'testSuite_Postamble'"/>
</sequence>
</block>
</sequence>
</function>
</stax>