topology.xml revision d25372dc8e65a9ed019a88fdf659ca61313f1b31
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<?xml version="1.0" encoding="UTF-8" standalone="no"?>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! CDDL HEADER START
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! The contents of this file are subject to the terms of the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! Common Development and Distribution License, Version 1.0 only
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! (the "License"). You may not use this file except in compliance
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! You can obtain a copy of the license at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! See the License for the specific language governing permissions
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! When distributing Covered Code, include this CDDL HEADER in each
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! file and include the License file at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! add the following below this CDDL HEADER, with the fields enclosed
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! by brackets "[]" replaced with your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! Portions Copyright [yyyy] [name of copyright owner]
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! CDDL HEADER END
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! Copyright 2007-2008 Sun Microsystems, Inc.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster This function creates the topology required by the Test Group/Suite.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="None">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Topology Description file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="filePath"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="False">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Specifies whether the instance should be initialised with
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster some default data.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="boolean"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="''">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Specifies a relative folder that holds the shared data for the tests
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="string"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if not sharedDataFolder and CurrentTestPath.has_key('group'):
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster sharedDataFolder=CurrentTestPath['group']
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'groupDataDir' : sharedDataFolder }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- SINGLE instance deployment: read parameters from config.py (done
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster by default) -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'SINGLE instance deployment: read parameters from config.py'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <if expr="RC == 0 and initialiseInstance == True">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Load the server with default data -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster file="'%s/testcases/quickstart/quickstart.xml' % (TESTS_DIR)" />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- MULTIPLE instance deployment: read parameters from
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster topologyDescFile -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'MULTIPLE instance deployment: read parameters from %s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % topologyDescFile
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Parse the topology description file and set
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster _topologyServerList -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'file' : topologyDescFile }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Number of server instances required by the deployment: %s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % len(_topologyServerList)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <iterate var="server" in="_topologyServerList">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Create the instance-->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsAdminPort' : server.getAdminPort(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsSslPort' : server.getSslPort(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsJmxPort' : server.getJmxPort(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsBindDN' : server.getRootDn(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsBindPwd' : server.getRootPwd(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster This function prepares locally the necessary
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster files to create an instance: data zip file and OpenDS zip file.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="''">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Specifies a relative folder that holds the shared data for the test
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="string"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="[]">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Specifies a list of file extension to add to testdata.zip
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="list"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- ON LOCAL HOST: get data ready to copy to remote host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster sourceTestsGroupDir='%s/%s' % (source.data,groupDataDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster localTestsGroupDir ='%s/%s' % (local.data, groupDataDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster remoteTestsGroupDir='%s/%s' % (remote.data,groupDataDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'entry' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'attribute' : 'TYPE'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- If the test data is already created then don't redo it -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Locally copy static data files to temporary staging area -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- LDIF (.ldif) test data files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy ldif data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'ldif'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- add file extension test data files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy %s data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (ft,sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : '%s' % ft
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- LDIF (.ldif) files for quickinstall -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster quickStartGroupDir='%s/quickstart' % (source.data)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster quickStartLocalTestsGroupDir='%s/quickstart' % local.data
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy quickstart ldif data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (quickStartGroupDir,quickStartLocalTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : quickStartGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : quickStartLocalTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'ldif'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- PWD (.pwd) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy pwd data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'pwd'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive (.gz) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy gz data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'gz'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive (.ref) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy ref data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'ref'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive (ldap/.java) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy java files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (javaSharedDir,javaLocalDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : javaSharedDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : javaLocalDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'java'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Check if ldap java files are already compiled -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : javaLocalDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'class'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Compile ldap java files on controler host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Compile Java files under %s on %s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (javaLocalDir, STAXServiceMachine)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : '%s' % javaLocalDir
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive (.security) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy security data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'security'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive (snmp/.java) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy java files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (javaSharedDir,javaLocalDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : javaSharedDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : javaLocalDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'java'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Check if 'SNMP_OPENDMK_LIBDIR' exists -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'entry' : SNMP_OPENDMK_LIBDIR,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'attribute' : 'TYPE'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- 'SNMP_OPENDMK_LIBDIR' exists so we can continue with SNMP -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Check if snmp java files are already compiled -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : javaLocalDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'class'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Install DS Copy zip file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy DS zip archive locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (ZIPPATH,TMPDIR)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfile' : '%s/%s' % (ZIPPATH, ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfile' : '%s/%s' % (TMPDIR, ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'remotehost' : STAXServiceMachine
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Install DS Extract zip file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Extract locally DS zip archive to %s' % TMPDIR
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'zipfile' : '%s/%s' % (TMPDIR, ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'unzipdir' : TMPDIR
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'type' : 'STRING',
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if is_windows_platform(STAXServiceMachine):
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster jstaf_jarfile='%s\\bin\\JSTAF.jar' % STAFResult
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Compile snmp java files on controler host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Compile Java files under %s on %s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (javaLocalDir, STAXServiceMachine)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster opends_jarfile='%s/%s' % (TMPDIR,SNMP_OPENDS_JARFILE)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if is_windows_platform(STAXServiceMachine):
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster separator=';'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster separator=':'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : javaLocalDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'classpath' : '%s%s%s%s%s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (opends_jarfile,separator,SNMP_OPENDMK_JARFILE,separator,jstaf_jarfile)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Delete the DS zip archive -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Delete %s/%s' % (TMPDIR, ZIPNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'filename' : '%s/%s' % (TMPDIR, ZIPNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Delete the DS install dir -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Delete %s/%s' % (TMPDIR, OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : '%s/%s' % (TMPDIR, OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive SNMP_OPENDMK_JARFILE file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy OpenDMK jar file %s locally to %s.' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (SNMP_OPENDMK_JARFILE,javaLocalDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'remotehost' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfile' : SNMP_OPENDMK_JARFILE,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'remotehost' : STAXServiceMachine
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Delete the any existing testdata archive -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Zip up local testdata files to %s/testdata.zip' % local.temp
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster javaLocalDir='%s' % local.java
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Test data for %s group is already created.' % groupDataDir
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster This function creates an instance on a given host.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster It copies both data and OpenDS zip files onto the host,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster unzips them, and configures OpenDS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_HOST">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Hostname where the instance is to be created
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="hostname"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_DIR">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory where OpenDS will be installed
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="filepath"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_PORT">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server port number
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="Port number"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_ADMIN_PORT">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server admin port number
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="Port number"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_SSL_PORT">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server SSL port number
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="Port number"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="None">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server JMX port number
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="Port number"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_DN">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Manager DN
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="DN"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_PSWD">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server SSL port number
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="string"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_SFX">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server base suffix dn
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="DN"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Create instance in host %s at directory %s' % (dsHost,dsDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- ON REMOTE HOST: copy files, unzip, configure instance -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Delete folder if it exists on remote host-->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Delete folder %s/%s on host %s' % (dsDir,OPENDSNAME,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : dsHost,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : '%s/%s' % (dsDir,OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Create folder on remote host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Create folder %s on host %s' % (dsDir,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : dsHost,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : '%s' % dsDir
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Copy staging data to remote host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy %s/testdata.zip to %s on %s' % (local.testdata,dsDir,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'remotehost' : dsHost
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Unzip contents of staging data on remote host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Extract contents of test data %s on %s' % (dsDir,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : dsHost,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'unzipdir' : dsDir
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Install DS Copy zip file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy DS zip archive %s/%s to %s' % (local.temp,ZIPNAME,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'srcfile' : '%s/%s' % (ZIPPATH,ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfile' : '%s/%s' % (dsDir,ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'remotehost' : dsHost
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Install DS Extract zip file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Extract DS zip archive to %s on %s' % (dsDir,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : dsHost,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'zipfile' : '%s/%s' % (dsDir,ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'unzipdir' : dsDir
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- fixMe: Windows Services are not enabled -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster enableWindowsService=''
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster enableWindowsService=''
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- configure the coverage dump file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster mylog="::coverage - checking for %s/%s/lib/emma.jar\n" % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if os.path.exists('%s/%s/lib/emma.jar' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)):
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster mylog+=" ::coverage on\n"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (TMPDIR,CurrentTestPath['group'])):
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster os.mkdir('%s/coverage/%s' % (TMPDIR,CurrentTestPath['group']))
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (TMPDIR,CurrentTestPath['group'])
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster mylog+=" ::writing to %s/%s/classes/emma.properties" \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster coveragefh = open( '%s/%s/classes/emma.properties' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME), 'w' )
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster coveragefh.write( 'coverage.out.file=%s/coverage/%s/coverage.ec\n' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (TMPDIR,CurrentTestPath['group']) )
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Set up DS -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Set up DS on %s : %s/%s' % (dsHost,dsDir,OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : dsHost,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsPath' : '%s/%s' % (dsDir, OPENDSNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsPort' : dsPort,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsAdminPort' : dsAdminPort,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsJmxPort' : dsJmxPort,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsBindDN' : dsBindDN,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsBindPwd' : dsBindPwd,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsBaseDN' : dsBaseDN,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsEnableWindowsService' : enableWindowsService,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsDoNotStart' : 'true'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'returncode' : RC ,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'result' : STAXResult
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Instance created.'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Failed to create instance.'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function name="DEPRECATEDconfigureReplication">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster This function configures replication in a given server.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="syncserverMap" type="required">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Map containing a Server class instance representing the server to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="map"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster syncserver = syncserverMap['instance']
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster filePath = '%s/%s' % (local.testdata,filename)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster dataDir = '%s/%s' % (syncserver.getDir(),remote.reldatadir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster write_replication_conf_ldif_file(filePath, syncserver)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Configure replication on server on host %s at directory %s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (syncserver.getHostname(),syncserver.getDir())
'Copy %s file from %s to %s' % (filename,local.testdata,dataDir)
'remotehost' : syncserver.getHostname()
<!--- Add replication configuration entries to config.ldif in server -->
syncserverPath = '%s/%s' % (syncserver.getDir(),OPENDSNAME)
{ 'location' : syncserver.getHostname(),
{ 'location' : syncserver.getHostname(),
'dsInstanceHost' : syncserver.getHostname(),
'dsInstancePort' : syncserver.getPort(),
'dsInstanceDn' : syncserver.getRootDn(),
'dsInstancePswd' : syncserver.getRootPwd(),
{ 'location' : syncserver.getHostname(),
'dsHost' : syncserver.getHostname(),
'dsAdminPort' : syncserver.getAdminPort(),
'dsBindDN' : syncserver.getRootDn(),
'dsBindPwd' : syncserver.getRootPwd()
syncserverPath = '%s/%s' % (syncserver.getDir(),OPENDSNAME)
{ 'location' : syncserver.getHostname(),
{ 'location' : syncserver.getHostname(),
'dsInstanceHost' : syncserver.getHostname(),
'dsInstancePort' : syncserver.getPort(),
'dsInstanceDn' : syncserver.getRootDn(),
'dsInstancePswd' : syncserver.getRootPwd(),
{ 'location' : syncserver.getHostname(),
'dsInstanceHost' : syncserver.getHostname(),
'dsInstanceAdminPort' : syncserver.getAdminPort(),
'dsInstanceDn' : syncserver.getRootDn(),
'dsInstancePswd' : syncserver.getRootPwd()
replicationServer = syncserver.getChangelogServer()
replicatedSuffixList = syncserver.getSynchronizedSuffixList()
{ 'location' : syncserver.getHostname(),
'dsInstanceHost' : syncserver.getHostname(),
'dsInstanceAdminPort' : syncserver.getAdminPort(),
'dsInstanceDn' : syncserver.getRootDn(),
'dsInstancePswd' : syncserver.getRootPwd(),
'replicationPort' : replicationServer.getPort(),
'replicationServerId' : replicationServer.getId(),
'replicationServerList' : replicationServer.getChangelogServerList()
'Create domain name for suffix: %s' % suffix.getSuffixDn()
{ 'location' : syncserver.getHostname(),
'dsInstanceHost' : syncserver.getHostname(),
'dsInstanceAdminPort' : syncserver.getAdminPort(),
'dsInstanceDn' : syncserver.getRootDn(),
'dsInstancePswd' : syncserver.getRootPwd(),
'replicationDn' : suffix.getSuffixDn(),
'serverId' : suffix.getId(),
'replicationServerList' : suffix.getChangelogServerList()
{ 'location' : syncserver.getHostname(),
'dsHost' : syncserver.getHostname(),
'dsAdminPort' : syncserver.getAdminPort(),
'dsBindDN' : syncserver.getRootDn(),
'dsBindPwd' : syncserver.getRootPwd()
STAFCmdParamsList.append('enable')
STAFCmdParamsList.append('-n')
STAFCmdParamsList.append('-Q')
STAFCmdParamsList.append('-X')
STAFCmdParamsList.append('--host1 %s' % dsInstanceHost)
STAFCmdParamsList.append('--port1 %s' % dsInstanceAdminPort)
STAFCmdParamsList.append('--bindDN1 "%s"' % dsInstanceDn)
STAFCmdParamsList.append('--bindPassword1 "%s"' % dsInstancePswd)
STAFCmdParamsList.append('--replicationPort1 %s' % dsReplicationPort)
STAFCmdParamsList.append('--secureReplication1')
STAFCmdParamsList.append('--host2 %s' % refInstanceHost)
STAFCmdParamsList.append('--port2 %s' % refInstanceAdminPort)
STAFCmdParamsList.append('--bindDN2 "%s"' % refInstanceDn)
STAFCmdParamsList.append('--bindPassword2 "%s"' % refInstancePswd)
STAFCmdParamsList.append('--replicationPort2 %s' % refReplicationPort)
STAFCmdParamsList.append('--secureReplication2')
STAFCmdParamsList.append('-b "%s"' % dn)
STAFCmdParamsList.append('-I "%s"' % adminUID)
STAFCmdParamsList.append('-w "%s"' % adminPswd)
STAFCmdParamsList.append('--noSchemaReplication')
STAFCmdParamsList.append('--useSecondServerAsSchemaSource')
STAFCmdParamsList.append('initialize')
STAFCmdParamsList.append('initialize-all')
STAFCmdParamsList.append('-n')
STAFCmdParamsList.append('-Q')
STAFCmdParamsList.append('-X')
STAFCmdParamsList.append('-O %s' % dsInstanceHost)
STAFCmdParamsList.append('--portDestination %s' % dsInstanceAdminPort)
STAFCmdParamsList.append('-h %s' % sourceInstanceHost)
STAFCmdParamsList.append('-p %s' % sourceInstanceAdminPort)
STAFCmdParamsList.append('-b "%s"' % dn)
STAFCmdParamsList.append('-I "%s"' % adminUID)
STAFCmdParamsList.append('-w "%s"' % adminPswd)
STAFCmdParamsList.append('disable')
STAFCmdParamsList.append('-n')
STAFCmdParamsList.append('-Q')
STAFCmdParamsList.append('-X')
STAFCmdParamsList.append('-h %s' % dsInstanceHost)
STAFCmdParamsList.append('-p %s' % dsInstanceAdminPort)
STAFCmdParamsList.append('-b "%s"' % dn)
STAFCmdParamsList.append('-I "%s"' % adminUID)
STAFCmdParamsList.append('-w "%s"' % adminPswd)
fileLines = f.readlines()
if line.startswith('#'):
elif line.find('Hostname') != -1:
hostname = line[line.find('Hostname') + 9:].strip()
elif line.find('Directory') !=-1:
dir = line[line.find('Directory') + 10:].strip()
elif line.find('Port') != -1:
port = line[line.find('Port') + 5:].strip()
elif line.find('Adminport') != -1:
adminport = line[line.find('Adminport') + 10:].strip()
elif line.find('Sslport') != -1:
sslport = line[line.find('Sslport') + 8:].strip()
elif line.find('Jmxport') != -1:
jmxport = line[line.find('Jmxport') + 8:].strip()
elif line.find('RootDn') != -1:
rootDn = line[line.find('RootDn') + 7:].strip()
elif line.find('RootPwd') != -1:
rootPwd = line[line.find('RootPwd') + 8:].strip()
elif line.find('BaseDn') != -1:
baseDn = line[line.find('BaseDn') + 7:].strip()
elif line.find('Changelogport') != -1:
changelogport = line[line.find('Changelogport') + 14:].strip()
elif line.find('SynchronizedSuffix') != -1:
elif line.find('ChangelogServer') != -1:
elif (line.isspace()) or (len(line) == 0):
srv = item[:item.find(':')]
prt = item[item.find(':') + 1:]
changelogServer.addChangelogServer(srv, prt)
server.addChangelogServer(changelogServer)
srv = item[:item.find(':')]
prt = item[item.find(':') + 1:]
synchroSuffix.addChangelogServer(srv, prt)
server.addSynchronizedSuffix(synchroSuffix)
_topologyServerList.append(server)
srv = item[:item.find(':')]
prt = item[item.find(':') + 1:]
changelogServer.addChangelogServer(srv, prt)
server.addChangelogServer(changelogServer)
srv = item[:item.find(':')]
prt = item[item.find(':') + 1:]
synchroSuffix.addChangelogServer(srv, prt)
server.addSynchronizedSuffix(synchroSuffix)
_topologyServerList.append(server)
f.close()
a multiple-instance topology (i.e. parameters read from topology desc
<!-- SINGLE instance deployment: parameters read from config.py (done by
{ 'dsHost' : server.getHostname(),
'dsDir' : server.getDir()
STAFCmdParamsList.append('pre-external-initialization')
STAFCmdParamsList.append('-n')
STAFCmdParamsList.append('-Q')
STAFCmdParamsList.append('-X')
STAFCmdParamsList.append('-h %s' % dsInstanceHost)
STAFCmdParamsList.append('-p %s' % dsInstanceAdminPort)
STAFCmdParamsList.append('-l')
STAFCmdParamsList.append('-b "%s"' % dn)
STAFCmdParamsList.append('-I "%s"' % adminUID)
STAFCmdParamsList.append('-w "%s"' % adminPswd)
STAFCmdParamsList.append('post-external-initialization')
STAFCmdParamsList.append('-n')
STAFCmdParamsList.append('-Q')
STAFCmdParamsList.append('-X')
STAFCmdParamsList.append('-h %s' % dsInstanceHost)
STAFCmdParamsList.append('-p %s' % dsInstanceAdminPort)
STAFCmdParamsList.append('-b "%s"' % dn)
STAFCmdParamsList.append('-I "%s"' % adminUID)
STAFCmdParamsList.append('-w "%s"' % adminPswd)
% (strftime('%Y-%m-%d %H:%M:%S',localtime()),random.randint(0,999))