93N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
93N/A ! The contents of this file are subject to the terms of the 93N/A ! Common Development and Distribution License, Version 1.0 only 93N/A ! (the "License"). You may not use this file except in compliance 292N/A ! You can obtain a copy of the license at 93N/A ! See the License for the specific language governing permissions 93N/A ! and limitations under the License. 292N/A ! When distributing Covered Code, include this CDDL HEADER in each 292N/A ! file and include the License file at 292N/A ! add the following below this CDDL HEADER, with the fields enclosed 292N/A ! by brackets "[]" replaced with your own identifying information: 292N/A ! Portions Copyright [yyyy] [name of copyright owner] 292N/A ! Copyright 2007-2010 Sun Microsystems, Inc. 93N/A <
defaultcall function="replication_ldifimport"/>
93N/A <
function name="replication_ldifimport">
93N/A <
block name="'ldifimport'">
93N/A CurrentTestPath['group']='replication'
93N/A CurrentTestPath['suite']=STAXCurrentBlock
93N/A <
call function="'testSuite_Preamble'"/>
93N/A <!--- Test Suite information 93N/A #@TestSuiteName Replication Ldif Import Tests 93N/A #@TestSuitePurpose Verify that the servers in a replicated topology 93N/A can be initialised by the means of an ldif 93N/A #@TestSuiteID Ldif Import Tests 259N/A #@TestSuiteGroup Ldif Import 93N/A #@TestGroup Replication 93N/A <
import machine="STAF_LOCAL_HOSTNAME" 93N/A <
call function="'replication_setup'" />
93N/A <!--- Test Case information 93N/A #@TestMarker Replication Ldif Import Tests 93N/A #@TestName Replication: Ldif Import: Off-line 93N/A #@TestID Off-line initialisation 93N/A #@TestPurpose Initialise replicated servers using off-line 93N/A #@TestSteps Call dsreplication pre-external-initialization 93N/A #@TestSteps Stop servers 93N/A #@TestSteps Import data on server A 93N/A #@TestSteps Export suffix on server A 93N/A #@TestSteps Import exported file on other servers 93N/A #@TestSteps Start servers 93N/A #@TestSteps Call dsreplication post-external-initialization 93N/A #@TestSteps Add entry on server A 93N/A #@TestResult Success if trees synchronized 93N/A <
testcase name="getTestCaseName('Off-line initialisation')">
93N/A <
call function="'testCase_Preamble'"/>
93N/A 'Replication: Ldif Import: Off-line initialisation. \
93N/A <!-- Pre-initialise the servers in the topology --> 93N/A '+++++ ldif import off-line: prepare servers for external \
93N/A <
call function="'preInitializeReplication'">
93N/A { 'location' : clientHost,
93N/A 'dsPath' : clientPath,
93N/A 'dsInstanceHost' : masterHost,
93N/A 'localOnly' : False,
93N/A 'replicationDnList' : [synchroSuffix],
93N/A 'adminUID' : adminUID,
93N/A 'adminPswd' : adminPswd
93N/A <!-- Stop the servers in the topology --> 93N/A <
call function="'stopServers'">
93N/A [_topologyServerList]
93N/A <!-- Import data into "master" server --> 93N/A '+++++ ldif import off-line: import data on %s:%s' \
93N/A <
call function="'ImportLdifWithScript'">
93N/A { 'location' : masterHost,
93N/A 'dsPath' : masterPath,
93N/A 'backEnd' : DIRECTORY_INSTANCE_BE,
93N/A <!-- Export data from "master" server --> 93N/A '+++++ ldif import off-line: export suffix on server %s:%s' \
93N/A <
call function="'exportLdifWithScript'">
93N/A { 'location' : masterHost,
93N/A 'dsPath' : masterPath,
93N/A <!-- Copy export file to "consumer" servers and import it --> 93N/A <
paralleliterate var="consumer" in="consumerList">
93N/A <
call function="'copyFile'">
93N/A { 'location' : masterHost,
93N/A '+++++ ldif import off-line: import exported file on %s:%s'\
93N/A <
call function="'ImportLdifWithScript'">
93N/A 'backEnd' : DIRECTORY_INSTANCE_BE,
93N/A <!-- Start the servers in the topology --> 93N/A <
call function="'startServers'">
93N/A [_topologyServerList]
93N/A <!-- Check some data was imported into "master" server --> 93N/A <
call function="'checkImport'">
93N/A { 'location' : clientHost,
93N/A 'dsPath' : clientPath,
93N/A 'dsHost' : masterHost,
93N/A 'expectedEntries' : ['uid=scarter,ou=People,o=example',
93N/A 'uid=dmiller, ou=People, o=example',
93N/A 'uid=rhunt, ou=People, o=example'],
93N/A <!-- Post-initialise the servers in the topology --> 93N/A '+++++ ldif import off-line: end external server initialization'
93N/A <
call function="'postInitializeReplication'">
93N/A { 'location' : clientHost,
93N/A 'dsPath' : clientPath,
93N/A 'dsInstanceHost' : masterHost,
93N/A 'replicationDnList' : [synchroSuffix],
93N/A 'adminUID' : adminUID,
93N/A 'adminPswd' : adminPswd
93N/A <!-- Add entry to "master" server --> 93N/A '+++++ ldif import off-line: add entry to %s:%s' \
93N/A <
call function="'addEntry'">
93N/A { 'location' : clientHost,
93N/A 'dsPath' : clientPath,
93N/A 'dsInstanceHost' : masterHost,
93N/A <!-- Verify the synchronization of the trees among the servers in 93N/A <!-- If the trees differ, it could be due to Issue 3122 93N/A (Off-line import-export sequence produces no generationID) --> 93N/A <
call function="'verifyTrees'">
93N/A [ clientHost, clientPath, master, consumerList, synchroSuffix,
93N/A <
call function="'testCase_Postamble'"/>
93N/A <!--- Test Case information 93N/A #@TestMarker Replication Ldif Import Tests 93N/A #@TestName Replication: Ldif Import: On-line initialisation 93N/A #@TestID On-line initialisation 93N/A #@TestPurpose Initialise replicated servers using on-line 93N/A #@TestSteps Call dsreplication pre-external-initialization 93N/A #@TestSteps Import data on server A 93N/A #@TestSteps Export suffix on server A 93N/A #@TestSteps Import exported file on other servers 93N/A #@TestSteps Call dsreplication post-external-initialization 93N/A #@TestSteps Add entry on server A 93N/A #@TestResult Success if trees synchronized 93N/A <
testcase name="getTestCaseName('On-line initialisation')">
93N/A <
call function="'testCase_Preamble'"/>
93N/A 'Replication: Ldif Import: On-line initialisation. Initialise \
93N/A <!-- Pre-initialise the servers in the topology --> 93N/A '+++++ ldif import on-line: prepare servers for external \
93N/A <
call function="'preInitializeReplication'">
93N/A { 'location' : clientHost,
93N/A 'dsPath' : clientPath,
93N/A 'dsInstanceHost' : masterHost,
93N/A 'localOnly' : False,
93N/A 'replicationDnList' : [synchroSuffix],
93N/A 'adminUID' : adminUID,
93N/A 'adminPswd' : adminPswd
93N/A <!-- Import data into "master" server --> 93N/A '+++++ ldif import on-line: import data on %s:%s' \
93N/A <
call function="'ImportLdifWithScript'">
93N/A { 'location' : clientHost,
93N/A 'dsPath' : clientPath,
93N/A 'dsInstanceHost' : masterHost,
93N/A <!-- Check some data was imported into "master" server --> 93N/A <
call function="'checkImport'">
93N/A { 'location' : clientHost,
93N/A 'dsPath' : clientPath,
93N/A 'dsHost' : masterHost,
93N/A 'expectedEntries' : ['uid=scarter,ou=People,o=example',
93N/A 'uid=dmiller, ou=People, o=example',
93N/A 'uid=rhunt, ou=People, o=example'],
93N/A <!-- Export data from "master" server --> 93N/A '+++++ ldif import on-line: export suffix on server %s:%s' \
93N/A <
call function="'exportLdifWithScript'">
93N/A { 'location' : masterHost,
93N/A 'dsPath' : masterPath,
93N/A 'dsInstanceHost' : masterHost,
93N/A 'ldifFile' : sourceFile
93N/A <!-- Copy export file to "consumer" servers and import it --> 93N/A <
paralleliterate var="consumer" in="consumerList">
93N/A filename = 'master_export_online_ldif'
93N/A <
call function="'copyFile'">
93N/A { 'location' : masterHost,
93N/A 'srcfile' : sourceFile,
93N/A 'destfile' : destinationFile
93N/A '+++++ ldif import on-line: import exported file on %s:%s'\
93N/A <
call function="'ImportLdifWithScript'">
93N/A { 'location' : clientHost,
93N/A 'dsPath' : clientPath,
'ldifFile' : destinationFile
<!-- Post-initialise the servers in the topology --> '+++++ ldif import on-line: end external server initialization'
<
call function="'postInitializeReplication'">
{ 'location' : clientHost,
'dsInstanceHost' : masterHost,
'replicationDnList' : [synchroSuffix],
<!-- Add entry to "master" server --> '+++++ ldif import on-line: add entry to %s:%s' \
<
call function="'addEntry'">
{ 'location' : clientHost,
'dsInstanceHost' : masterHost,
<!-- Verify the synchronization of the trees among the servers in <
call function="'verifyTrees'">
[ clientHost, clientPath, master, consumerList, synchroSuffix ]
<
call function="'testCase_Postamble'"/>
<
import machine="STAF_LOCAL_HOSTNAME" <
call function="'replication_cleanup'" />
<
call function="'testSuite_Postamble'"/>