<?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 legal-notices/CDDLv1_0.txt
! or http://forgerock.org/license/CDDLv1.0.html.
! 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 legal-notices/CDDLv1_0.txt.
! 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 2008 Sun Microsystems, Inc.
! -->
<stax>
<!-- Definition of Test Cases -->
<!--- Test Case : Schema: Add Solaris Schema Entries -->
<!--- Test Case information
#@TestMarker Schema
#@TestName Schema: Add Solaris Schema Entries
#@TestID Test
#@TestPurpose Add Solaris schema entries
#@TestPreamble
#@TestSteps Add over LDAP protocol Solaris schema entries
#@TestPostamble
#@TestResult Test is successful if the result code is 0
-->
<function name="schema_solaris_001" scope="local">
<testcase name="getTestCaseName('Add Solaris Schema Entries')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<script>
solarisLdif='%s/schema/solaris/solaris.ldif' % remote.data
</script>
<call function="'runFunction'">
{ 'functionName' : 'ldapModifyWithScript' ,
'functionMessage' : 'Add solaris schema entries' ,
'functionException' : 'LDAP.ModifyException' ,
'functionArguments' : { 'location' : server.location ,
'dsInstanceHost': server.host ,
'dsInstancePort': server.port ,
'dsInstanceDn' : server.dn ,
'dsInstancePswd': server.password ,
'dsAdd' : 'TRUE' ,
'dsFilename' : solarisLdif }
}
</call>
<call function="'runFunction'">
{ 'functionName' : 'ldapSearchWithScript' ,
'functionMessage' : 'Search for the entry just added and return rfc822mailMember.' ,
'functionException' : 'LDAP.SearchException' ,
'functionArguments' : { 'dsInstanceHost' : server.host ,
'dsInstancePort' : server.port ,
'dsInstanceDn' : server.dn ,
'dsInstancePswd' : server.password ,
'dsBaseDN' : __baseDN ,
'dsFilter' : 'objectclass=*' ,
'dsAttributes' : 'rfc822mailMember' }
}
</call>
<script>
_functionString=parse_stax_result(STAXResult)
</script>
<call function="'runFunction'">
{ 'functionName' : 'checktestString' ,
'functionMessage' : 'Check that the rfc822mailMember attribute is returned.' ,
'functionException' : 'Utils.CheckStringException' ,
'functionArguments' : { 'expectedString' : 'rfc822mailMember: nisMailAlias@sun.com' ,
'returnString' : _functionString }
}
</call>
</sequence>
<catch exception="'STAXException.LDAP.AddException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: LDAPAdd failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<catch exception="'STAXException.LDAP.SearchException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: LDAPSearch failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<catch exception="'STAXException.Utils.CheckStringException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: UtilsCheck failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case : Schema: Add RFC 4876 Schema Entries -->
<!--- Test Case information
#@TestMarker Schema
#@TestName Schema: Add RFC 4876 Schema Entries
#@TestID Test
#@TestPurpose Add RFC 4876 schema entries
#@TestPreamble
#@TestSteps Add over LDAP protocol RFC 4876 schema entries
#@TestPostamble
#@TestResult Test is successful if the result code is 0
-->
<function name="schema_rfc4876_001" scope="local">
<testcase name="getTestCaseName('Add RFC 4876 Schema Entries')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<script>
rfc4876ldif='%s/schema/solaris/rfc4876.ldif ' % remote.data
</script>
<call function="'runFunction'">
{ 'functionName' : 'ldapModifyWithScript' ,
'functionMessage' : 'Add solaris schema entries' ,
'functionException' : 'LDAP.ModifyException' ,
'functionArguments' : { 'location' : server.location ,
'dsInstanceHost': server.host ,
'dsInstancePort': server.port ,
'dsInstanceDn' : server.dn ,
'dsInstancePswd': server.password ,
'dsAdd' : 'TRUE' ,
'dsFilename' : rfc4876ldif }
}
</call>
<call function="'runFunction'">
{ 'functionName' : 'ldapSearchWithScript' ,
'functionMessage' : 'Search for the entry just added and return nisDomain.' ,
'functionException' : 'LDAP.SearchException' ,
'functionArguments' : { 'dsInstanceHost' : server.host ,
'dsInstancePort' : server.port ,
'dsInstanceDn' : server.dn ,
'dsInstancePswd' : server.password ,
'dsBaseDN' : __baseDN ,
'dsFilter' : 'objectclass=*' ,
'dsAttributes' : 'nisDomain' }
}
</call>
<script>
_functionString=parse_stax_result(STAXResult)
</script>
<call function="'runFunction'">
{ 'functionName' : 'checktestString' ,
'functionMessage' : 'Check that the nisDomain attribute is returned.' ,
'functionException' : 'Utils.CheckStringException' ,
'functionArguments' : { 'expectedString' : 'nisDomain: rfc4876' ,
'returnString' : _functionString }
}
</call>
</sequence>
<catch exception="'STAXException.LDAP.AddException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: LDAPAdd failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<catch exception="'STAXException.LDAP.SearchException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: LDAPSearch failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<catch exception="'STAXException.Utils.CheckStringException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: UtilsCheck failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</sequence>
</testcase>
</function>
</stax>