5693N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
5693N/A ! The contents of this file are subject to the terms of the 5693N/A ! Common Development and Distribution License, Version 1.0 only 5693N/A ! (the "License"). You may not use this file except in compliance 6982N/A ! You can obtain a copy of the license at 5693N/A ! See the License for the specific language governing permissions 6982N/A ! and limitations under the License. 6982N/A ! When distributing Covered Code, include this CDDL HEADER in each 6982N/A ! file and include the License file at 6982N/A ! add the following below this CDDL HEADER, with the fields enclosed 5693N/A ! by brackets "[]" replaced with your own identifying information: 5693N/A ! Portions Copyright [yyyy] [name of copyright owner] 5693N/A ! Copyright 2013 ForgeRock AS 5693N/A <!-- Definition of Test Cases --> 5693N/A <!--- Test Cases : Basic : Replication Operations --> 5693N/A <!--- Test Case information 5693N/A #@TestMarker Basic: replication operations 5693N/A #@TestName Basic: replication operations 5693N/A #@TestID basic_replication_operations_000 5693N/A #@TestPreamble Common Setup 5693N/A #@TestStep Import sample data 5693N/A #@TestPostamble Common Cleanup 5693N/A #@TestResult Test is successful if the result code is 0 5693N/A <
function name="basic_replication_operations_000" scope="local">
5693N/A <
testcase name="getTestCaseName('Preamble')">
5693N/A <
call function="'testCase_Preamble'"/>
5693N/A <
call function="'StopDsWithScript'">
5693N/A <!-- Check if 'ldifFile' exists --> 5693N/A <
call function="'GetEntry'">
5693N/A 'Preamble: File %s does not exist, create it' % ldifFile
5693N/A 'Preamble: Make an make-ldif template file'
5693N/A <
call function="'MakeAMakeLdifTemplate'">
5693N/A 'numEntries' : numberOfEntries ,
5693N/A 'additionalAttributes' : True ,
5693N/A 'extraLine' : 'userpassword: password' ,
5693N/A 'templateFile' : ldifTemplate ,
5693N/A 'templateLocation' : masterHost
5693N/A 'Preamble: Make the ldif file'
5693N/A <
call function="'MakeLdifWithScript'">
5693N/A 'templateFile' : ldifTemplate ,
5693N/A 'Preamble: File %s exists, do nothing' % ldifFile
5693N/A 'Preamble: Import the ldif file'
5693N/A <
call function="'ImportLdifWithScript'">
5693N/A <
call function="'StartDsWithScript'">
5693N/A 'Preamble: Perform the total update'
5693N/A <
call function="'initializeReplication'">
5693N/A 'sourceInstanceHost' : masterHost,
5693N/A 'replicationDnList' : [synchroSuffix]
5693N/A 'Preamble: Verify the tree synchronization'
5693N/A <
call function="'verifyTreesSdk'">
5693N/A [ clientHost, clientPath, master, consumerList, synchroSuffix ]
5693N/A <
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Basic: replication operations #@TestName Basic: replication operations #@TestID basic_replication_operations_001 #@TestPurpose Verify basic LDAP modify operations #@TestPreamble Common Setup #@TestStep Run LDAP modify operations #@TestPostamble Common Cleanup #@TestResult Test is successful if the result code is 0 <
function name="basic_replication_operations_001" scope="local">
<
testcase name="getTestCaseName('modrate')">
<
call function="'testCase_Preamble'"/>
'Test Name = %s' % STAXCurrentTestcase
<
call function="'testStep'">
{ 'stepMessage' : 'ModRate.' }
<
timer duration="timerDuration">
<
call function="'modRate'">
'dsInstanceHost' : masterHost,
'dsBaseDN' : '"uid=user.%s,ou=People,o=example"',
'extraParams' : '-g "rand(0,%s)" -g "randstr(40)" -c 10' % (numberOfEntries - 1),
'attribute' : 'description' ,
<
call function="'getFile'">
{ 'location' : masterHost ,
<
if expr="errorFound == False">
<
tcstatus result="'pass'"/>
<
message>'Error found during modrate'</
message>
<
tcstatus result="'fail'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Do search on the master.' }
<
call function="'ldapSearchWithScript'">
'dsInstanceHost' : masterHost,
'dsBaseDN' : synchroSuffix,
'dsFilter' : 'objectclass=*',
<
call function="'testStep'">
{ 'stepMessage' : 'Do search on the client.' }
<
call function="'ldapSearchWithScript'">
'dsInstanceHost' : clientHost,
'dsBaseDN' : synchroSuffix,
'dsFilter' : 'objectclass=*',
<
call function="'testStep'">
{ 'stepMessage' : 'Verify the tree synchronization.' }
<
call function="'verifyTreesSdk'">
[ clientHost, clientPath, master, consumerList, synchroSuffix ]
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Basic: replication operations #@TestName Basic: replication operations #@TestID basic_replication_operations_002 #@TestPurpose Verify basic LDAP authentication operations #@TestPreamble Common Setup #@TestStep Run LDAP authentication operations #@TestPostamble Common Cleanup #@TestResult Test is successful if the result code is 0 <
function name="basic_replication_operations_002" scope="local">
<
testcase name="getTestCaseName('addrate')">
<
call function="'testCase_Preamble'"/>
'Test Name = %s' % STAXCurrentTestcase
<
call function="'testStep'">
{ 'stepMessage' : 'Addrate.' }
<
timer duration="timerDuration">
<
call function="'addRate'">
'dsInstanceHost' : masterHost,
'templateFile' : addTemplate,
'extraParams' : '-g "inc(%s,%s)" -g "randstr(5)" -g "randstr(5)" -g "randstr(5)" -g "randstr(5)" -m 100000' \
% (numberOfEntries, 2 * numberOfEntries),
<
call function="'getFile'">
{ 'location' : masterHost ,
<
if expr="errorFound == False">
<
tcstatus result="'pass'"/>
<
message>'Error found during addrate'</
message>
<
tcstatus result="'fail'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Do search on the master and check number of entries.' }
<
call function="'ldapSearchWithScript'">
'dsInstanceHost' : masterHost,
'dsCountEntries' : 'True' ,
'dsBaseDN' : synchroSuffix,
'dsFilter' : 'objectclass=*',
'location' : STAF_REMOTE_HOSTNAME ,
'testString': 'Total number of matching entries: 200002'
<
call function="'testStep'">
{ 'stepMessage' : 'Do search on the client and check number of entries.' }
<
call function="'ldapSearchWithScript'">
'dsInstanceHost' : clientHost,
'dsCountEntries' : 'True' ,
'dsBaseDN' : synchroSuffix,
'dsFilter' : 'objectclass=*',
'location' : STAF_REMOTE_HOSTNAME ,
'testString': 'Total number of matching entries: 200002'
<
call function="'testStep'">
{ 'stepMessage' : 'Verify the tree synchronization.' }
<
call function="'verifyTreesSdk'">
[ clientHost, clientPath, master, consumerList, synchroSuffix ]
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Basic: replication operations #@TestName Basic: replication operations #@TestID basic_replication_operations_003 #@TestPurpose Verify basic LDAP search operations #@TestPreamble Common Setup #@TestStep Run LDAP search operations #@TestPostamble Common Cleanup #@TestResult Test is successful if the result code is 0 <
function name="basic_replication_operations_003" scope="local">
<
testcase name="getTestCaseName('delrate')">
<
call function="'testCase_Preamble'"/>
'Test Name = %s' % STAXCurrentTestcase
<
call function="'testStep'">
{ 'stepMessage' : 'DelRate.' }
<
timer duration="timerDuration">
<
call function="'delRate'">
'dsInstanceHost' : masterHost,
'dsBaseDN' : '"uid=user.%s,ou=People,o=example"',
'extraParams' : '-g "inc(0,%s)" -m 100000' % (numberOfEntries - 1),
<
call function="'getFile'">
{ 'location' : masterHost ,
<
if expr="errorFound == False">
<
tcstatus result="'pass'"/>
<
message>'Error found during delrate'</
message>
<
tcstatus result="'fail'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Do search on the master and check number of entries.' }
<
call function="'ldapSearchWithScript'">
'dsInstanceHost' : masterHost,
'dsCountEntries' : 'True' ,
'dsBaseDN' : synchroSuffix,
'dsFilter' : 'objectclass=*',
'location' : STAF_REMOTE_HOSTNAME ,
'testString': 'Total number of matching entries: 100002'
<
call function="'testStep'">
{ 'stepMessage' : 'Do search on the client and check number of entries.' }
<
call function="'ldapSearchWithScript'">
'dsInstanceHost' : clientHost,
'dsCountEntries' : 'True' ,
'dsBaseDN' : synchroSuffix,
'dsFilter' : 'objectclass=*',
'location' : STAF_REMOTE_HOSTNAME ,
'testString': 'Total number of matching entries: 100002'
<
call function="'testStep'">
{ 'stepMessage' : 'Verify the tree synchronization.' }
<
call function="'verifyTreesSdk'">
[ clientHost, clientPath, master, consumerList, synchroSuffix ]
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>