3361N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
3361N/A ! The contents of this file are subject to the terms of the 3361N/A ! Common Development and Distribution License, Version 1.0 only 3361N/A ! (the "License"). You may not use this file except in compliance 3361N/A ! You can obtain a copy of the license at 3361N/A ! See the License for the specific language governing permissions 3361N/A ! and limitations under the License. 3361N/A ! When distributing Covered Code, include this CDDL HEADER in each 3361N/A ! file and include the License file at 3361N/A ! add the following below this CDDL HEADER, with the fields enclosed 3361N/A ! by brackets "[]" replaced with your own identifying information: 3361N/A ! Portions Copyright [yyyy] [name of copyright owner] 5061N/A ! Portions Copyright 2008-2010 Sun Microsystems, Inc. 6184N/A ! Portions Copyright 2011-2013 ForgeRock AS 3361N/A <
defaultcall function="dsml_setup" />
3361N/A <
function name="dsml_setup">
4495N/A <
block name="'dsml_setup'">
3361N/A <!--- Test Case information 3379N/A #@TestName setup: prepare DSML directory server 3379N/A #@TestPurpose Prepare the directory server necessary to the 3379N/A #@TestStep prepare dsml directory server instance 3361N/A #@TestResult Success if returns 0. 4714N/A <
testcase name="getTestCaseName('prepare DSML STAF service')">
4714N/A <
call function="'testCase_Preamble'"/>
4714N/A <
call function="'createFolder'">
4714N/A 'location' : STAXServiceMachine,
5061N/A <
if expr="IPS_PKG == True">
5061N/A <
call function="'copyFile'">
5061N/A 'location' : STAF_REMOTE_HOSTNAME,
5061N/A 'remotehost' : STAXServiceMachine
5061N/A <
call function="'unZipFile'">
5061N/A 'location' : STAXServiceMachine,
5061N/A 'zipfile' : '%s/%s' % (ZIPPATH, ZIPNAME),
5369N/A <!-- The war file can be included in the OpenDJ archive --> 5105N/A <
call function="'unZipFile'">
5105N/A 'location' : STAXServiceMachine,
5105N/A 'zipfile' : '%s/%s' % (ZIPPATH, ZIPNAME),
5061N/A <
call function="'copyFile'">
5061N/A 'location' : STAXServiceMachine,
5061N/A 'remotehost' : STAXServiceMachine
5369N/A <!-- The war file can be included in the OpenDJ archive --> 4714N/A <
call function="'unZipFile'">
4714N/A 'location' : STAXServiceMachine,
4714N/A <
call function="'copyFolder'">
4714N/A 'location' : STAXServiceMachine,
4714N/A 'remotehost' : STAXServiceMachine
5065N/A <
call function="'copyFile'">
5065N/A 'location' : STAF_REMOTE_HOSTNAME,
5065N/A 'remotehost' : STAXServiceMachine
4714N/A if is_windows_platform(STAXServiceMachine):
4714N/A 'location' : STAXServiceMachine,
4714N/A <
call function="'compileJava'" >
4714N/A 'location' : STAXServiceMachine,
5065N/A 'classpath' : '%s%s%s%s%s%s%s' \
5065N/A % (opendsjar,separator,emmajar,separator,dsmlclasses,separator,cp)
4776N/A <
call function="'copyFile'">
4776N/A 'location' : STAXServiceMachine,
4776N/A 'remotehost' : STAXServiceMachine
4714N/A <
call function="'createFolder'">
4714N/A <
call function="'createJar'" >
4714N/A 'location' : STAXServiceMachine,
4714N/A <
call function="'addSTAFJavaService'" >
4714N/A 'location' : STAXServiceMachine,
4714N/A <
call function="'testCase_Postamble'"/>
4714N/A <!--- Test Case information 4714N/A #@TestName setup: prepare DSML directory server 4714N/A #@TestPurpose Prepare the directory server necessary to the 4714N/A #@TestStep prepare dsml directory server instance 4714N/A #@TestResult Success if returns 0. 3361N/A <
testcase name="getTestCaseName('prepare DSML Directory backend')">
3361N/A <
call function="'testCase_Preamble'"/>
3361N/A <
call function="'prepareInstanceCreation'">
4662N/A 'fileExtensions' : ['dat','res','issue'] }
3361N/A <
call function="'checktestRC'">
3361N/A <
call function="'testCase_Postamble'"/>
3361N/A <!--- Test Case information 3361N/A #@TestName setup: create DSML directory server 3361N/A #@TestPurpose Create the directory server necessary to the 3361N/A #@TestResult Success if returns 0. 3361N/A <
testcase name="getTestCaseName('Create, Initialize and Start DSML Directory backend')">
3361N/A <
call function="'testCase_Preamble'"/>
3361N/A <
call function="'createInstance'"/>
3361N/A <
call function="'checktestRC'">
3361N/A <
call function="'StartDsWithScript'">
3379N/A { 'location' : DIRECTORY_INSTANCE_HOST }
3361N/A <
call function="'checktestRC'">
3361N/A <
call function="'isAlive'">
3361N/A 'noOfMilliSeconds' : 2000 }
3361N/A <
call function="'checkRC'">
3361N/A <
call function="'testCase_Postamble'"/>
3361N/A <!--- Test Case information 3361N/A #@TestName setup: import DSML directory server test data 3361N/A #@TestPurpose Import the directory server test data. 3361N/A #@TestResult Success if returns 0. 3361N/A <
testcase name="getTestCaseName('Import DSML test data in Directory backend')">
3361N/A <
call function="'testCase_Preamble'"/>
3361N/A DIRECTORY_INSTANCE_DIR, OPENDSNAME)
3392N/A createBackendOptions=' '.join(options)
3392N/A <
call function="'dsconfig'">
3392N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3392N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3392N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
3392N/A 'subcommand' : 'create-backend',
3392N/A 'optionsString' : createBackendOptions
5064N/A <
call function="'ImportLdifWithScript'">
5073N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
5064N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
5073N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
5073N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
4662N/A <
call function="'ldapSearchWithScript'">
4662N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
4662N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
4662N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
4662N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
4662N/A 'dsCountEntries' : 'True' ,
4662N/A 'dsFilter' : 'objectclass=*' ,
4662N/A returnString = STAXResult[0][1]
4662N/A <
call function="'checktestString'">
4662N/A 'returnString' : returnString ,
6184N/A 'expectedString' : 'Total number of matching entries: %s' % nbEntriesExpected
3361N/A <
call function="'checkRC'">
3361N/A <
call function="'checktestRC'">
3361N/A <
call function="'testCase_Postamble'"/>
3361N/A <!--- Test Case information 3361N/A #@TestName setup: create webcontainer 3361N/A #@TestPurpose Create the webcontainer necessary to the 3361N/A #@TestResult Success if createWebcontainer returns 0. 3361N/A <
testcase name="getTestCaseName('setup: create webcontainer')">
3361N/A <
call function="'testCase_Preamble'"/>
3361N/A <
call function="'createWebcontainer'" />
3361N/A <
call function="'checktestRC'">
3361N/A <
call function="'testCase_Postamble'"/>
3361N/A <!--- Test Case information 3361N/A #@TestName setup: deploy web application WAR file 3361N/A #@TestPurpose Deploy web application necessary to the 3361N/A #@TestResult Success if deployWebApplicationWAR returns 0. 3392N/A <
testcase name="getTestCaseName('setup: deploy Webapplication')">
3361N/A <
call function="'testCase_Preamble'"/>
5369N/A <!-- The war file can be included in the OpenDJ archive --> 3361N/A <
call function="'deployWebApplicationWAR'">
3379N/A { 'warFilePath' : '%s' % DSML_WARPATH }
3361N/A <
call function="'checktestRC'">
3361N/A <
call function="'testCase_Postamble'"/>
3361N/A <!--- Test Case information 3361N/A #@TestName setup: start web webcontainer 3361N/A #@TestPurpose Start the webcontainer necessary to the 3361N/A #@TestResult Success if statWebcontainerWithScript returns 0. 3361N/A <
testcase name="getTestCaseName('setup: start webcontainer')">
3361N/A <
call function="'testCase_Preamble'"/>
3379N/A <
call function="'startWebcontainerWithScript'"/>
3361N/A <
stafcmd name="'waiting for webcontainer startup'">
3361N/A <
location>'%s' % location</
location>
3361N/A <
request>' DELAY 10000'</
request>
3361N/A <
call function="'testCase_Postamble'"/>
3379N/A <!--- Test Case information 3379N/A #@TestName setup: configure DSML gateway DS port param 3379N/A #@TestSteps substitute default port 389 with DIRECTORY_INSTANCE_PORT 3379N/A #@TestSteps substitute default directory host localhost with DIRECTORY_INSTANCE_HOST 3379N/A #@TestResult Success if statWebcontainerWithScript returns 0. 3361N/A <
testcase name="getTestCaseName('configure: dsml web.xml port')">
3361N/A <
call function="'testCase_Preamble'"/>
3392N/A 'setup: configure DSML gateway DS port param.'
3889N/A 'Create folder %s on host %s' % (myTmpDir,STAXServiceMachine)
3889N/A <
call function="'createFolder'">
3889N/A { 'location' : STAXServiceMachine,
3889N/A 'foldername' : '%s' % myTmpDir
5369N/A <!-- The war file can be included in the OpenDJ archive --> 3392N/A <
call function="'runSTAFCommand'">
3392N/A 'location' : STAXServiceMachine,
3889N/A 'Update DSML gateway
web.xml file on host %s' % STAF_REMOTE_HOSTNAME
4978N/A # create the autodeploy webapp path
4978N/A destWebXml =
os.path.join(WC_DIRECTORY, 'apache-%s-%s' % (WC_TYPE, WC_VERSION), 'webapps',
5116N/A destEmmaProp =
os.path.join(WC_DIRECTORY, 'apache-%s-%s' % (WC_TYPE, WC_VERSION), 'webapps',
4978N/A elif WC_TYPE == 'glassfish':
4978N/A 'domains', 'domain1', 'applications',
5116N/A 'domains', 'domain1', 'applications',
4978N/A elif WC_TYPE == 'sunwebserver':
4978N/A destWebXml =
os.path.join(WC_DIRECTORY, '%s-%s' % (WC_TYPE, WC_VERSION), 'https-%s' % STAF_REMOTE_HOSTNAME,
4978N/A 'generated', STAF_REMOTE_HOSTNAME, 'dsml', 'WEB-INF', '
web.xml')
5116N/A destEmmaProp =
os.path.join(WC_DIRECTORY, '%s-%s' % (WC_TYPE, WC_VERSION), 'https-%s' % STAF_REMOTE_HOSTNAME,
4978N/A loopSleep = 1000 # 1000 millisecondes
4978N/A <
message>'checking presence of deployed dsml %s' % destWebXml</
message>
4978N/A <
loop from="0" to="nbLoop" while="RC == 48">
4978N/A {'sleepForMilliSeconds' : loopSleep }
4978N/A <
message>'going to sleep for 2 secondes'</
message>
4978N/A <
call function="'GetEntry'">
4978N/A 'location' : STAF_REMOTE_HOSTNAME,
4978N/A <
call function="'copyFile'">
4978N/A { 'location' : STAXServiceMachine,
4978N/A 'remotehost' : '%s' % STAF_REMOTE_HOSTNAME,
4978N/A <
call function="'checktestRC'">
5116N/A 'PATH DEST %s' % destEmmaProp
5116N/A <
call function="'copyFile'">
5116N/A { 'location' : STAXServiceMachine,
5116N/A 'remotehost' : '%s' % STAF_REMOTE_HOSTNAME,
5116N/A <
call function="'checktestRC'">
4978N/A <
call function="'stopWebcontainerWithScript'"/>
4978N/A <
call function="'startWebcontainerWithScript'"/>
4978N/A 'the target %s is not available after %sms' % (destWebXml, (nbLoop*loopSleep))
3361N/A <
call function="'checktestRC'">
3361N/A <
call function="'testCase_Postamble'"/>