<?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-2009 Sun Microsystems, Inc.
! Portions Copyright 2013 ForgeRock AS
! -->
<stax>
<defaultcall function="clu_ldapcompare_checkbehavior"/>
<function name="clu_ldapcompare_checkbehavior">
<sequence>
<block name="'clu_ldapcompare_checkbehavior'">
<try>
<sequence>
<!--- Test Suite information
#@TestSuiteName ldapcompare check behavior tests
#@TestSuitePurpose Test the results of the ldapcompare command.
#@TestSuiteGroup ldapcompare check behavior tests
#@TestScript clu_ldapcompare_checkresults.xml
-->
<script>
if not CurrentTestPath.has_key('group'):
CurrentTestPath['group'] = 'clu'
CurrentTestPath['suite'] = STAXCurrentBlock
</script>
<call function="'testSuite_Preamble'"/>
<call function="'common_setup'">
{
'quickStart' : False ,
'loadData' : True ,
'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
'startServer' : True ,
'stopServer' : False ,
'allowPreEncodePassword' : True
}
</call>
<!--- Define default value for dsdn -->
<script>
dsdn = 'uid=user.0,ou=ldapcompare,o=clu tests,dc=example,dc=com'
</script>
<!--- Test Case information
#@TestMarker ldapcompare check behavior tests
#@TestName ldapcompare: comparison successful
#@TestIssue none
#@TestPurpose Verify that the operation is successful and
that the comparison is successful with
useCompareResultCode option.
#@TestPreamble none
#@TestStep Do an ldapcompare with useCompareResultCode
option.
#@TestPostamble none
#@TestResult Success if ldapcompare returns 6.
-->
<testcase name="getTestCaseName
('ldapcompare: comparison successful with useCompareResultCode option')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ldapcompare: comparison successful'
</message>
<call function="'ldapCompareWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsDn' : ['postalCode:63792' ,
'%s' % dsdn] ,
'expectedRC' : 6
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<script>
msg = 'Compare operation returned true'
</script>
<call function="'searchString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker ldapcompare check behavior tests
#@TestName ldapcompare: comparison unsuccessful
#@TestIssue none
#@TestPurpose Verify that the operation is successful and
that the comparison is unsuccessful with
useCompareResultCode option.
#@TestPreamble none
#@TestStep Do an ldapcompare with with
useCompareResultCode option.
#@TestPostamble none
#@TestResult Success if ldapcompare returns 5.
-->
<testcase name="getTestCaseName
('ldapcompare: comparison unsuccessful with useCompareResultCode option')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ldapcompare: comparison unsuccessful'
</message>
<call function="'ldapCompareWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsDn' : ['postalCode:00000' ,
'%s' % dsdn] ,
'expectedRC' : 5
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<script>
msg = 'Compare operation returned false'
</script>
<call function="'searchString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker ldapcompare check behavior tests
#@TestName ldapcompare: comparison successful
#@TestIssue none
#@TestPurpose Verify that the operation is successful and
that the comparison is successful.
#@TestPreamble none
#@TestStep Do an ldapcompare with correct options.
#@TestPostamble none
#@TestResult Success if ldapcompare returns 0.
-->
<testcase name="getTestCaseName
('ldapcompare: comparison successful')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ldapcompare: comparison successful'
</message>
<call function="'ldapCompareWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsDn' : ['postalCode:63792' ,
'%s' % dsdn] ,
'useCmpRC' : 'False' ,
'expectedRC' : 0
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<script>
msg = 'Compare operation returned true'
</script>
<call function="'searchString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker ldapcompare check behavior tests
#@TestName ldapcompare: comparison unsuccessful
#@TestIssue none
#@TestPurpose Verify that the operation is successful and
that the comparison is unsuccessful.
#@TestPreamble none
#@TestStep Do an ldapcompare with correct options.
#@TestPostamble none
#@TestResult Success if ldapcompare returns 0.
-->
<testcase name="getTestCaseName
('ldapcompare: comparison unsuccessful')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ldapcompare: comparison unsuccessful'
</message>
<call function="'ldapCompareWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsDn' : ['postalCode:00000' ,
'%s' % dsdn] ,
'useCmpRC' : 'False' ,
'expectedRC' : 0
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<script>
msg = 'Compare operation returned false'
</script>
<call function="'searchString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Define default value for dn1 and dn2 -->
<script>
dn1 = 'uid=user.162,ou=ldapsearch,o=clu tests,dc=example,dc=com'
dn2 = 'uid=user.1,ou=ldapdelete,o=clu tests,dc=example,dc=com'
</script>
<!--- Test Case information
#@TestMarker ldapcompare check behavior tests
#@TestName ldapcompare: multiple comparison successful
#@TestIssue none
#@TestPurpose Verify that the operation is successful and
that the multiple comparison is successful.
#@TestPreamble none
#@TestStep Do an ldapcompare with correct options.
#@TestPostamble none
#@TestResult Success if ldapcompare returns 6.
-->
<testcase name="getTestCaseName
('ldapcompare: multiple comparison successful')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ldapcompare: multiple comparison successful'
</message>
<call function="'ldapCompareWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsDn' : ['st:NY' ,
'%s' % dn1 ,
'%s' % dn2] ,
'expectedRC' : 6
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<script>
msg = 'Compare operation returned true for entry uid=user.162'
</script>
<call function="'searchString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
<script>
msg = 'Compare operation returned true for entry uid=user.1'
</script>
<call function="'searchString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker ldapcompare check behavior tests
#@TestName ldapcompare: multiple comparison unsuccessful
#@TestIssue none
#@TestPurpose Verify that the operation is successful and
that the multiple comparison is unsuccessful.
#@TestPreamble none
#@TestStep Do an ldapcompare with correct options.
#@TestPostamble none
#@TestResult Success if ldapcompare returns 5.
-->
<testcase name="getTestCaseName
('ldapcompare: multiple comparison unsuccessful')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ldapcompare: multiple comparison unsuccessful'
</message>
<call function="'ldapCompareWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsDn' : ['postalCode:89759' ,
'%s' % dn1 ,
'%s' % dn2] ,
'expectedRC' : 5
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<script>
msg = 'Compare operation returned true for entry uid=user.162'
</script>
<call function="'searchString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
<script>
msg = 'Compare operation returned false for entry uid=user.1'
</script>
<call function="'searchString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
<finally>
<sequence>
<!-- Test Suite Cleanup -->
<message>'Finally: Global CLU Cleanup.'</message>
<try>
<call function="'common_cleanup'" />
<catch exception="'STAFException'">
<sequence>
<message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
</sequence>
</catch>
<finally>
<call function="'testSuite_Postamble'"/>
</finally>
</try>
</sequence>
</finally>
</try>
</block>
</sequence>
</function>
</stax>